Skip to content

Commit

Permalink
mmc: sdhci: correct the maximum timeout when enable CMDQ
Browse files Browse the repository at this point in the history
Change to use sdhci_set_timeout() to set the maximum timeout, so that
the host can use it's own set_timeout() callback to set the maximum
timeout if the host has.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
BOUGH CHEN authored and Ulf Hansson committed Feb 25, 2019
1 parent 029e247 commit 401059d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd,
bool *too_big)
{
u8 count;
struct mmc_data *data = cmd->data;
struct mmc_data *data;
unsigned target_timeout, current_timeout;

*too_big = true;
Expand All @@ -897,6 +897,11 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd,
if (host->quirks & SDHCI_QUIRK_BROKEN_TIMEOUT_VAL)
return 0xE;

/* Unspecified command, asume max */
if (cmd == NULL)
return 0xE;

data = cmd->data;
/* Unspecified timeout, assume max */
if (!data && !cmd->busy_timeout)
return 0xE;
Expand Down Expand Up @@ -3364,7 +3369,7 @@ void sdhci_cqe_enable(struct mmc_host *mmc)
SDHCI_BLOCK_SIZE);

/* Set maximum timeout */
sdhci_writeb(host, 0xE, SDHCI_TIMEOUT_CONTROL);
sdhci_set_timeout(host, NULL);

host->ier = host->cqe_ier;

Expand Down

0 comments on commit 401059d

Please sign in to comment.