* [PATCH] regmap: cache: Make sure to sync the last register in a block
@ 2013-08-05 9:21 Lars-Peter Clausen
2013-08-05 14:51 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2013-08-05 9:21 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, Lars-Peter Clausen
regcache_sync_block_raw_flush() expects the address of the register after last
register that needs to be synced as its parameter. But the last call to
regcache_sync_block_raw_flush() in regcache_sync_block_raw() passes the address
of the last register in the block. This effectively always skips over the last
register in a block, even if it needs to be synced. In order to fix it increase
the address by one register.
The issue was introduced in commit 75a5f89 ("regmap: cache: Write consecutive
registers in a single block write").
Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/base/regmap/regcache.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index e691026..3455f83 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -719,7 +719,8 @@ static int regcache_sync_block_raw(struct regmap *map, void *block,
}
}
- return regcache_sync_block_raw_flush(map, &data, base, regtmp);
+ return regcache_sync_block_raw_flush(map, &data, base, regtmp +
+ map->reg_stride);
}
int regcache_sync_block(struct regmap *map, void *block,
--
1.8.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] regmap: cache: Make sure to sync the last register in a block
2013-08-05 9:21 [PATCH] regmap: cache: Make sure to sync the last register in a block Lars-Peter Clausen
@ 2013-08-05 14:51 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-08-05 14:51 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 517 bytes --]
On Mon, Aug 05, 2013 at 11:21:29AM +0200, Lars-Peter Clausen wrote:
> regcache_sync_block_raw_flush() expects the address of the register after last
> register that needs to be synced as its parameter. But the last call to
> regcache_sync_block_raw_flush() in regcache_sync_block_raw() passes the address
> of the last register in the block. This effectively always skips over the last
> register in a block, even if it needs to be synced. In order to fix it increase
> the address by one register.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-05 14:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-05 9:21 [PATCH] regmap: cache: Make sure to sync the last register in a block Lars-Peter Clausen
2013-08-05 14:51 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.