[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52F8B167.6070901@monstr.eu>
Date: Mon, 10 Feb 2014 12:00:55 +0100
From: Michal Simek <monstr@...str.eu>
To: Lars-Peter Clausen <lars@...afoo.de>
CC: Michal Simek <michal.simek@...inx.com>,
linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Mark Brown <broonie@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] regmap: Check readable regs in _regmap_read
Hi Lars,
On 02/10/2014 11:53 AM, Lars-Peter Clausen wrote:
> On 02/10/2014 11:46 AM, Michal Simek wrote:
>> Check if regs are readable.
>>
>> Signed-off-by: Michal Simek <michal.simek@...inx.com>
>> ---
>>
>> drivers/base/regmap/regmap.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
>> index 6a19515..7569dfc 100644
>> --- a/drivers/base/regmap/regmap.c
>> +++ b/drivers/base/regmap/regmap.c
>> @@ -1725,6 +1725,9 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
>> int ret;
>> void *context = _regmap_map_get_context(map);
>>
>> + 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.
And can you read from registers if they are not readable?
Even read from cache.
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
Download attachment "signature.asc" of type "application/pgp-signature" (264 bytes)
Powered by blists - more mailing lists