From patchwork Thu Mar 27 22:00:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinh Nguyen X-Patchwork-Id: 3900091 Return-Path: X-Original-To: patchwork-linux-mmc@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 3CFB09F334 for ; Thu, 27 Mar 2014 22:17:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2487F20270 for ; Thu, 27 Mar 2014 22:17:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EFE342026C for ; Thu, 27 Mar 2014 22:17:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757242AbaC0WRI (ORCPT ); Thu, 27 Mar 2014 18:17:08 -0400 Received: from mail-bn1on0136.outbound.protection.outlook.com ([157.56.110.136]:8981 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757228AbaC0WRI (ORCPT ); Thu, 27 Mar 2014 18:17:08 -0400 X-Greylist: delayed 852 seconds by postgrey-1.27 at vger.kernel.org; Thu, 27 Mar 2014 18:17:07 EDT Received: from BN1AFFO11FD035.protection.gbl (10.58.52.30) by BN1AFFO11HUB055.protection.gbl (10.58.52.206) with Microsoft SMTP Server (TLS) id 15.0.908.10; Thu, 27 Mar 2014 22:02:52 +0000 Received: from SJ-ITEXEDGE02.altera.priv.altera.com (66.35.236.232) by BN1AFFO11FD035.mail.protection.outlook.com (10.58.52.159) with Microsoft SMTP Server (TLS) id 15.0.908.10 via Frontend Transport; Thu, 27 Mar 2014 22:02:52 +0000 Received: from sj-mail01.altera.com (137.57.1.6) by SJ-ITEXEDGE02.altera.priv.altera.com (66.35.236.232) with Microsoft SMTP Server id 8.3.348.2; Thu, 27 Mar 2014 14:49:48 -0700 Received: from linux-builds1.altera.com (linux-builds1.altera.com [137.57.188.114]) by sj-mail01.altera.com (8.13.7+Sun/8.13.7) with ESMTP id s2RM2Ymm004728; Thu, 27 Mar 2014 15:02:35 -0700 (PDT) From: To: , CC: , , Dinh Nguyen Subject: [PATCH] mmc: dw_mmc: fix status error for Kingston brand SD cards Date: Thu, 27 Mar 2014 17:00:22 -0500 Message-ID: <1395957622-3428-1-git-send-email-dinguyen@altera.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: =?us-ascii?Q?CIP:66.35.236.232; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(1001?= =?us-ascii?Q?9001)(6009001)(458001)(189002)(199002)(77982001)(53416003)(8?= =?us-ascii?Q?0022001)(74706001)(59766001)(51856001)(62966002)(87266001)(8?= =?us-ascii?Q?7286001)(54316002)(50466002)(77156001)(76176001)(76796001)(7?= =?us-ascii?Q?4366001)(65816001)(87936001)(31966008)(76482001)(46102001)(8?= =?us-ascii?Q?8136002)(6806004)(47776003)(36756003)(97186001)(63696002)(56?= =?us-ascii?Q?776001)(97736001)(77096001)(48376002)(33646001)(76786001)(85?= =?us-ascii?Q?306002)(19580405001)(95666003)(92726001)(79102001)(97336001)?= =?us-ascii?Q?(19580395003)(80976001)(81686001)(74662001)(81816001)(509860?= =?us-ascii?Q?01)(47976001)(49866001)(85852003)(94316002)(47736001)(474460?= =?us-ascii?Q?02)(74502001)(81542001)(86362001)(93916002)(83322001)(207760?= =?us-ascii?Q?03)(98676001)(86152002)(84676001)(83072002)(44976005)(925660?= =?us-ascii?Q?01)(2009001)(53806001)(90146001)(89996001)(4396001)(56816005?= =?us-ascii?Q?)(74876001)(69226001)(81342001)(50226001)(95416001)(94946001?= =?us-ascii?Q?)(93136001)(93516002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1AFFO11H?= =?us-ascii?Q?UB055; H:SJ-ITEXEDGE02.altera.priv.altera.com; FPR:3CF5F72F.28?= =?us-ascii?Q?2A5CE4.135700A2.8CE8FA39.20263; MLV:sfv; PTR:InfoDomainNonexis?= =?us-ascii?Q?tent;MX:1;A:1;LANG:en;?= X-OriginatorOrg: altera.onmicrosoft.com X-Forefront-PRVS: 01630974C0 Received-SPF: SoftFail (: domain of transitioning altera.com discourages use of 66.35.236.232 as permitted sender) Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 From: Dinh Nguyen commits [90c2143a8f mmc: dw_mmc: guarantee stop-abort cmd in data errors] and [e352c813110 mmc: dw_mmc: rework the code related to cmd/data completion] cause the SD/MMC DMA interface to stop working on Kingston brand SD cards. --- Hi Seungwon, I am seeing this error on v3.13 kernel of the dw_mmc driver: mmc0: problem reading SD Status register. mmc0: error -110 whilst initialising SD card I only see this error on a Kingston brand card, although I have heard reports that it also fails a Samsung card. Also it only fails when with CONFIG_MMC_DW_IDMAC=y. The patch below seems to fix it for me. Any chance you have seen this error? Dinh --- drivers/mmc/host/dw_mmc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 7833002..7dcaa30 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1312,7 +1312,8 @@ static void dw_mci_tasklet_func(unsigned long priv) if (test_and_clear_bit(EVENT_DATA_ERROR, &host->pending_events)) { dw_mci_stop_dma(host); - send_stop_abort(host, data); + if (data->stop) + send_stop_abort(host, data); state = STATE_DATA_ERROR; break; } @@ -1334,6 +1335,11 @@ static void dw_mci_tasklet_func(unsigned long priv) set_bit(EVENT_DATA_COMPLETE, &host->completed_events); err = dw_mci_data_complete(host, data); + if (!data->stop) { + dw_mci_request_end(host, host->mrq); + goto unlock; + } + if (!err) { if (!data->stop || mrq->sbc) { if (mrq->sbc)