From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Roger Quadros <rogerq@ti.com>
Cc: wsa@the-dreams.de, Mark Brown <broonie@kernel.org>,
linux-can@vger.kernel.org, tomi.valkeinen@ti.com,
kernel@pengutronix.de, linux-omap@vger.kernel.org
Subject: Re: [PATCH v2] can: c_can: use regmap_update_bits() to modify RAMINIT register
Date: Thu, 15 Jan 2015 15:37:28 +0100 [thread overview]
Message-ID: <54B7D0A8.8050806@pengutronix.de> (raw)
In-Reply-To: <54B52A4F.8030208@ti.com>
[-- Attachment #1: Type: text/plain, Size: 1155 bytes --]
On 01/13/2015 03:23 PM, Roger Quadros wrote:
> use of regmap_read() and regmap_write() in c_can_hw_raminit_syscon()
> is not safe as the RAMINIT register can be shared between different drivers
> at least for TI SoCs.
>
> To make the modification atomic we switch to using regmap_update_bits().
>
> regmap_update_bits() skips writing to the register if it's read content is the
> same as what is going to be written. This causes an issue for us when we
> need to clear the DONE bit with the initial condition START:0, DONE:1 as
> DONE bit must be written with 1 to clear it.
>
> So we defer the clearing of DONE bit to later when we set the START bit.
> There we are sure that START bit is changed from 0 to 1 so the write of
> 1 to already set DONE bit will happen.
>
> Signed-off-by: Roger Quadros <rogerq@ti.com>
Applied to linux-can.
Thanks, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-01-15 14:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-07 14:32 [PATCH] can: c_can: use regmap_update_bits() to modify RAMINIT register Roger Quadros
2015-01-09 13:50 ` Tomi Valkeinen
2015-01-12 9:57 ` Roger Quadros
2015-01-12 10:02 ` Roger Quadros
2015-01-12 12:05 ` Mark Brown
2015-01-12 12:37 ` Roger Quadros
2015-01-12 12:43 ` Mark Brown
2015-01-13 14:23 ` [PATCH v2] " Roger Quadros
2015-01-15 14:37 ` Marc Kleine-Budde [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=54B7D0A8.8050806@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=broonie@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=rogerq@ti.com \
--cc=tomi.valkeinen@ti.com \
--cc=wsa@the-dreams.de \
/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