public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: Mark Brown <broonie@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Michal Simek <michal.simek@xilinx.com>,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] regmap: Check readable regs in _regmap_read
Date: Mon, 10 Feb 2014 12:54:46 +0100	[thread overview]
Message-ID: <52F8BE06.9040103@monstr.eu> (raw)
In-Reply-To: <20140210114927.GR1757@sirena.org.uk>

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

Hi Mark,

On 02/10/2014 12:49 PM, Mark Brown wrote:
> On Mon, Feb 10, 2014 at 11:53:38AM +0100, Lars-Peter Clausen wrote:
>> On 02/10/2014 11:46 AM, Michal Simek wrote:
>>> Check if regs are readable.
> 
>>> +	if (!regmap_readable(map, reg))
>>> +		return -EIO;
> 
>> This will cause issues with devices where registers are writable,
>> but not readable, but we keep the register value in the cache.
> 
> Yes, exactly - this is deliberately not done so we can fake up
> readability using the cache.  All the 7x9 devices are like this for
> example, there's just no read support in the hardware (or if there is
> it's not related to the register map).  If we were going to check it
> should be at the point where we are about to interact with the hardware.

ok. Then let me send v2 and more this checking below cache
because missing this checking is also wrong.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

      reply	other threads:[~2014-02-10 11:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10 10:46 [PATCH] regmap: Check readable regs in _regmap_read Michal Simek
2014-02-10 10:53 ` Lars-Peter Clausen
2014-02-10 11:00   ` Michal Simek
2014-02-10 11:49   ` Mark Brown
2014-02-10 11:54     ` Michal Simek [this message]

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=52F8BE06.9040103@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    /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