]> git.baikalelectronics.ru Git - kernel.git/commit
regmap: debugfs: Fix continued read from registers file
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 28 Aug 2013 15:55:07 +0000 (17:55 +0200)
committerMark Brown <broonie@linaro.org>
Wed, 28 Aug 2013 17:27:08 +0000 (18:27 +0100)
commit37ddf912f4835a218986048eba20b315afdc5475
treeaab6c4293b719128aed3a88dab19564a542d1b82
parentcf7ce08a85db33cd14077ca5faf6ff873c6bde96
regmap: debugfs: Fix continued read from registers file

The regmap_debugfs_get_dump_start() function maps from a file offset to the
register that can be found at that position in the file. This is done using a
look-up table. Commit 24d307db ("regmap: debugfs: Suppress cache for partial
register files") added a check to bypass the look-up table for partial register
files, since the offsets in that table are only correct for the full register
file. The check incorrectly uses the file offset instead of the register base
address and returns it. This will cause the file offset to be interpreted as a
register address which will result in a incorrect output from the registers file
for all reads except at position 0.

The issue can easily be reproduced by doing small reads the registers file, e.g.
`dd if=registers bs=10 count=5`.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
drivers/base/regmap/regmap-debugfs.c