From patchwork Mon Feb 1 12:32:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 8178701 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B7A3D9F4DD for ; Mon, 1 Feb 2016 12:36:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2E7E20499 for ; Mon, 1 Feb 2016 12:36:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DBA1720498 for ; Mon, 1 Feb 2016 12:36:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754001AbcBAMgS (ORCPT ); Mon, 1 Feb 2016 07:36:18 -0500 Received: from mga14.intel.com ([192.55.52.115]:58843 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753671AbcBAMgS (ORCPT ); Mon, 1 Feb 2016 07:36:18 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 01 Feb 2016 04:36:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,380,1449561600"; d="scan'208";a="902931531" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.168]) ([10.237.72.168]) by orsmga002.jf.intel.com with ESMTP; 01 Feb 2016 04:36:14 -0800 Subject: Re: [RFC PATCH 0/21] Totally remove SDHCI_QUIRK_BROKEN_CARD_DETECTION quirk To: Russell King - ARM Linux References: <1453871155-3283-1-git-send-email-shawn.lin@rock-chips.com> <56A8BF22.8010509@intel.com> <20160127132348.GY10826@n2100.arm.linux.org.uk> <56AA03AA.5010706@intel.com> <56AB5635.9030007@intel.com> <20160129172817.GR10826@n2100.arm.linux.org.uk> Cc: Ulf Hansson , Shawn Lin , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-mmc , "linux-kernel@vger.kernel.org" , P L Sai Krishna , Wan Zongshun , Jisheng Zhang From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <56AF5071.9050103@intel.com> Date: Mon, 1 Feb 2016 14:32:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160129172817.GR10826@n2100.arm.linux.org.uk> 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.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 On 29/01/16 19:28, Russell King - ARM Linux wrote: > On Fri, Jan 29, 2016 at 02:08:21PM +0200, Adrian Hunter wrote: >> I might make a tree because I want to try to separate Russell's bug fixes >> from the clean-ups, and then cc stable on the bug fixes. > > It would be good if you could ask for that, I'll look at rearranging > (and re-testing) the patches to achieve that. Had I known that, I > could've done it before posting the latest set of patches. If you don't mind doing that, that would be great! So far the fixes, I have identified: 1. mmc: sdhci: command response CRC error handling Could have "fix" in the subject i.e. "fix command response CRC error handling". Could change to be dependent only on "mmc: sdhci: move initialisation of command error member". Also I would treat end-bit and index errors the same as CRC errors i.e. probably end up with: tasklet_schedule(&host->finish_tasklet); 2. mmc: sdhci: avoid unnecessary mapping/unmapping of align buffer This looks like a bug fix because the mapping can be leaked on the error path i.e. similar problem to the one fixed by "mmc: sdhci: plug DMA mapping leak on error" 3. mmc: sdhci: plug DMA mapping leak on error It looks like the 2nd chunk could be taken as a separate fix without dependence on other patches. 4. mmc: sdhci-pxav3: fix higher speed mode capabilities I can't test this so please indicate if you want it for stable. 5. mmc: sdhci: further fix for DMA unmapping in sdhci_post_req() Could be made independent of other patches. 6. mmc: sdhci: fix data timeout (part 1) mmc: sdhci: fix data timeout (part 2) Could be just 1 patch. --- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index d622435d1bcc..6cae93a89eba 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2325,8 +2325,23 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *mask) if (intmask & SDHCI_INT_TIMEOUT) host->cmd->error = -ETIMEDOUT; else if (intmask & (SDHCI_INT_CRC | SDHCI_INT_END_BIT | - SDHCI_INT_INDEX)) + SDHCI_INT_INDEX)) { host->cmd->error = -EILSEQ; + /* + * If this command initiates a data phase and a response + * CRC error is signalled, the card can start transferring + * data - the card may have received the command without + * error. We must not terminate the mmc_request early. + * + * If the card did not receive the command or returned an + * error which prevented it sending data, the data phase + * will time out. + */ + if (host->cmd->data) { + host->cmd = NULL; + return; + } + } if (host->cmd->error) {