mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regmap: assume registers are volatile iff no cache
@ 2013-06-03 17:34 Stephen Warren
  2013-06-03 18:48 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2013-06-03 17:34 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, Stephen Warren

From: Stephen Warren <swarren@nvidia.com>

If a regmap has a cache, it's likely that registers are not volatile,
perhaps with exceptions. Otherwise, the cache would not be useful. Encode
this assumption into regmap_volatile()'s default return value, for the
case where a regmap doesn't specify which registers are volatile.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 drivers/base/regmap/regmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 1a01553..feb37af 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -123,7 +123,7 @@ bool regmap_volatile(struct regmap *map, unsigned int reg)
 	if (map->volatile_table)
 		return regmap_check_range_table(map, reg, map->volatile_table);
 
-	return true;
+	return (map->cache_type == REGCACHE_NONE);
 }
 
 bool regmap_precious(struct regmap *map, unsigned int reg)
-- 
1.7.10.4


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

* Re: [PATCH] regmap: assume registers are volatile iff no cache
  2013-06-03 17:34 [PATCH] regmap: assume registers are volatile iff no cache Stephen Warren
@ 2013-06-03 18:48 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-06-03 18:48 UTC (permalink / raw)
  To: Stephen Warren; +Cc: linux-kernel, Stephen Warren

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

On Mon, Jun 03, 2013 at 11:34:48AM -0600, Stephen Warren wrote:

> If a regmap has a cache, it's likely that registers are not volatile,
> perhaps with exceptions. Otherwise, the cache would not be useful. Encode
> this assumption into regmap_volatile()'s default return value, for the
> case where a regmap doesn't specify which registers are volatile.

I already sent out a patch of my own for this.

[-- 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-06-03 18:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-03 17:34 [PATCH] regmap: assume registers are volatile iff no cache Stephen Warren
2013-06-03 18:48 ` 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®