All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Mark Brown <broonie@kernel.org>, Addy Ke <addy.ke@rock-chips.com>,
	Heiko Stuebner <heiko@sntech.de>
Cc: Alexandru Stan <amstan@chromium.org>,
	Sonny Rao <sonnyrao@chromium.org>,
	linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	Doug Anderson <dianders@chromium.org>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] spi/rockchip: Don't warn if SPI is busy but disabled
Date: Wed,  3 Sep 2014 13:44:26 -0700	[thread overview]
Message-ID: <1409777067-17422-3-git-send-email-dianders@chromium.org> (raw)
In-Reply-To: <1409777067-17422-1-git-send-email-dianders@chromium.org>

The reference manual from Rockchip claims this about the BSF (SPI Busy
Flag):
* 0 - SPI is idle or disabled
* 1 - SPI is actively transferring data

The above doesn't quite appear to be true.  Specifically I found the
busy bit set when SPI was disabled.  Let's change the WARN_ON() so we
only check the busy bit if the controller was enabled.

Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 drivers/spi/spi-rockchip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 84dbb86..3afc266 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -529,7 +529,8 @@ static int rockchip_spi_transfer_one(
 	int ret = 0;
 	struct rockchip_spi *rs = spi_master_get_devdata(master);
 
-	WARN_ON((readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
+	WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) &&
+		(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
 
 	if (!xfer->tx_buf && !xfer->rx_buf) {
 		dev_err(rs->dev, "No buffer for transfer\n");
-- 
2.1.0.rc2.206.gedb03e5


WARNING: multiple messages have this Message-ID (diff)
From: dianders@chromium.org (Doug Anderson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] spi/rockchip: Don't warn if SPI is busy but disabled
Date: Wed,  3 Sep 2014 13:44:26 -0700	[thread overview]
Message-ID: <1409777067-17422-3-git-send-email-dianders@chromium.org> (raw)
In-Reply-To: <1409777067-17422-1-git-send-email-dianders@chromium.org>

The reference manual from Rockchip claims this about the BSF (SPI Busy
Flag):
* 0 - SPI is idle or disabled
* 1 - SPI is actively transferring data

The above doesn't quite appear to be true.  Specifically I found the
busy bit set when SPI was disabled.  Let's change the WARN_ON() so we
only check the busy bit if the controller was enabled.

Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 drivers/spi/spi-rockchip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 84dbb86..3afc266 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -529,7 +529,8 @@ static int rockchip_spi_transfer_one(
 	int ret = 0;
 	struct rockchip_spi *rs = spi_master_get_devdata(master);
 
-	WARN_ON((readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
+	WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) &&
+		(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
 
 	if (!xfer->tx_buf && !xfer->rx_buf) {
 		dev_err(rs->dev, "No buffer for transfer\n");
-- 
2.1.0.rc2.206.gedb03e5

  parent reply	other threads:[~2014-09-03 20:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 20:44 [PATCH 0/3] SPI Fixes for spi-rockchip Doug Anderson
2014-09-03 20:44 ` Doug Anderson
2014-09-03 20:44 ` Doug Anderson
2014-09-03 20:44 ` [PATCH 1/3] spi/rockchip: Fix the wait_for_idle() timeout Doug Anderson
2014-09-03 20:44   ` Doug Anderson
2014-09-03 20:44   ` Doug Anderson
2014-09-03 20:44 ` Doug Anderson [this message]
2014-09-03 20:44   ` [PATCH 2/3] spi/rockchip: Don't warn if SPI is busy but disabled Doug Anderson
2014-09-03 20:44 ` [PATCH 3/3] dt-bindings: spi/rockchip: Mark DMA as optional Doug Anderson
2014-09-03 20:44   ` Doug Anderson
2014-09-04 22:54   ` Mark Brown
2014-09-04 22:54     ` Mark Brown
2014-09-04 22:54     ` 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=1409777067-17422-3-git-send-email-dianders@chromium.org \
    --to=dianders@chromium.org \
    --cc=addy.ke@rock-chips.com \
    --cc=amstan@chromium.org \
    --cc=broonie@kernel.org \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=sonnyrao@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.