From: Adrian Hunter Subject: [PATCH V3 12/15] mmc: sdhci: Flag re-tuning is needed on CRC or End-Bit errors Date: Tue, 10 Mar 2015 14:43:07 +0200 Message-ID: <1425991390-4983-13-git-send-email-adrian.hunter@intel.com> References: <1425991390-4983-1-git-send-email-adrian.hunter@intel.com> Return-path: Received: from mga01.intel.com ([192.55.52.88]:3552 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752652AbbCJMpo (ORCPT ); Tue, 10 Mar 2015 08:45:44 -0400 In-Reply-To: <1425991390-4983-1-git-send-email-adrian.hunter@intel.com> Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: Ulf Hansson , Chris Ball Cc: linux-mmc , Aaron Lu , Philip Rakity , Girish K S , Al Cooper , Arend van Spriel CRC or End-Bit errors could possibly be alleviated by re-tuning so flag re-tuning needed in those cases. Note this has no effect if re-tuning has not been enabled. Signed-off-by: Adrian Hunter --- drivers/mmc/host/sdhci.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1d9b038..25657ee 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2345,8 +2345,10 @@ 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; + mmc_retune_needed(host->mmc); + } if (host->cmd->error) { tasklet_schedule(&host->finish_tasklet); @@ -2471,13 +2473,15 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) if (intmask & SDHCI_INT_DATA_TIMEOUT) host->data->error = -ETIMEDOUT; - else if (intmask & SDHCI_INT_DATA_END_BIT) + else if (intmask & SDHCI_INT_DATA_END_BIT) { host->data->error = -EILSEQ; - else if ((intmask & SDHCI_INT_DATA_CRC) && + mmc_retune_needed(host->mmc); + } else if ((intmask & SDHCI_INT_DATA_CRC) && SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)) - != MMC_BUS_TEST_R) + != MMC_BUS_TEST_R) { host->data->error = -EILSEQ; - else if (intmask & SDHCI_INT_ADMA_ERROR) { + mmc_retune_needed(host->mmc); + } else if (intmask & SDHCI_INT_ADMA_ERROR) { pr_err("%s: ADMA error\n", mmc_hostname(host->mmc)); sdhci_adma_show_error(host); host->data->error = -EIO; -- 1.9.1