1. 15 10月, 2012 1 次提交
  2. 09 9月, 2012 1 次提交
  3. 31 8月, 2012 1 次提交
  4. 08 8月, 2012 1 次提交
  5. 04 8月, 2012 7 次提交
  6. 19 7月, 2012 1 次提交
  7. 06 7月, 2012 1 次提交
  8. 19 6月, 2012 1 次提交
  9. 18 6月, 2012 2 次提交
  10. 14 6月, 2012 1 次提交
  11. 08 6月, 2012 1 次提交
  12. 05 6月, 2012 2 次提交
  13. 03 6月, 2012 5 次提交
  14. 30 5月, 2012 1 次提交
  15. 23 5月, 2012 1 次提交
  16. 18 5月, 2012 1 次提交
  17. 15 5月, 2012 1 次提交
  18. 14 5月, 2012 2 次提交
  19. 09 5月, 2012 2 次提交
    • L
      regmap: fix possible memory corruption in regmap_bulk_read() · 6560ffd1
      Laxman Dewangan 提交于
      The function regmap_bulk_read() calls the regmap_read() for
      each register if set of register has volatile and cache is
      enabled. In this case, last few register read makes the memory
      corruption if the register size is not the size of unsigned int.
      The regam_read() takes argument as unsigned int for returning
      value and it update the value as
      	*val = map->format.parse_val(map->work_buf);
      This causes complete 4 bytes (size of unsigned int) to get written.
      Now if client pass the memory pointer for value which is equal to the
      required size of register count in regmap_bulk_read() then last few
      register read actually update the memory beyond passed pointer size.
      
      Avoid this by using local variable for read and then do memcpy()
      for actual byte copy to passed pointer based on register size.
      
      I allocated one pointer ptr and take first 16 bytes dump of that
      pointer then call regmap_bulk_read() with pointer which is just
      on top of this allocated pointer and register count of 128. Here
      register size is 1 byte.
      The memory trace of last 5 register read are as follows:
      
      [    5.438589] regmap_bulk_read after regamp_read() for register 122
      [    5.447421] 0xef993c20 0xef993c00 0x00000000 0x00000001
      [    5.467535] regmap_bulk_read after regamp_read() for register 123
      [    5.476374] 0xef993c20 0xef993c00 0x00000000 0x00000001
      [    5.496425] regmap_bulk_read after regamp_read() for register 124
      [    5.505260] 0xef993c20 0xef993c00 0x00000000 0x00000001
      [    5.525372] regmap_bulk_read after regamp_read() for register 125
      [    5.534205] 0xef993c00 0xef993c00 0x00000000 0x00000001
      [    5.554258] regmap_bulk_read after regamp_read() for register 126
      [    5.563100] 0xef990000 0xef993c00 0x00000000 0x00000001
      [    5.554258] regmap_bulk_read after regamp_read() for register 127
      [    5.587108] 0xef000000 0xef993c00 0x00000000 0x00000001
      
      Here it is observed that the memory content at first word started changing
      on last 3 regmap_read() and so corruption happened.
      Signed-off-by: NLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      6560ffd1
    • M
      regmap: Implement dev_get_regmap() · 72b39f6f
      Mark Brown 提交于
      Use devres to implement dev_get_regmap(). This should mean that in almost
      all cases devices wishing to take advantage of framework features based on
      regmap shouldn't need to explicitly pass the regmap into the framework.
      This simplifies device setup a bit.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      72b39f6f
  20. 01 5月, 2012 3 次提交
  21. 13 4月, 2012 4 次提交
    • S
      regmap: fix compile errors in regmap-irq.c due to stride changes · a21361b9
      Stephen Warren 提交于
      Commit f01ee60f ("regmap: implement register striding") caused the
      compile errors below. Fix them.
      
      drivers/base/regmap/regmap-irq.c: In function 'regmap_irq_sync_unlock':
      drivers/base/regmap/regmap-irq.c:62:12: error: 'map' undeclared (first use in this function)
      drivers/base/regmap/regmap-irq.c:62:12: note: each undeclared identifier is reported only once for each function it appears in
      drivers/base/regmap/regmap-irq.c: In function 'regmap_irq_enable':
      drivers/base/regmap/regmap-irq.c:77:37: error: 'map' undeclared (first use in this function)
      drivers/base/regmap/regmap-irq.c: In function 'regmap_irq_disable':
      drivers/base/regmap/regmap-irq.c:85:37: error: 'map' undeclared (first use in this function)
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      a21361b9
    • S
      regmap: implement register striding · edc9ae42
      Stephen Warren 提交于
      regmap_config.reg_stride is introduced. All extant register addresses
      are a multiple of this value. Users of serial-oriented regmap busses will
      typically set this to 1. Users of the MMIO regmap bus will typically set
      this based on the value size of their registers, in bytes, so 4 for a
      32-bit register.
      
      Throughout the regmap code, actual register addresses are used. Wherever
      the register address is used to index some array of values, the address
      is divided by the stride to determine the index, or vice-versa. Error-
      checking is added to all entry-points for register address data to ensure
      that register addresses actually satisfy the specified stride. The MMIO
      bus ensures that the specified stride is large enough for the register
      size.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      edc9ae42
    • S
      regmap: fix compilation when !CONFIG_DEBUG_FS · 6a8d2511
      Stephen Warren 提交于
      Commit 79c64d5 "regmap: allow regmap instances to be named" changed the
      prototype of regmap_debugfs_init, but didn't update the dummy inline used
      when !CONFIG_DEBUGFS. Fix this.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      6a8d2511
    • S
      regmap: allow regmap instances to be named · 4b5c0186
      Stephen Warren 提交于
      Some devices have multiple separate register regions. Logically, one
      regmap would be created per region. One issue that prevents this is that
      each instance will attempt to create the same debugfs files. Avoid this
      by allowing regmaps to be named, and use the name to construct the
      debugfs directory name.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      4b5c0186