Merge "mmc: sdhci: Fix issue with SDHCI_NEEDS_RETUNING"

This commit is contained in:
Linux Build Service Account 2014-06-05 23:58:55 -07:00 committed by Gerrit - the friendly Code Review server
commit 8630a48bb7

View file

@ -1735,6 +1735,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
MMC_SEND_TUNING_BLOCK_HS200 :
MMC_SEND_TUNING_BLOCK;
host->mrq = NULL;
host->flags &= ~SDHCI_NEEDS_RETUNING;
spin_unlock_irqrestore(&host->lock, flags);
sdhci_execute_tuning(mmc, tuning_opcode);
spin_lock_irqsave(&host->lock, flags);
@ -2774,6 +2775,7 @@ static void sdhci_tuning_timer(unsigned long data)
static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask)
{
u16 auto_cmd_status;
u32 command;
BUG_ON(intmask == 0);
if (!host->cmd) {
@ -2805,8 +2807,13 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask)
}
if (host->cmd->error) {
if (host->cmd->error == -EILSEQ)
host->flags |= SDHCI_NEEDS_RETUNING;
command = SDHCI_GET_CMD(sdhci_readw(host,
SDHCI_COMMAND));
if (host->cmd->error == -EILSEQ &&
(command != MMC_SEND_TUNING_BLOCK_HS400) &&
(command != MMC_SEND_TUNING_BLOCK_HS200) &&
(command != MMC_SEND_TUNING_BLOCK))
host->flags |= SDHCI_NEEDS_RETUNING;
tasklet_schedule(&host->finish_tasklet);
return;
}