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: 5623031 Return-Path: X-Original-To: patchwork-linux-mmc@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 BBF14C058D for ; Tue, 13 Jan 2015 17:52:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D914D20558 for ; Tue, 13 Jan 2015 17:52:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D116C20551 for ; Tue, 13 Jan 2015 17:51:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752853AbbAMRvy (ORCPT ); Tue, 13 Jan 2015 12:51:54 -0500 Received: from mail-ig0-f172.google.com ([209.85.213.172]:45430 "EHLO mail-ig0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752228AbbAMRvx (ORCPT ); Tue, 13 Jan 2015 12:51:53 -0500 Received: by mail-ig0-f172.google.com with SMTP id l13so5242241iga.5 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=KAy51+k/NMsQ5qvV0pScrrULnyFFsVY0ExGTFPWvBOR4VyN/fMyNrknnVkfvvgffLt 3h40LBO2CJF+K04Emh6RUPai1KdIXro/gHw1ix2dxHfVaeKx0uB1VMDb6YT8gcSzu07a rqvtmoxDmerUXk3b7pWtIaQCWWFyhw50nKwtYIPvidnJ5pxAwEztr/0kLyF4w+N9SxVl 29uOpKD7Xi7tETYkdSPA3W9oCVUC/ucL09/6ZoYuoFhjvYz115eukopsPkIKF8o1jG+P BToU9/WTGRHW8SQfw87EW/gO5woN6pBgEXiFAhzituG6D0OW3BEy2wNjefK1a4CxSkee xP5w== X-Gm-Message-State: ALoCoQnHyFRtR7mbulbOHlQ+F1VLcyyLzW/aT36t5m3L9g/OiaSSMMS5U6UYs4XKX4uElCEIYd9q 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 Cc: Alim Akhtar , Sonny Rao , Andrew Bresticker , Heiko Stuebner , Alexandru Stan , addy.ke@rock-chips.com, Doug Anderson , chris@printf.net, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org 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 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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; }