From patchwork Tue Jan 13 17:51:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 5623071 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7462EC058D for ; Tue, 13 Jan 2015 17:59:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EF6420558 for ; Tue, 13 Jan 2015 17:59:33 +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 D5A7E20251 for ; Tue, 13 Jan 2015 17:59:32 +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 1YB5kY-00081t-9n; Tue, 13 Jan 2015 17:59:30 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YB5db-0004Gx-Fh for linux-rockchip@bombadil.infradead.org; Tue, 13 Jan 2015 17:52:19 +0000 Received: from mail-ig0-x22d.google.com ([2607:f8b0:4001:c05::22d]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YB5dY-0005FY-ID for linux-rockchip@lists.infradead.org; Tue, 13 Jan 2015 17:52:17 +0000 Received: by mail-ig0-f173.google.com with SMTP id r10so5087456igi.0 for ; Tue, 13 Jan 2015 09:51:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=6ki+4c391HR2HLaQlOxNlteOdEFADqWiJOv9x2Y5mTM=; b=EjFonrhp0mDbk0wrTerspa2eA3c68n4D+JS3WMCt6tDXY0baSXR7PmAM+/La6K2UHW rlcCN4VRe/osKQ2LBikVdjWz29y6VEQtJ1PPlTpY5bWnuPqzQCkTOa6kxfHgVQsQnFQv 5jvoJOOa6TcZl+C0osyLZjHkVH62/WN4RhfC8= 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; bh=6ki+4c391HR2HLaQlOxNlteOdEFADqWiJOv9x2Y5mTM=; b=eWTpKetFyh8+ds3sXdd6O8KK/GV76BCexaq+XdUA3xZkf4AUhiz6WhQ+vUE4bUHhUb AuNXrIx24udMltxbRk5oXJKe9LvWimliDHUZ2A9k6z2knoGcRrlQuMybqk64GfmZ0+UT eGRfENl+JLw96SrRfCjng19uIPGqliTOZQc0iv1kiJZJzo8+LbPPxN1/RwFdLcyZkcvW n+Z/RdhyqPDosgeiFq2ceDxvX8rA5mYKZi5Fe8z3gqF2u3B2AMOiCKkF22/ziQ1J7cSg FdR29ZStISvLpV+TouwA7lZPOl1WMtNRY5/Hq7yewq6CQKwFrFjRVLGd14B1ZDFTf6qT QioQ== X-Gm-Message-State: ALoCoQklraZYhX9BAXPkycMiFXlgYKQHq439z/VkyjtykxTpIeYzx25bWOsmr6AFqBPWC8f9KPCg X-Received: by 10.42.103.7 with SMTP id k7mr468041ico.33.1421171512988; Tue, 13 Jan 2015 09:51:52 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by mx.google.com with ESMTPSA id l42sm3837899iod.6.2015.01.13.09.51.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 09:51:52 -0800 (PST) From: Doug Anderson To: Jaehoon Chung , Seungwon Jeon , Ulf Hansson Subject: [PATCH] mmc: dw_mmc: rockchip: Add DW_MCI_QUIRK_RETRY_DELAY Date: Tue, 13 Jan 2015 09:51:37 -0800 Message-Id: <1421171497-9440-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150113_175216_738532_7EEA3C0B X-CRM114-Status: GOOD ( 16.31 ) X-Spam-Score: -2.7 (--) Cc: addy.ke@rock-chips.com, Heiko Stuebner , Andrew Bresticker , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, Doug Anderson , chris@printf.net, linux-rockchip@lists.infradead.org, Alim Akhtar , Sonny Rao , linux-arm-kernel@lists.infradead.org, Alexandru Stan 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 We've seen at least one card that can get confused during all the errors generated during tuning on rk3288. These errors seem to go away with DW_MCI_QUIRK_RETRY_DELAY. That quirk is documented to be for 2.11a and on rk3288 I believe we have 2.70a, but it seems to be the same type of problem. Specifically it looks like in certain error conditions (I saw this with Response CRC errors) that data keeps showing up in the FIFO even after the error is reported and the CD (command done) bit is set. If we don't wait for this data to finish transferring then it confuses the next transaction. In the specific failure case I ran into I found that I could monitor the data_state_mc_busy bit and wait for it to clear, but in other failure cases this bit was stuck at busy when we saw an error. Hence a generic big delay seems like the only option. I have seen this on rk3288, but adding it as a quirk for all Rockchip IP for now since most previous quirks have shown up on older IP as well. Signed-off-by: Doug Anderson --- NOTES: * This is based atop Addy's patch (mmc: dw_mmc: add quirk for broken data transfer over scheme) at , but it would be trivial to apply this patch without that one if that were desirable. * If someone has a better solution to this problem, I'm all ears. drivers/mmc/host/dw_mmc-rockchip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c index ba92ebd..b4caf1a 100644 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -74,7 +74,8 @@ static int dw_mci_rockchip_init(struct dw_mci *host) host->sdio_id0 = 8; /* It needs this quirk on all Rockchip SoCs */ - host->pdata->quirks |= DW_MCI_QUIRK_BROKEN_DTO; + host->pdata->quirks |= DW_MCI_QUIRK_BROKEN_DTO | + DW_MCI_QUIRK_RETRY_DELAY; return 0; }