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: 5623051 Return-Path: X-Original-To: patchwork-linux-arm@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 1C6C4C058D for ; Tue, 13 Jan 2015 17:54:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BBF520462 for ; Tue, 13 Jan 2015 17:54:00 +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 7847120120 for ; Tue, 13 Jan 2015 17:53:59 +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 1YB5db-0004Gg-HS; Tue, 13 Jan 2015 17:52:19 +0000 Received: from mail-ig0-x22b.google.com ([2607:f8b0:4001:c05::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YB5dX-00046Q-2H for linux-arm-kernel@lists.infradead.org; Tue, 13 Jan 2015 17:52:15 +0000 Received: by mail-ig0-f171.google.com with SMTP id z20so18206512igj.4 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=K5G5coKJzWQjHIl6uMsVjW8bRRFtPwobB/8CREE2trevz+KBeDlfJkeHe2vfjG6Dop aJcwZTfyiUSjxJ2RmtdGnHoTHGYXJBXstsYT+MqrVAuGxpzy9Milgbh6E1FIpr77gFJG 55u+uzp/PC7nZwOWbWwRiUVc0D8E7isBStnW8g598I/ceyHFONDMXJWdChkDt4Ak8Thy +AN6yyWGD+943msObh/w1SY1kCVX4sr+2jqBCrEpf/6oMwCzIXtWsuRtaXi2AW0irzea UiQueptuZe+exo40Xxtptik37FK/aTMZddlu3nVTWU1LQcEKOo51xkg0eUzsWB3FdxOe Bq5g== X-Gm-Message-State: ALoCoQkUs+5I5n1URsv0ZZLg5TxQMSIVwBYO+2ThJ/G0h3bn9iw7T3xs+iGVX6htXSKKEZOk+mpr 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_095215_190348_2E117525 X-CRM114-Status: GOOD ( 14.70 ) X-Spam-Score: -0.8 (/) 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-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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; }