lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 Apr 2012 11:49:41 +0530
From:	Laxman Dewangan <ldewangan@...dia.com>
To:	Bryan Freed <bfreed@...omium.org>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC:	Jonathan Cameron <jic23@....ac.uk>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"max@...o.at" <max@...o.at>,
	"jbrenner@...sinc.com" <jbrenner@...sinc.com>,
	"lars@...afoo.de" <lars@...afoo.de>,
	"grundler@...omium.org" <grundler@...omium.org>,
	"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: iio: light: isl29018: use regmap for register
 access

Including Mark here for more insight/comment.

On Tuesday 17 April 2012 11:26 PM, Bryan Freed wrote:
> Hey Laxman, Jonathan.
>
> The regmap is pretty new to me.  In looking at it, I see
> _regmap_write() will regcache_write() before attempting to write to
> the device.
> This effectively updates the cached value even when the device write
> fails, which is the opposite of the current isl29018 cache policy.
>
> It looks like we tried to change the policy back in August and got
> this response:
>    >  I did change one basic behavior that I think was also broken: cache
>    >  the value regardless of if the transaction completed successfully or
>    >  not.
>    Don't do that.  That means userspace will get an invalid value if it reads
>    in the meantime. If you have an error on a hardware bus - tell userspace about
>    it and don't 'guess' what is in the register.
> See http://driverdev.linuxdriverproject.org/pipermail/devel/2011-August/020256.html
> for details.
>
> The result is likely to be that after a failed write to one field of a
> register, the next successful write to another field of that register
> will update them both.

yes, the caching is done before actual transfer and it can make cache 
dirty in case of transfer failure.
I am not sure what should be correct handling here: make cache dirty or 
revert the value to original one?
But using the regmap will provide the common behavior across the driver 
and all driver will have same behavior rather than handling on 
differently across driver.
So if there is any other policy for this, it will be same for all driver.


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ