Skip to content

Commit 0c7e4a4

Browse files
committed
mmc: sdhci: reduce default timeout to 5s
Reduce the maximum time it takes to get to reboot by decreasing the default SDHCI timeout to 5 seconds. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent 39c9af3 commit 0c7e4a4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/mmc/host/sdhci.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,7 @@ static void sdhci_finish_data(struct sdhci_host *host)
16291629

16301630
static bool sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
16311631
{
1632+
const unsigned long default_timeout_secs = 5;
16321633
int flags;
16331634
u32 mask;
16341635
unsigned long timeout;
@@ -1704,10 +1705,10 @@ static bool sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
17041705
timeout = jiffies;
17051706
if (host->data_timeout)
17061707
timeout += nsecs_to_jiffies(host->data_timeout);
1707-
else if (!cmd->data && cmd->busy_timeout > 9000)
1708+
else if (!cmd->data && cmd->busy_timeout > (default_timeout_secs - 1) * 1000)
17081709
timeout += DIV_ROUND_UP(cmd->busy_timeout, 1000) * HZ + HZ;
17091710
else
1710-
timeout += 10 * HZ;
1711+
timeout += default_timeout_secs * HZ;
17111712
sdhci_mod_timer(host, cmd->mrq, timeout);
17121713

17131714
if (host->use_external_dma)

0 commit comments

Comments
 (0)