diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-08-28 17:55:07 +0200 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-28 18:27:08 +0100 |
commit | 26ee47411ae22caa07d3f3b63ca6d097cba6681b (patch) | |
tree | aab6c4293b719128aed3a88dab19564a542d1b82 /drivers/base/regmap | |
parent | d8dfad3876e4386666b759da3c833d62fb8b2267 (diff) | |
download | op-kernel-dev-26ee47411ae22caa07d3f3b63ca6d097cba6681b.zip op-kernel-dev-26ee47411ae22caa07d3f3b63ca6d097cba6681b.tar.gz |
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 d6814a7d ("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
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r-- | drivers/base/regmap/regmap-debugfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index 5349575..6c2652a 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c @@ -85,8 +85,8 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map, unsigned int reg_offset; /* Suppress the cache if we're using a subrange */ - if (from) - return from; + if (base) + return base; /* * If we don't have a cache build one so we don't have to do a |