From patchwork Tue Sep 23 20:00:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 4959611 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A19F0BEEA5 for ; Tue, 23 Sep 2014 20:02:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FD042016C for ; Tue, 23 Sep 2014 20:02:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B255D2022D for ; Tue, 23 Sep 2014 20:02:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750889AbaIWUCF (ORCPT ); Tue, 23 Sep 2014 16:02:05 -0400 Received: from mga14.intel.com ([192.55.52.115]:41324 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756259AbaIWUCC (ORCPT ); Tue, 23 Sep 2014 16:02:02 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 23 Sep 2014 12:52:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,582,1406617200"; d="scan'208";a="595790548" Received: from ahunter-desktop.fi.intel.com ([10.237.72.97]) by fmsmga001.fm.intel.com with ESMTP; 23 Sep 2014 13:02:01 -0700 From: Adrian Hunter To: Ulf Hansson , Chris Ball Cc: linux-mmc Subject: [PATCH 6/6] mmc: sdhci: Transfer Complete has higher priority than Data Timeout Error Date: Tue, 23 Sep 2014 23:00:30 +0300 Message-Id: <1411502430-25535-7-git-send-email-adrian.hunter@intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1411502430-25535-1-git-send-email-adrian.hunter@intel.com> References: <1411502430-25535-1-git-send-email-adrian.hunter@intel.com> 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.6 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 According to the SD Host Controller Standard Specification: "...Transfer Complete has higher priority than Data Timeout Error. If both bits are set to 1, execution of a command can be considered to be completed." Adjust the checking of SDHCI_INT_DATA_TIMEOUT and SDHCI_INT_DATA_END (Transfer Complete) accordingly. Signed-off-by: Adrian Hunter --- drivers/mmc/host/sdhci.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 7481bd8..7a8586f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2329,11 +2329,6 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) * above in sdhci_cmd_irq(). */ if (host->cmd && (host->cmd->flags & MMC_RSP_BUSY)) { - if (intmask & SDHCI_INT_DATA_TIMEOUT) { - host->cmd->error = -ETIMEDOUT; - tasklet_schedule(&host->finish_tasklet); - return; - } if (intmask & SDHCI_INT_DATA_END) { /* * Some cards handle busy-end interrupt @@ -2346,6 +2341,11 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) host->busy_handle = 1; return; } + if (intmask & SDHCI_INT_DATA_TIMEOUT) { + host->cmd->error = -ETIMEDOUT; + tasklet_schedule(&host->finish_tasklet); + return; + } } pr_err("%s: Got data interrupt 0x%08x even " @@ -2356,7 +2356,8 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) return; } - if (intmask & SDHCI_INT_DATA_TIMEOUT) + if ((intmask & SDHCI_INT_DATA_TIMEOUT) && + !(intmask & SDHCI_INT_DATA_END)) host->data->error = -ETIMEDOUT; else if (intmask & SDHCI_INT_DATA_END_BIT) host->data->error = -EILSEQ;