mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] regmap: cache: Step by stride in default sync.
@ 2014-03-18 20:45 Dylan Reid
  2014-03-18 20:45 ` [PATCH 2/2] regmap: cache: Don't attempt to sync non-writeable registers Dylan Reid
  2014-03-19 10:39 ` [PATCH 1/2] regmap: cache: Step by stride in default sync Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Dylan Reid @ 2014-03-18 20:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, Dylan Reid

The default sync operation was still assuming a stride of one, fix it
to respect the reg_stride set in the map.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
---
 drivers/base/regmap/regcache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index c6b1ac1..44af125 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -249,7 +249,7 @@ static int regcache_default_sync(struct regmap *map, unsigned int min,
 {
 	unsigned int reg;
 
-	for (reg = min; reg <= max; reg++) {
+	for (reg = min; reg <= max; reg += map->reg_stride) {
 		unsigned int val;
 		int ret;
 
-- 
1.8.1.3.605.g02339dd


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] regmap: cache: Don't attempt to sync non-writeable registers.
  2014-03-18 20:45 [PATCH 1/2] regmap: cache: Step by stride in default sync Dylan Reid
@ 2014-03-18 20:45 ` Dylan Reid
  2014-03-19 10:39   ` Mark Brown
  2014-03-19 10:39 ` [PATCH 1/2] regmap: cache: Step by stride in default sync Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Dylan Reid @ 2014-03-18 20:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, Dylan Reid

In the regcache_default_sync, if a register isn't writeable, then
_regmap_write will return an error and the rest of the sync will be
aborted.  Avoid this by checking if a register is writeable before
trying to sync it.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
---
 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 44af125..29b4128 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -253,7 +253,8 @@ static int regcache_default_sync(struct regmap *map, unsigned int min,
 		unsigned int val;
 		int ret;
 
-		if (regmap_volatile(map, reg))
+		if (regmap_volatile(map, reg) ||
+		    !regmap_writeable(map, reg))
 			continue;
 
 		ret = regcache_read(map, reg, &val);
-- 
1.8.1.3.605.g02339dd


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] regmap: cache: Step by stride in default sync.
  2014-03-18 20:45 [PATCH 1/2] regmap: cache: Step by stride in default sync Dylan Reid
  2014-03-18 20:45 ` [PATCH 2/2] regmap: cache: Don't attempt to sync non-writeable registers Dylan Reid
@ 2014-03-19 10:39 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-03-19 10:39 UTC (permalink / raw)
  To: Dylan Reid; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 194 bytes --]

On Tue, Mar 18, 2014 at 01:45:08PM -0700, Dylan Reid wrote:
> The default sync operation was still assuming a stride of one, fix it
> to respect the reg_stride set in the map.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] regmap: cache: Don't attempt to sync non-writeable registers.
  2014-03-18 20:45 ` [PATCH 2/2] regmap: cache: Don't attempt to sync non-writeable registers Dylan Reid
@ 2014-03-19 10:39   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-03-19 10:39 UTC (permalink / raw)
  To: Dylan Reid; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

On Tue, Mar 18, 2014 at 01:45:09PM -0700, Dylan Reid wrote:
> In the regcache_default_sync, if a register isn't writeable, then
> _regmap_write will return an error and the rest of the sync will be
> aborted.  Avoid this by checking if a register is writeable before
> trying to sync it.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-19 10:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-18 20:45 [PATCH 1/2] regmap: cache: Step by stride in default sync Dylan Reid
2014-03-18 20:45 ` [PATCH 2/2] regmap: cache: Don't attempt to sync non-writeable registers Dylan Reid
2014-03-19 10:39   ` Mark Brown
2014-03-19 10:39 ` [PATCH 1/2] regmap: cache: Step by stride in default sync Mark Brown

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®