diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2021-02-01 14:03:14 +0300 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2021-02-01 14:03:14 +0300 |
commit | fdb7ef5b7d36baba1f99bbd33469bf7e51c6b00e (patch) | |
tree | cff1adced479733e112bba32499fb0dff00b4720 /drivers/mmc/core | |
parent | 3feb459be5c9de1b6fdc2866d7603252a975e52f (diff) | |
parent | d7fb9c24209556478e65211d7a1f056f2d43cceb (diff) | |
download | linux-fdb7ef5b7d36baba1f99bbd33469bf7e51c6b00e.tar.xz |
Merge branch 'fixes' into next
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/sdio_cis.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c index 44bea5e4aeda..b23773583179 100644 --- a/drivers/mmc/core/sdio_cis.c +++ b/drivers/mmc/core/sdio_cis.c @@ -20,6 +20,8 @@ #include "sdio_cis.h" #include "sdio_ops.h" +#define SDIO_READ_CIS_TIMEOUT_MS (10 * 1000) /* 10s */ + static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func, const unsigned char *buf, unsigned size) { @@ -274,6 +276,8 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func) do { unsigned char tpl_code, tpl_link; + unsigned long timeout = jiffies + + msecs_to_jiffies(SDIO_READ_CIS_TIMEOUT_MS); ret = mmc_io_rw_direct(card, 0, 0, ptr++, 0, &tpl_code); if (ret) @@ -326,6 +330,8 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func) prev = &this->next; if (ret == -ENOENT) { + if (time_after(jiffies, timeout)) + break; /* warn about unknown tuples */ pr_warn_ratelimited("%s: queuing unknown" " CIS tuple 0x%02x (%u bytes)\n", |