All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] regmap: Support some more block operations on cached devices
Date: Wed, 9 Nov 2011 12:14:06 +0000	[thread overview]
Message-ID: <20111109121406.GA32212@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1320773846-28635-2-git-send-email-lars@metafoo.de>

On Tue, Nov 08, 2011 at 06:37:26PM +0100, Lars-Peter Clausen wrote:
> Commit 10a08d9f ("regmap: Support some block operations on cached devices")
> allowed raw read operations without throwing a warning when using caches if
> all registers are volatile. This patch does the same for raw write operations.
> 
> This is for example useful when loading a firmware in a predefined volatile
> region on a chip where we otherwise want registers to be cached.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
>  drivers/base/regmap/regmap.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
> index 4016b00..a471083 100644
> --- a/drivers/base/regmap/regmap.c
> +++ b/drivers/base/regmap/regmap.c
> @@ -387,9 +387,11 @@ EXPORT_SYMBOL_GPL(regmap_write);
>  int regmap_raw_write(struct regmap *map, unsigned int reg,
>  		     const void *val, size_t val_len)
>  {
> +	size_t val_count = val_len / map->format.val_bytes;
>  	int ret;
>  
> -	WARN_ON(map->cache_type != REGCACHE_NONE);
> +	WARN_ON(!regmap_volatile_range(map, reg, val_count) &&
> +		map->cache_type != REGCACHE_NONE);
>  
>  	mutex_lock(&map->lock);
>  
> -- 
> 1.7.7

Acked-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>

  reply	other threads:[~2011-11-09 12:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08 17:37 [PATCH 1/2] regmap: Add helper function for checking if a register range is volatile Lars-Peter Clausen
2011-11-08 17:37 ` [PATCH 2/2] regmap: Support some more block operations on cached devices Lars-Peter Clausen
2011-11-09 12:14   ` Dimitris Papastamos [this message]
2011-11-09  0:57 ` [PATCH 1/2] regmap: Add helper function for checking if a register range is volatile 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=20111109121406.GA32212@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 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.