1. 15 10月, 2012 1 次提交
  2. 04 8月, 2012 1 次提交
  3. 06 7月, 2012 1 次提交
  4. 19 6月, 2012 1 次提交
  5. 18 6月, 2012 2 次提交
  6. 08 6月, 2012 1 次提交
  7. 03 6月, 2012 3 次提交
  8. 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
  9. 01 5月, 2012 3 次提交
  10. 13 4月, 2012 7 次提交
  11. 10 4月, 2012 2 次提交
    • S
      regmap: implement register striding · f01ee60f
      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>
      f01ee60f
    • S
      regmap: allow regmap instances to be named · d3c242e1
      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>
      d3c242e1
  12. 07 4月, 2012 1 次提交
  13. 06 4月, 2012 2 次提交
  14. 01 4月, 2012 2 次提交
  15. 12 3月, 2012 1 次提交
    • P
      device.h: cleanup users outside of linux/include (C files) · 51990e82
      Paul Gortmaker 提交于
      For files that are actively using linux/device.h, make sure
      that they call it out.  This will allow us to clean up some
      of the implicit uses of linux/device.h within include/*
      without introducing build regressions.
      
      Yes, this was created by "cheating" -- i.e. the headers were
      cleaned up, and then the fallout was found and fixed, and then
      the two commits were reordered.  This ensures we don't introduce
      build regressions into the git history.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      51990e82
  16. 11 3月, 2012 1 次提交
    • S
      regmap: Fix future missing prototype of devres_alloc() and friends · f5d6eba7
      Stephen Warren 提交于
      [Fix for breakage which will be introduced during the merge window via
      header reworks in another tree, the regmap tree does include device.h
      but Paul's tree breaks that.  Reworded subject to reflect -- broonie]
      
      regmap.s uses devres_alloc() and others that are prototyped in device.h.
      Include that to solve the following:
      
      drivers/base/regmap/regmap.c: In function 'devm_regmap_init':
      drivers/base/regmap/regmap.c:331:2: error: implicit declaration of function 'devres_alloc' [-Werror=implicit-function-declaration]
      drivers/base/regmap/regmap.c:338:3: error: implicit declaration of function 'devres_add' [-Werror=implicit-function-declaration]
      drivers/base/regmap/regmap.c:340:3: error: implicit declaration of function 'devres_free' [-Werror=implicit-function-declaration]
      drivers/base/regmap/regmap.c: In function '_regmap_raw_write':
      drivers/base/regmap/regmap.c:421:5: error: implicit declaration of function 'dev_err' [-Werror=implicit-function-declaration]
      Signed-off-by: NStephen Warren <swarren@wwwdotorg.org>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      f5d6eba7
  17. 01 3月, 2012 1 次提交
  18. 22 2月, 2012 1 次提交
  19. 21 2月, 2012 1 次提交
  20. 18 2月, 2012 1 次提交
  21. 15 2月, 2012 1 次提交
  22. 12 2月, 2012 1 次提交
  23. 10 2月, 2012 1 次提交
  24. 31 1月, 2012 2 次提交