* [PATCH] regmap: regcache-rbtree: Fix present bitmap resize
@ 2015-03-07 16:10 Lars-Peter Clausen
2015-03-07 16:17 ` Mark Brown
2015-03-07 17:36 ` Daniel Baluta
0 siblings, 2 replies; 3+ messages in thread
From: Lars-Peter Clausen @ 2015-03-07 16:10 UTC (permalink / raw)
To: Mark Brown; +Cc: Daniel Baluta, linux-kernel, Lars-Peter Clausen
When inserting a new register into a block at the lower end the present
bitmap is currently shifted into the wrong direction. The effect of this is
that the bitmap becomes corrupted and registers which are present might be
reported as not present and vice versa.
Fix this by shifting left rather than right.
Fixes: 472fdec7380c("regmap: rbtree: Reduce number of nodes, take 2")
Reported-by: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/base/regmap/regcache-rbtree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
index d453a2c..81751a4 100644
--- a/drivers/base/regmap/regcache-rbtree.c
+++ b/drivers/base/regmap/regcache-rbtree.c
@@ -307,7 +307,7 @@ static int regcache_rbtree_insert_to_block(struct regmap *map,
if (pos == 0) {
memmove(blk + offset * map->cache_word_size,
blk, rbnode->blklen * map->cache_word_size);
- bitmap_shift_right(present, present, offset, blklen);
+ bitmap_shift_left(present, present, offset, blklen);
}
/* update the rbnode block, its size and the base register */
--
1.8.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] regmap: regcache-rbtree: Fix present bitmap resize
2015-03-07 16:10 [PATCH] regmap: regcache-rbtree: Fix present bitmap resize Lars-Peter Clausen
@ 2015-03-07 16:17 ` Mark Brown
2015-03-07 17:36 ` Daniel Baluta
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2015-03-07 16:17 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Daniel Baluta, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 357 bytes --]
On Sat, Mar 07, 2015 at 05:10:01PM +0100, Lars-Peter Clausen wrote:
> When inserting a new register into a block at the lower end the present
> bitmap is currently shifted into the wrong direction. The effect of this is
> that the bitmap becomes corrupted and registers which are present might be
> reported as not present and vice versa.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] regmap: regcache-rbtree: Fix present bitmap resize
2015-03-07 16:10 [PATCH] regmap: regcache-rbtree: Fix present bitmap resize Lars-Peter Clausen
2015-03-07 16:17 ` Mark Brown
@ 2015-03-07 17:36 ` Daniel Baluta
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Baluta @ 2015-03-07 17:36 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Mark Brown, Linux Kernel Mailing List
On Sat, Mar 7, 2015 at 6:10 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> When inserting a new register into a block at the lower end the present
> bitmap is currently shifted into the wrong direction. The effect of this is
> that the bitmap becomes corrupted and registers which are present might be
> reported as not present and vice versa.
>
> Fix this by shifting left rather than right.
>
> Fixes: 472fdec7380c("regmap: rbtree: Reduce number of nodes, take 2")
> Reported-by: Daniel Baluta <daniel.baluta@gmail.com>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Thanks Lars! I confirm that this fixes the problem :).
Daniel.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-07 17:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-07 16:10 [PATCH] regmap: regcache-rbtree: Fix present bitmap resize Lars-Peter Clausen
2015-03-07 16:17 ` Mark Brown
2015-03-07 17:36 ` Daniel Baluta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®