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/7] regmap: Modify map->cache_bypass directly
Date: Wed, 28 Sep 2011 11:43:42 +0100 [thread overview]
Message-ID: <1317206627-6673-2-git-send-email-dp@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1317206627-6673-1-git-send-email-dp@opensource.wolfsonmicro.com>
In preperation for the upcoming patches, modify map->cache_bypass
directly. The helper functions will grab an exclusive lock. Because
we'll have acquired the same lock we need to avoid a deadlock.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
drivers/base/regmap/regcache.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 5364dde..f46e247 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -241,9 +241,9 @@ int regcache_sync(struct regmap *map)
ret = regcache_read(map, i, &val);
if (ret < 0)
goto out;
- regcache_cache_bypass(map, true);
+ map->cache_bypass = 1;
ret = regmap_write(map, i, val);
- regcache_cache_bypass(map, false);
+ map->cache_bypass = 0;
if (ret < 0)
goto out;
dev_dbg(map->dev, "Synced register %#x, value %#x\n",
--
1.7.6.4
next prev parent reply other threads:[~2011-09-28 10:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-28 10:43 [PATCH 1/7] regmap: Fix regcache_sync generic implementation Dimitris Papastamos
2011-09-28 10:43 ` Dimitris Papastamos [this message]
2011-09-28 12:56 ` [PATCH 2/7] regmap: Modify map->cache_bypass directly Mark Brown
2011-09-28 10:43 ` [PATCH 3/7] regmap: Add a mutex to guard the sync operation Dimitris Papastamos
2011-09-28 12:52 ` Mark Brown
2011-09-28 14:24 ` Dimitris Papastamos
2011-09-28 15:19 ` Mark Brown
2011-09-28 15:52 ` Dimitris Papastamos
2011-09-28 10:43 ` [PATCH 4/7] regmap: Save/restore the bypass state upon syncing Dimitris Papastamos
2011-09-28 10:43 ` [PATCH 5/7] regmap: Grab the lock in regcache_cache_only() Dimitris Papastamos
2011-09-28 12:57 ` Mark Brown
2011-09-28 10:43 ` [PATCH 6/7] regmap: Implement regcache_cache_bypass helper function Dimitris Papastamos
2011-09-28 10:43 ` [PATCH 7/7] regmap: Ensure we scream if we enable cache bypass/only at the same time Dimitris Papastamos
2011-09-28 12:56 ` [PATCH 1/7] regmap: Fix regcache_sync generic implementation 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=1317206627-6673-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