--- /dev/null
+From f30d3ced9fafa03e4855508929b5b6334907f45e Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Fri, 10 Apr 2020 09:35:35 +0100
+Subject: agp/intel: Reinforce the barrier after GTT updates
+
+From: Chris Wilson <chris@chris-wilson.co.uk>
+
+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 <chris@chris-wilson.co.uk>
+Acked-by: Andi Shyti <andi.shyti@intel.com>
+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 <gregkh@linuxfoundation.org>
+
+---
+ 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);
+ }
--- /dev/null
+From a1af7f36c70369b971ee1cf679dd68368dad23f0 Mon Sep 17 00:00:00 2001
+From: Ludovic Desroches <ludovic.desroches@microchip.com>
+Date: Thu, 2 Apr 2020 00:15:00 +0200
+Subject: ARM: dts: at91: sama5d2_ptc_ek: fix sdmmc0 node description
+
+From: Ludovic Desroches <ludovic.desroches@microchip.com>
+
+commit a1af7f36c70369b971ee1cf679dd68368dad23f0 upstream.
+
+Remove non-removable and mmc-ddr-1_8v properties from the sdmmc0
+node which come probably from an unchecked copy/paste.
+
+Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
+Fixes:42ed535595ec "ARM: dts: at91: introduce the sama5d2 ptc ek board"
+Cc: stable@vger.kernel.org # 4.19 and later
+Link: https://lore.kernel.org/r/20200401221504.41196-1-ludovic.desroches@microchip.com
+Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
++++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
+@@ -125,8 +125,6 @@
+ bus-width = <8>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_sdmmc0_default>;
+- non-removable;
+- mmc-ddr-1_8v;
+ status = "okay";
+ };
+
--- /dev/null
+From 263c61581a38d0a5ad1f5f4a9143b27d68caeffd Mon Sep 17 00:00:00 2001
+From: Jiri Kosina <jkosina@suse.cz>
+Date: Tue, 26 May 2020 11:49:18 +0200
+Subject: block/floppy: fix contended case in floppy_queue_rq()
+
+From: Jiri Kosina <jkosina@suse.cz>
+
+commit 263c61581a38d0a5ad1f5f4a9143b27d68caeffd upstream.
+
+Since the switch of floppy driver to blk-mq, the contended (fdc_busy) case
+in floppy_queue_rq() is not handled correctly.
+
+In case we reach floppy_queue_rq() with fdc_busy set (i.e. with the floppy
+locked due to another request still being in-flight), we put the request
+on the list of requests and return BLK_STS_OK to the block core, without
+actually scheduling delayed work / doing further processing of the
+request. This means that processing of this request is postponed until
+another request comes and passess uncontended.
+
+Which in some cases might actually never happen and we keep waiting
+indefinitely. The simple testcase is
+
+ for i in `seq 1 2000`; do echo -en $i '\r'; blkid --info /dev/fd0 2> /dev/null; done
+
+run in quemu. That reliably causes blkid eventually indefinitely hanging
+in __floppy_read_block_0() waiting for completion, as the BIO callback
+never happens, and no further IO is ever submitted on the (non-existent)
+floppy device. This was observed reliably on qemu-emulated device.
+
+Fix that by not queuing the request in the contended case, and return
+BLK_STS_RESOURCE instead, so that blk core handles the request
+rescheduling and let it pass properly non-contended later.
+
+Fixes: a9f38e1dec107a ("floppy: convert to blk-mq")
+Cc: stable@vger.kernel.org
+Tested-by: Libor Pechacek <lpechacek@suse.cz>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/block/floppy.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/block/floppy.c
++++ b/drivers/block/floppy.c
+@@ -2938,17 +2938,17 @@ static blk_status_t floppy_queue_rq(stru
+ (unsigned long long) current_req->cmd_flags))
+ return BLK_STS_IOERR;
+
+- spin_lock_irq(&floppy_lock);
+- list_add_tail(&bd->rq->queuelist, &floppy_reqs);
+- spin_unlock_irq(&floppy_lock);
+-
+ if (test_and_set_bit(0, &fdc_busy)) {
+ /* fdc busy, this new request will be treated when the
+ current one is done */
+ is_alive(__func__, "old request running");
+- return BLK_STS_OK;
++ return BLK_STS_RESOURCE;
+ }
+
++ spin_lock_irq(&floppy_lock);
++ list_add_tail(&bd->rq->queuelist, &floppy_reqs);
++ spin_unlock_irq(&floppy_lock);
++
+ command_status = FD_COMMAND_NONE;
+ __reschedule_timeout(MAXTIMEOUT, "fd_request");
+ set_fdc(0);
--- /dev/null
+From fe8d33bd33d527dee3155d2bccd714a655f37334 Mon Sep 17 00:00:00 2001
+From: Ludovic Barre <ludovic.barre@st.com>
+Date: Tue, 26 May 2020 17:51:02 +0200
+Subject: mmc: mmci_sdmmc: fix DMA API warning overlapping mappings
+
+From: Ludovic Barre <ludovic.barre@st.com>
+
+commit fe8d33bd33d527dee3155d2bccd714a655f37334 upstream.
+
+Turning on CONFIG_DMA_API_DEBUG_SG results in the following warning:
+WARNING: CPU: 1 PID: 20 at kernel/dma/debug.c:500 add_dma_entry+0x16c/0x17c
+DMA-API: exceeded 7 overlapping mappings of cacheline 0x031d2645
+Modules linked in:
+CPU: 1 PID: 20 Comm: kworker/1:1 Not tainted 5.5.0-rc2-00021-gdeda30999c2b-dirty #49
+Hardware name: STM32 (Device Tree Support)
+Workqueue: events_freezable mmc_rescan
+[<c03138c0>] (unwind_backtrace) from [<c030d760>] (show_stack+0x10/0x14)
+[<c030d760>] (show_stack) from [<c0f2eb28>] (dump_stack+0xc0/0xd4)
+[<c0f2eb28>] (dump_stack) from [<c034a14c>] (__warn+0xd0/0xf8)
+[<c034a14c>] (__warn) from [<c034a530>] (warn_slowpath_fmt+0x94/0xb8)
+[<c034a530>] (warn_slowpath_fmt) from [<c03bca0c>] (add_dma_entry+0x16c/0x17c)
+[<c03bca0c>] (add_dma_entry) from [<c03bdf54>] (debug_dma_map_sg+0xe4/0x3d4)
+[<c03bdf54>] (debug_dma_map_sg) from [<c0d09244>] (sdmmc_idma_prep_data+0x94/0xf8)
+[<c0d09244>] (sdmmc_idma_prep_data) from [<c0d05a2c>] (mmci_prep_data+0x2c/0xb0)
+[<c0d05a2c>] (mmci_prep_data) from [<c0d073ec>] (mmci_start_data+0x134/0x2f0)
+[<c0d073ec>] (mmci_start_data) from [<c0d078d0>] (mmci_request+0xe8/0x154)
+[<c0d078d0>] (mmci_request) from [<c0cecb44>] (mmc_start_request+0x94/0xbc)
+
+DMA api debug brings to light leaking dma-mappings, dma_map_sg and
+dma_unmap_sg are not correctly balanced.
+
+If a request is prepared, the dma_map/unmap are done in asynchronous call
+pre_req (prep_data) and post_req (unprep_data). In this case the
+dma-mapping is right balanced.
+
+But if the request was not prepared, the data->host_cookie is define to
+zero and the dma_map/unmap must be done in the request. The dma_map is
+called by mmci_dma_start (prep_data), but there is no dma_unmap in this
+case.
+
+This patch adds dma_unmap_sg when the dma is finalized and the data cookie
+is zero (request not prepared).
+
+Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
+Link: https://lore.kernel.org/r/20200526155103.12514-2-ludovic.barre@st.com
+Fixes: 46b723dd867d ("mmc: mmci: add stm32 sdmmc variant")
+Cc: stable@vger.kernel.org
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/mmci_stm32_sdmmc.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/mmc/host/mmci_stm32_sdmmc.c
++++ b/drivers/mmc/host/mmci_stm32_sdmmc.c
+@@ -188,6 +188,9 @@ static int sdmmc_idma_start(struct mmci_
+ static void sdmmc_idma_finalize(struct mmci_host *host, struct mmc_data *data)
+ {
+ writel_relaxed(0, host->base + MMCI_STM32_IDMACTRLR);
++
++ if (!data->host_cookie)
++ sdmmc_idma_unprep_data(host, data, 0);
+ }
+
+ static void mmci_sdmmc_set_clkreg(struct mmci_host *host, unsigned int desired)
--- /dev/null
+From 9253d71011c349d5f5cc0cebdf68b4a80811b92d Mon Sep 17 00:00:00 2001
+From: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
+Date: Thu, 28 May 2020 20:43:52 +0530
+Subject: mmc: sdhci-msm: Clear tuning done flag while hs400 tuning
+
+From: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
+
+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 <vbadigan@codeaurora.org>
+Link: https://lore.kernel.org/r/1590678838-18099-1-git-send-email-vbadigan@codeaurora.org
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -1130,6 +1130,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
--- /dev/null
+From dbdea70f71d672c12bc4454e7c258a8f78194d74 Mon Sep 17 00:00:00 2001
+From: Eugen Hristev <eugen.hristev@microchip.com>
+Date: Wed, 27 May 2020 13:56:59 +0300
+Subject: mmc: sdhci-of-at91: fix CALCR register being rewritten
+
+From: Eugen Hristev <eugen.hristev@microchip.com>
+
+commit dbdea70f71d672c12bc4454e7c258a8f78194d74 upstream.
+
+When enabling calibration at reset, the CALCR register was completely
+rewritten. This may cause certain bits being deleted unintentedly.
+Fix by issuing a read-modify-write operation.
+
+Fixes: 727d836a375a ("mmc: sdhci-of-at91: add DT property to enable calibration on full reset")
+Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
+Link: https://lore.kernel.org/r/20200527105659.142560-1-eugen.hristev@microchip.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/sdhci-of-at91.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/mmc/host/sdhci-of-at91.c
++++ b/drivers/mmc/host/sdhci-of-at91.c
+@@ -120,9 +120,12 @@ static void sdhci_at91_reset(struct sdhc
+ || mmc_gpio_get_cd(host->mmc) >= 0)
+ sdhci_at91_set_force_card_detect(host);
+
+- if (priv->cal_always_on && (mask & SDHCI_RESET_ALL))
+- sdhci_writel(host, SDMMC_CALCR_ALWYSON | SDMMC_CALCR_EN,
++ if (priv->cal_always_on && (mask & SDHCI_RESET_ALL)) {
++ u32 calcr = sdhci_readl(host, SDMMC_CALCR);
++
++ sdhci_writel(host, calcr | SDMMC_CALCR_ALWYSON | SDMMC_CALCR_EN,
+ SDMMC_CALCR);
++ }
+ }
+
+ static const struct sdhci_ops sdhci_at91_sama5d2_ops = {
--- /dev/null
+From f04086c225da11ad16d7f9a2fbca6483ab16dded Mon Sep 17 00:00:00 2001
+From: Ulf Hansson <ulf.hansson@linaro.org>
+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 <ulf.hansson@linaro.org>
+
+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: <stable@vger.kernel.org>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Link: https://lore.kernel.org/r/20200430091640.455-2-ulf.hansson@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -718,9 +718,8 @@ try_again:
+ /* Retry init sequence, but without R4_18V_PRESENT. */
+ retries = 0;
+ goto try_again;
+- } else {
+- goto remove;
+ }
++ return err;
+ }
+
+ /*
--- /dev/null
+From a94a59f43749b4f8cd81b8be87c95f9ef898d19d Mon Sep 17 00:00:00 2001
+From: Ulf Hansson <ulf.hansson@linaro.org>
+Date: Thu, 30 Apr 2020 11:16:38 +0200
+Subject: mmc: sdio: Fix several potential memory leaks in mmc_sdio_init_card()
+
+From: Ulf Hansson <ulf.hansson@linaro.org>
+
+commit a94a59f43749b4f8cd81b8be87c95f9ef898d19d upstream.
+
+Over the years, the code in mmc_sdio_init_card() has grown to become quite
+messy. Unfortunate this has also lead to that several paths are leaking
+memory in form of an allocated struct mmc_card, which includes additional
+data, such as initialized struct device for example.
+
+Unfortunate, it's a too complex task find each offending commit. Therefore,
+this change fixes all memory leaks at once.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Link: https://lore.kernel.org/r/20200430091640.455-3-ulf.hansson@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/core/sdio.c | 58 ++++++++++++++++++++++--------------------------
+ 1 file changed, 27 insertions(+), 31 deletions(-)
+
+--- a/drivers/mmc/core/sdio.c
++++ b/drivers/mmc/core/sdio.c
+@@ -584,7 +584,7 @@ try_again:
+ */
+ err = mmc_send_io_op_cond(host, ocr, &rocr);
+ if (err)
+- goto err;
++ return err;
+
+ /*
+ * For SPI, enable CRC as appropriate.
+@@ -592,17 +592,15 @@ try_again:
+ if (mmc_host_is_spi(host)) {
+ err = mmc_spi_set_crc(host, use_spi_crc);
+ if (err)
+- goto err;
++ return err;
+ }
+
+ /*
+ * Allocate card structure.
+ */
+ card = mmc_alloc_card(host, NULL);
+- if (IS_ERR(card)) {
+- err = PTR_ERR(card);
+- goto err;
+- }
++ if (IS_ERR(card))
++ return PTR_ERR(card);
+
+ if ((rocr & R4_MEMORY_PRESENT) &&
+ mmc_sd_get_cid(host, ocr & rocr, card->raw_cid, NULL) == 0) {
+@@ -610,19 +608,15 @@ try_again:
+
+ if (oldcard && (oldcard->type != MMC_TYPE_SD_COMBO ||
+ memcmp(card->raw_cid, oldcard->raw_cid, sizeof(card->raw_cid)) != 0)) {
+- mmc_remove_card(card);
+- pr_debug("%s: Perhaps the card was replaced\n",
+- mmc_hostname(host));
+- return -ENOENT;
++ err = -ENOENT;
++ goto mismatch;
+ }
+ } else {
+ card->type = MMC_TYPE_SDIO;
+
+ if (oldcard && oldcard->type != MMC_TYPE_SDIO) {
+- mmc_remove_card(card);
+- pr_debug("%s: Perhaps the card was replaced\n",
+- mmc_hostname(host));
+- return -ENOENT;
++ err = -ENOENT;
++ goto mismatch;
+ }
+ }
+
+@@ -677,7 +671,7 @@ try_again:
+ if (!oldcard && card->type == MMC_TYPE_SD_COMBO) {
+ err = mmc_sd_get_csd(host, card);
+ if (err)
+- return err;
++ goto remove;
+
+ mmc_decode_cid(card);
+ }
+@@ -704,7 +698,12 @@ try_again:
+ mmc_set_timing(card->host, MMC_TIMING_SD_HS);
+ }
+
+- goto finish;
++ if (oldcard)
++ mmc_remove_card(card);
++ else
++ host->card = card;
++
++ return 0;
+ }
+
+ /*
+@@ -730,16 +729,14 @@ try_again:
+ goto remove;
+
+ if (oldcard) {
+- int same = (card->cis.vendor == oldcard->cis.vendor &&
+- card->cis.device == oldcard->cis.device);
+- mmc_remove_card(card);
+- if (!same) {
+- pr_debug("%s: Perhaps the card was replaced\n",
+- mmc_hostname(host));
+- return -ENOENT;
++ if (card->cis.vendor == oldcard->cis.vendor &&
++ card->cis.device == oldcard->cis.device) {
++ mmc_remove_card(card);
++ card = oldcard;
++ } else {
++ err = -ENOENT;
++ goto mismatch;
+ }
+-
+- card = oldcard;
+ }
+ card->ocr = ocr_card;
+ mmc_fixup_device(card, sdio_fixup_methods);
+@@ -800,16 +797,15 @@ try_again:
+ err = -EINVAL;
+ goto remove;
+ }
+-finish:
+- if (!oldcard)
+- host->card = card;
++
++ host->card = card;
+ return 0;
+
++mismatch:
++ pr_debug("%s: Perhaps the card was replaced\n", mmc_hostname(host));
+ remove:
+- if (!oldcard)
++ if (oldcard != card)
+ mmc_remove_card(card);
+-
+-err:
+ return err;
+ }
+
--- /dev/null
+From 4bd784411aca022622e484eb262f5a0540ae732c Mon Sep 17 00:00:00 2001
+From: Ulf Hansson <ulf.hansson@linaro.org>
+Date: Tue, 19 May 2020 17:24:34 +0200
+Subject: mmc: tmio: Further fixup runtime PM management at remove
+
+From: Ulf Hansson <ulf.hansson@linaro.org>
+
+commit 4bd784411aca022622e484eb262f5a0540ae732c upstream.
+
+Before calling tmio_mmc_host_probe(), the caller is required to enable
+clocks for its device, as to make it accessible when reading/writing
+registers during probe.
+
+Therefore, the responsibility to disable these clocks, in the error path of
+->probe() and during ->remove(), is better managed outside
+tmio_mmc_host_remove(). As a matter of fact, callers of
+tmio_mmc_host_remove() already expects this to be the behaviour.
+
+However, there's a problem with tmio_mmc_host_remove() when the Kconfig
+option, CONFIG_PM, is set. More precisely, tmio_mmc_host_remove() may then
+disable the clock via runtime PM, which leads to clock enable/disable
+imbalance problems, when the caller of tmio_mmc_host_remove() also tries to
+disable the same clocks.
+
+To solve the problem, let's make sure tmio_mmc_host_remove() leaves the
+device with clocks enabled, but also make sure to disable the IRQs, as we
+normally do at ->runtime_suspend().
+
+Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20200519152434.6867-1-ulf.hansson@linaro.org
+Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/tmio_mmc_core.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/mmc/host/tmio_mmc_core.c
++++ b/drivers/mmc/host/tmio_mmc_core.c
+@@ -1231,12 +1231,14 @@ void tmio_mmc_host_remove(struct tmio_mm
+ cancel_work_sync(&host->done);
+ cancel_delayed_work_sync(&host->delayed_reset_work);
+ tmio_mmc_release_dma(host);
++ tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_ALL);
+
+- pm_runtime_dont_use_autosuspend(&pdev->dev);
+ if (host->native_hotplug)
+ pm_runtime_put_noidle(&pdev->dev);
+- pm_runtime_put_sync(&pdev->dev);
++
+ pm_runtime_disable(&pdev->dev);
++ pm_runtime_dont_use_autosuspend(&pdev->dev);
++ pm_runtime_put_noidle(&pdev->dev);
+ }
+ EXPORT_SYMBOL_GPL(tmio_mmc_host_remove);
+
--- /dev/null
+From 5d1f42e14b135773c0cc1d82e904c5b223783a9d Mon Sep 17 00:00:00 2001
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+Date: Mon, 11 May 2020 15:21:58 +0900
+Subject: mmc: uniphier-sd: call devm_request_irq() after tmio_mmc_host_probe()
+
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+
+commit 5d1f42e14b135773c0cc1d82e904c5b223783a9d upstream.
+
+Currently, tmio_mmc_irq() handler is registered before the host is
+fully initialized by tmio_mmc_host_probe(). I did not previously notice
+this problem.
+
+The boot ROM of a new Socionext SoC unmasks interrupts (CTL_IRQ_MASK)
+somehow. The handler is invoked before tmio_mmc_host_probe(), then
+emits noisy call trace.
+
+Move devm_request_irq() below tmio_mmc_host_probe().
+
+Fixes: 3fd784f745dd ("mmc: uniphier-sd: add UniPhier SD/eMMC controller driver")
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20200511062158.1790924-1-yamada.masahiro@socionext.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/uniphier-sd.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/mmc/host/uniphier-sd.c
++++ b/drivers/mmc/host/uniphier-sd.c
+@@ -610,11 +610,6 @@ static int uniphier_sd_probe(struct plat
+ }
+ }
+
+- ret = devm_request_irq(dev, irq, tmio_mmc_irq, IRQF_SHARED,
+- dev_name(dev), host);
+- if (ret)
+- goto free_host;
+-
+ if (priv->caps & UNIPHIER_SD_CAP_EXTENDED_IP)
+ host->dma_ops = &uniphier_sd_internal_dma_ops;
+ else
+@@ -642,8 +637,15 @@ static int uniphier_sd_probe(struct plat
+ if (ret)
+ goto free_host;
+
++ ret = devm_request_irq(dev, irq, tmio_mmc_irq, IRQF_SHARED,
++ dev_name(dev), host);
++ if (ret)
++ goto remove_host;
++
+ return 0;
+
++remove_host:
++ tmio_mmc_host_remove(host);
+ free_host:
+ tmio_mmc_host_free(host);
+
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-sdhci-of-at91-fix-calcr-register-being-rewritten.patch
+mmc-mmci_sdmmc-fix-dma-api-warning-overlapping-mappings.patch
+mmc-tmio-further-fixup-runtime-pm-management-at-remove.patch
+mmc-uniphier-sd-call-devm_request_irq-after-tmio_mmc_host_probe.patch
+arm-dts-at91-sama5d2_ptc_ek-fix-sdmmc0-node-description.patch
+mmc-sdio-fix-potential-null-pointer-error-in-mmc_sdio_init_card.patch
+mmc-sdio-fix-several-potential-memory-leaks-in-mmc_sdio_init_card.patch
+block-floppy-fix-contended-case-in-floppy_queue_rq.patch