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: 4837641 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C0D49F314 for ; Wed, 3 Sep 2014 20:45:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C48C200F2 for ; Wed, 3 Sep 2014 20:45:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45F4A200E3 for ; Wed, 3 Sep 2014 20:45:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756353AbaICUpv (ORCPT ); Wed, 3 Sep 2014 16:45:51 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:52155 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750939AbaICUoo (ORCPT ); Wed, 3 Sep 2014 16:44:44 -0400 Received: by mail-pa0-f44.google.com with SMTP id rd3so18465388pab.31 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=Xc+dG/XmwK3zCg3vVzXEnsJrE2uQqMX+aJGXFFVUDs7reNuAODTpnoNV+azEW4oCQT jOnIAuIECy7a03t/InG+8D6hg0exwfPrs9vtP+7+o++TbufWUX42E7E88YLOxa0OLZAd FkOYl/rLS9FVXl/bZgXl4YWw5O36TFZdcMqoyjuCc72Sk8FL7BgqzV79GLw/CNnH6w+V cOYltf2r9HUY1lw5vrUpMZfbXSfbCehujeMHdaGSypl6fLmjxgIXpWBGufg+9kpvD3As fLSK/R8B1Io90o2Yv8cvAmrCuGT2hqqXNs+Mqkf4StiKCSEyD968Pj+9nLs46X+uZK2u ViFw== X-Gm-Message-State: ALoCoQnCTnBxd+y5mQHv7/pukbpeuPY4DrJPrKD6EYXuE/aCT4RxnM3BkzVP1UOD8QchvhHHGlD6 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 Cc: Alexandru Stan , Sonny Rao , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Doug Anderson , 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 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> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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");