From 8275b6bacaaa4be487c0c50c2edfe9d9d33bbc44 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Jun 2020 14:05:05 +0200 Subject: [PATCH] 4.14-stable patches added patches: agp-intel-reinforce-the-barrier-after-gtt-updates.patch mmc-sdhci-msm-clear-tuning-done-flag-while-hs400-tuning.patch mmc-sdio-fix-potential-null-pointer-error-in-mmc_sdio_init_card.patch --- ...nforce-the-barrier-after-gtt-updates.patch | 55 +++++++++++++++++++ ...-tuning-done-flag-while-hs400-tuning.patch | 42 ++++++++++++++ ...-pointer-error-in-mmc_sdio_init_card.patch | 40 ++++++++++++++ queue-4.14/series | 3 + 4 files changed, 140 insertions(+) create mode 100644 queue-4.14/agp-intel-reinforce-the-barrier-after-gtt-updates.patch create mode 100644 queue-4.14/mmc-sdhci-msm-clear-tuning-done-flag-while-hs400-tuning.patch create mode 100644 queue-4.14/mmc-sdio-fix-potential-null-pointer-error-in-mmc_sdio_init_card.patch diff --git a/queue-4.14/agp-intel-reinforce-the-barrier-after-gtt-updates.patch b/queue-4.14/agp-intel-reinforce-the-barrier-after-gtt-updates.patch new file mode 100644 index 00000000000..b81ba71b75e --- /dev/null +++ b/queue-4.14/agp-intel-reinforce-the-barrier-after-gtt-updates.patch @@ -0,0 +1,55 @@ +From f30d3ced9fafa03e4855508929b5b6334907f45e Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Fri, 10 Apr 2020 09:35:35 +0100 +Subject: agp/intel: Reinforce the barrier after GTT updates + +From: Chris Wilson + +commit f30d3ced9fafa03e4855508929b5b6334907f45e upstream. + +After changing the timing between GTT updates and execution on the GPU, +we started seeing sporadic failures on Ironlake. These were narrowed +down to being an insufficiently strong enough barrier/delay after +updating the GTT and scheduling execution on the GPU. By forcing the +uncached read, and adding the missing barrier for the singular +insert_page (relocation paths), the sporadic failures go away. + +Fixes: 983d308cb8f6 ("agp/intel: Serialise after GTT updates") +Fixes: 3497971a71d8 ("agp/intel: Flush chipset writes after updating a single PTE") +Signed-off-by: Chris Wilson +Acked-by: Andi Shyti +Cc: stable@vger.kernel.org # v4.0+ +Link: https://patchwork.freedesktop.org/patch/msgid/20200410083535.25464-1-chris@chris-wilson.co.uk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/char/agp/intel-gtt.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/char/agp/intel-gtt.c ++++ b/drivers/char/agp/intel-gtt.c +@@ -846,6 +846,7 @@ void intel_gtt_insert_page(dma_addr_t ad + unsigned int flags) + { + intel_private.driver->write_entry(addr, pg, flags); ++ readl(intel_private.gtt + pg); + if (intel_private.driver->chipset_flush) + intel_private.driver->chipset_flush(); + } +@@ -871,7 +872,7 @@ void intel_gtt_insert_sg_entries(struct + j++; + } + } +- wmb(); ++ readl(intel_private.gtt + j - 1); + if (intel_private.driver->chipset_flush) + intel_private.driver->chipset_flush(); + } +@@ -1105,6 +1106,7 @@ static void i9xx_cleanup(void) + + static void i9xx_chipset_flush(void) + { ++ wmb(); + if (intel_private.i9xx_flush_page) + writel(1, intel_private.i9xx_flush_page); + } diff --git a/queue-4.14/mmc-sdhci-msm-clear-tuning-done-flag-while-hs400-tuning.patch b/queue-4.14/mmc-sdhci-msm-clear-tuning-done-flag-while-hs400-tuning.patch new file mode 100644 index 00000000000..1dd3966d596 --- /dev/null +++ b/queue-4.14/mmc-sdhci-msm-clear-tuning-done-flag-while-hs400-tuning.patch @@ -0,0 +1,42 @@ +From 9253d71011c349d5f5cc0cebdf68b4a80811b92d Mon Sep 17 00:00:00 2001 +From: Veerabhadrarao Badiganti +Date: Thu, 28 May 2020 20:43:52 +0530 +Subject: mmc: sdhci-msm: Clear tuning done flag while hs400 tuning + +From: Veerabhadrarao Badiganti + +commit 9253d71011c349d5f5cc0cebdf68b4a80811b92d upstream. + +Clear tuning_done flag while executing tuning to ensure vendor +specific HS400 settings are applied properly when the controller +is re-initialized in HS400 mode. + +Without this, re-initialization of the qcom SDHC in HS400 mode fails +while resuming the driver from runtime-suspend or system-suspend. + +Fixes: ff06ce417828 ("mmc: sdhci-msm: Add HS400 platform support") +Cc: stable@vger.kernel.org +Signed-off-by: Veerabhadrarao Badiganti +Link: https://lore.kernel.org/r/1590678838-18099-1-git-send-email-vbadigan@codeaurora.org +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/host/sdhci-msm.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/mmc/host/sdhci-msm.c ++++ b/drivers/mmc/host/sdhci-msm.c +@@ -861,6 +861,12 @@ static int sdhci_msm_execute_tuning(stru + msm_host->use_cdr = true; + + /* ++ * Clear tuning_done flag before tuning to ensure proper ++ * HS400 settings. ++ */ ++ msm_host->tuning_done = 0; ++ ++ /* + * For HS400 tuning in HS200 timing requires: + * - select MCLK/2 in VENDOR_SPEC + * - program MCLK to 400MHz (or nearest supported) in GCC diff --git a/queue-4.14/mmc-sdio-fix-potential-null-pointer-error-in-mmc_sdio_init_card.patch b/queue-4.14/mmc-sdio-fix-potential-null-pointer-error-in-mmc_sdio_init_card.patch new file mode 100644 index 00000000000..e2825ade66a --- /dev/null +++ b/queue-4.14/mmc-sdio-fix-potential-null-pointer-error-in-mmc_sdio_init_card.patch @@ -0,0 +1,40 @@ +From f04086c225da11ad16d7f9a2fbca6483ab16dded Mon Sep 17 00:00:00 2001 +From: Ulf Hansson +Date: Thu, 30 Apr 2020 11:16:37 +0200 +Subject: mmc: sdio: Fix potential NULL pointer error in mmc_sdio_init_card() + +From: Ulf Hansson + +commit f04086c225da11ad16d7f9a2fbca6483ab16dded upstream. + +During some scenarios mmc_sdio_init_card() runs a retry path for the UHS-I +specific initialization, which leads to removal of the previously allocated +card. A new card is then re-allocated while retrying. + +However, in one of the corresponding error paths we may end up to remove an +already removed card, which likely leads to a NULL pointer exception. So, +let's fix this. + +Fixes: 5fc3d80ef496 ("mmc: sdio: don't use rocr to check if the card could support UHS mode") +Cc: +Signed-off-by: Ulf Hansson +Link: https://lore.kernel.org/r/20200430091640.455-2-ulf.hansson@linaro.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/core/sdio.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/mmc/core/sdio.c ++++ b/drivers/mmc/core/sdio.c +@@ -717,9 +717,8 @@ try_again: + /* Retry init sequence, but without R4_18V_PRESENT. */ + retries = 0; + goto try_again; +- } else { +- goto remove; + } ++ return err; + } + + /* diff --git a/queue-4.14/series b/queue-4.14/series index 3e63417619f..94125ced4aa 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -67,3 +67,6 @@ smack-slab-out-of-bounds-in-vsscanf.patch mm-slub-fix-a-memory-leak-in-sysfs_slab_add.patch fat-don-t-allow-to-mount-if-the-fat-length-0.patch perf-add-cond_resched-to-task_function_call.patch +agp-intel-reinforce-the-barrier-after-gtt-updates.patch +mmc-sdhci-msm-clear-tuning-done-flag-while-hs400-tuning.patch +mmc-sdio-fix-potential-null-pointer-error-in-mmc_sdio_init_card.patch -- 2.47.3