[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E728840.407@metafoo.de>
Date: Fri, 16 Sep 2011 01:20:32 +0200
From: Lars-Peter Clausen <lars@...afoo.de>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC: Dimitris Papastamos <dp@...nsource.wolfsonmicro.com>,
linux-kernel@...r.kernel.org, Liam Girdwood <lrg@...com>,
Graeme Gregory <gg@...mlogic.co.uk>,
Samuel Oritz <sameo@...ux.intel.com>
Subject: Re: [PATCH 6/6 v3] regmap: Incorporate the regcache core into regmap
On 09/16/2011 12:57 AM, Mark Brown wrote:
> On Thu, Sep 15, 2011 at 05:19:32PM +0200, Lars-Peter Clausen wrote:
>
>>> + if (!map->cache_bypass) {
>>> + ret = regcache_read(map, reg, val);
>>> + if (!ret) {
>>> + mutex_unlock(&map->lock);
>>> + return 0;
>>> + }
>
>> So in case regmap_readable is not true for this register regcache_read will
>> return -EIO and we'll fallback to an uncached read. This doesn't make sense in
>> my opinion. Or what are the except semantics regmap_readable supposed to be?
>
> It's a bit interesting but falling back to asking the hardware is
> probably the right thing to do for cases where you're doing things like
> using unspecified registers to activate undocumented features - the
> register isn't really documented as being there and may do odd things
> but if the device manufacturer gives you an approved sequence then you
> can probably use it safely.
But for writes the error is propagated to the caller, instead of falling back
to a hw write. There should be at least consistency between the two.
And I think we should document that regmap_readable and regmap_writeable don't
prevent actuall hw access, but are merely meant as hints for stuff like caching.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists