From patchwork Wed Sep 3 20:44:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 4837611 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C3A2CC0338 for ; Wed, 3 Sep 2014 20:45:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4B9F20220 for ; Wed, 3 Sep 2014 20:45:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 103042021F for ; Wed, 3 Sep 2014 20:45:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XPHQe-0005rM-Pt; Wed, 03 Sep 2014 20:45:20 +0000 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XPHQP-0004bW-Rs for linux-rockchip@lists.infradead.org; Wed, 03 Sep 2014 20:45:06 +0000 Received: by mail-pa0-f48.google.com with SMTP id ey11so18196683pad.7 for ; Wed, 03 Sep 2014 13:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Bf0cLFq1fm+kvB/TzTwitPJT6Q6scvC65AOxzcJwilY=; b=lPAK9rAVnFKUK5va++L/ms3NvaghhI6XMrs6BCDiBLWEbpyr7W+0Cz+Dk6vX4jWzjE 9ruBgAxu4CbmWNQLfCNj94lsIIkfcSTPaAz9+KNymL9bHHgpzMNLq4VuqA+kj05BGo1j YcyA1n6vlUBH2HQNQeoh0kxyllIfhcQ4vfN54= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Bf0cLFq1fm+kvB/TzTwitPJT6Q6scvC65AOxzcJwilY=; b=FIFKM70bk8N6fzVsDmSZkWlla3vGgVkIXCAXrNowtj4Sfk1sxSjXUYmZGLuZi+GV7x +EaoX1z0bHP2LtMU8tiQu36kGNgeT2Tej/8Z/qUQb4spVFi+UHRKX47hsQYiHK0QRNhC pfLshI1WrWpAzyTGYRAG50hQvVPN73kqCgiWazcRQKjj/XA/HPGda4RiJPXORkmKKnF8 e0R8yAR51IaUIYWLUHkOuj74pgdibGWvEx8ImDEVsK+Gddh5a2peRdv2ST+46I1BDaWC AZnEqoJGTc27luPXDSPt9nG0huxb8oYQLpTzsfP2WuOgw25cKNugTX1mbEqV7JymMFr3 UZYg== X-Gm-Message-State: ALoCoQmWTfMW5RjCYNd1v8pwxl+yFIqBRGpVolDBNNj/qxkzfg655u6t2wvj0WrrfblRJFDRE9np X-Received: by 10.70.128.137 with SMTP id no9mr112837pdb.143.1409777084253; Wed, 03 Sep 2014 13:44:44 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.162.15]) by mx.google.com with ESMTPSA id qv9sm7597658pbb.86.2014.09.03.13.44.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 13:44:43 -0700 (PDT) From: Doug Anderson To: Mark Brown , Addy Ke , Heiko Stuebner Subject: [PATCH 2/3] spi/rockchip: Don't warn if SPI is busy but disabled Date: Wed, 3 Sep 2014 13:44:26 -0700 Message-Id: <1409777067-17422-3-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1409777067-17422-1-git-send-email-dianders@chromium.org> References: <1409777067-17422-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140903_134505_917648_75AAB28D X-CRM114-Status: GOOD ( 10.22 ) X-Spam-Score: -0.8 (/) Cc: Alexandru Stan , linux-kernel@vger.kernel.org, Doug Anderson , linux-spi@vger.kernel.org, linux-rockchip@lists.infradead.org, Sonny Rao , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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");