From: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 2/4] regmap: Save/restore the bypass state upon syncing
Date: Thu, 29 Sep 2011 14:36:26 +0100 [thread overview]
Message-ID: <1317303388-4040-2-git-send-email-dp@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1317303388-4040-1-git-send-email-dp@opensource.wolfsonmicro.com>
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
drivers/base/regmap/regcache.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 8393c47..f91bc7b 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -227,10 +227,13 @@ int regcache_sync(struct regmap *map)
unsigned int val;
unsigned int i;
const char *name;
+ unsigned int bypass;
BUG_ON(!map->cache_ops);
mutex_lock(&map->lock);
+ /* Remember the initial bypass state */
+ bypass = map->cache_bypass;
dev_dbg(map->dev, "Syncing %s cache\n",
map->cache_ops->name);
name = map->cache_ops->name;
@@ -255,6 +258,8 @@ int regcache_sync(struct regmap *map)
}
out:
trace_regcache_sync(map->dev, name, "stop");
+ /* Restore the bypass state */
+ map->cache_bypass = bypass;
mutex_unlock(&map->lock);
return ret;
--
1.7.6.4
next prev parent reply other threads:[~2011-09-29 13:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-29 13:36 [PATCH 1/4] regmap: Lock the sync path, ensure we use the lockless _regmap_write() Dimitris Papastamos
2011-09-29 13:36 ` Dimitris Papastamos [this message]
2011-09-29 13:36 ` [PATCH 3/4] regmap: Implement regcache_cache_bypass helper function Dimitris Papastamos
2011-09-29 13:36 ` [PATCH 4/4] regmap: Ensure we scream if we enable cache bypass/only at the same time Dimitris Papastamos
2011-09-30 12:58 ` [PATCH 1/4] regmap: Lock the sync path, ensure we use the lockless _regmap_write() Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1317303388-4040-2-git-send-email-dp@opensource.wolfsonmicro.com \
--to=dp@opensource.wolfsonmicro.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox