From: Greg Kroah-Hartman Date: Mon, 8 Feb 2021 10:46:21 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v4.4.257~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1292e060b798d56fde4a81082db22c49e4bb43c2;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: mmc-core-limit-retries-when-analyse-of-sdio-tuples-fails.patch --- diff --git a/queue-4.9/mmc-core-limit-retries-when-analyse-of-sdio-tuples-fails.patch b/queue-4.9/mmc-core-limit-retries-when-analyse-of-sdio-tuples-fails.patch new file mode 100644 index 00000000000..0720a0c8fe2 --- /dev/null +++ b/queue-4.9/mmc-core-limit-retries-when-analyse-of-sdio-tuples-fails.patch @@ -0,0 +1,50 @@ +From f92e04f764b86e55e522988e6f4b6082d19a2721 Mon Sep 17 00:00:00 2001 +From: Fengnan Chang +Date: Sat, 23 Jan 2021 11:32:31 +0800 +Subject: mmc: core: Limit retries when analyse of SDIO tuples fails + +From: Fengnan Chang + +commit f92e04f764b86e55e522988e6f4b6082d19a2721 upstream. + +When analysing tuples fails we may loop indefinitely to retry. Let's avoid +this by using a 10s timeout and bail if not completed earlier. + +Signed-off-by: Fengnan Chang +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20210123033230.36442-1-fengnanchang@gmail.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/core/sdio_cis.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/mmc/core/sdio_cis.c ++++ b/drivers/mmc/core/sdio_cis.c +@@ -24,6 +24,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) + { +@@ -269,6 +271,8 @@ static int sdio_read_cis(struct mmc_card + + 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) +@@ -321,6 +325,8 @@ static int sdio_read_cis(struct mmc_card + 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", diff --git a/queue-4.9/series b/queue-4.9/series index 6de4f1ee940..40c30f79fac 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -29,3 +29,4 @@ mac80211-fix-station-rate-table-updates-on-assoc.patch kretprobe-avoid-re-registration-of-the-same-kretprobe-earlier.patch xhci-fix-bounce-buffer-usage-for-non-sg-list-case.patch cifs-report-error-instead-of-invalid-when-revalidating-a-dentry-fails.patch +mmc-core-limit-retries-when-analyse-of-sdio-tuples-fails.patch