linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: p.zabel@pengutronix.de (Philipp Zabel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] reset: sunxi: use readl/writel_relaxed
Date: Tue,  5 Jul 2016 12:17:51 +0200	[thread overview]
Message-ID: <1467713872-4051-2-git-send-email-p.zabel@pengutronix.de> (raw)
In-Reply-To: <1467713872-4051-1-git-send-email-p.zabel@pengutronix.de>

This just removes the rmb()/wmb() pair between register read and
write. Since no relevant reads follow the rmb and no relevant writes
precede the wmb, they should be safe to remove.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/reset/reset-sunxi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/reset/reset-sunxi.c b/drivers/reset/reset-sunxi.c
index 3080190..7a35950 100644
--- a/drivers/reset/reset-sunxi.c
+++ b/drivers/reset/reset-sunxi.c
@@ -41,8 +41,8 @@ static int sunxi_reset_assert(struct reset_controller_dev *rcdev,
 
 	spin_lock_irqsave(&data->lock, flags);
 
-	reg = readl(data->membase + (bank * 4));
-	writel(reg & ~BIT(offset), data->membase + (bank * 4));
+	reg = readl_relaxed(data->membase + (bank * 4));
+	writel_relaxed(reg & ~BIT(offset), data->membase + (bank * 4));
 
 	spin_unlock_irqrestore(&data->lock, flags);
 
@@ -62,8 +62,8 @@ static int sunxi_reset_deassert(struct reset_controller_dev *rcdev,
 
 	spin_lock_irqsave(&data->lock, flags);
 
-	reg = readl(data->membase + (bank * 4));
-	writel(reg | BIT(offset), data->membase + (bank * 4));
+	reg = readl_relaxed(data->membase + (bank * 4));
+	writel_relaxed(reg | BIT(offset), data->membase + (bank * 4));
 
 	spin_unlock_irqrestore(&data->lock, flags);
 
-- 
2.8.1

  reply	other threads:[~2016-07-05 10:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-05 10:17 [PATCH 1/3] reset: socfpga: no need to store modrst_offset Philipp Zabel
2016-07-05 10:17 ` Philipp Zabel [this message]
2016-07-05 10:17 ` [PATCH 3/3] reset: socfpga: use readl/writel_relaxed Philipp Zabel
2016-07-05 11:20   ` Arnd Bergmann
2016-07-05 11:40     ` Philipp Zabel
2016-07-05 12:59       ` Arnd Bergmann
2016-07-05 13:20         ` Philipp Zabel
2016-07-06 16:06 ` [PATCH 1/3] reset: socfpga: no need to store modrst_offset Dinh Nguyen
2016-07-06 16:26   ` Philipp Zabel

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=1467713872-4051-2-git-send-email-p.zabel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).