From: Laxman Dewangan <ldewangan@nvidia.com>
To: Bryan Freed <bfreed@chromium.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Jonathan Cameron <jic23@cam.ac.uk>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"max@stro.at" <max@stro.at>,
"jbrenner@taosinc.com" <jbrenner@taosinc.com>,
"lars@metafoo.de" <lars@metafoo.de>,
"grundler@chromium.org" <grundler@chromium.org>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: iio: light: isl29018: use regmap for register access
Date: Wed, 18 Apr 2012 11:49:41 +0530 [thread overview]
Message-ID: <4F8E5CFD.4040501@nvidia.com> (raw)
In-Reply-To: <CAEYUcX3TbXFmKYCvfz00tpJ3K0bSExnQxV1R==dP=+vsK54KPQ@mail.gmail.com>
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.
next prev parent reply other threads:[~2012-04-18 6:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 8:50 [PATCH] staging: iio: light: isl29018: use regmap for register access Laxman Dewangan
2012-04-17 11:33 ` Jonathan Cameron
2012-04-17 11:59 ` Laxman Dewangan
2012-04-17 17:56 ` Bryan Freed
2012-04-18 6:19 ` Laxman Dewangan [this message]
2012-04-18 8:16 ` 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=4F8E5CFD.4040501@nvidia.com \
--to=ldewangan@nvidia.com \
--cc=bfreed@chromium.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=grundler@chromium.org \
--cc=jbrenner@taosinc.com \
--cc=jic23@cam.ac.uk \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=max@stro.at \
/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;
as well as URLs for NNTP newsgroup(s).