Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
* [PATCH 00/13] mmc: Assorted bug fixes across MMC host drivers
@ 2026-11-23 19:15 Lee Jones
  2026-11-23 19:15 ` [PATCH 08/13] mmc: omap: Shut down cover timer before disabling cover BH work Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Lee Jones @ 2026-11-23 19:15 UTC (permalink / raw)
  To: lee
  Cc: linux-kernel, Michał Mirosław, Niklas Söderlund,
	Uwe Kleine-König (The Capable Hub), Aaro Koskinen,
	Adrian Hunter, Aidan MacDonald, Al Cooper, Alex Dubov, Allen Pais,
	Apelete Seketeli, Aubin Constans, Binbin Zhou,
	Broadcom internal kernel review list, Cavium Inc,
	Christian Loehle, Florian Fainelli, Geert Uytterhoeven,
	Georgi Djakov, Guangshuo Li, Heiner Kallweit, Hiroshi DOYU,
	Huacai Chen, Jaehoon Chung, Jan Glauber, Jarkko Lavinen,
	Jerome Brunet, Josua Mayer, Juha Yrjola, Kamal Dasu, Kevin Hilman,
	Krzysztof Kozlowski, Lad Prabhakar, Lars-Peter Clausen,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, linux-mips,
	linux-mmc, linux-omap, linux-renesas-soc, Martin Blumenstingl,
	Neil Armstrong, Paul Cercueil, Phil Blundell, Pierre Ossman,
	Pramod Gurav, Ritesh Harjani, Robert Richter, Samuel Ortiz,
	Shawn Lin, Tony Lindgren, Ulf Hansson, Wolfram Sang,
	Yoshihiro Shimoda

These issues were reported by Sashiko.

None of these changes have been tested on physical hardware.

Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Cc: Al Cooper <alcooperx@gmail.com>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: Allen Pais <allen.lkml@gmail.com>
Cc: Apelete Seketeli <apelete@seketeli.net>
Cc: Aubin Constans <aubin.constans@microchip.com>
Cc: Binbin Zhou <zhoubinbin@loongson.cn>
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
Cc: Cavium Inc <support@cavium.com>
Cc: Christian Loehle <christian.loehle@arm.com>
Cc: Florian Fainelli <florian.fainelli@broadcom.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Georgi Djakov <djakov@kernel.org>
Cc: Guangshuo Li <lgs201920130244@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Jan Glauber <jan.glauber@gmail.com>
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Josua Mayer <josua@solid-run.com>
Cc: Juha Yrjola <juha.yrjola@nokia.com>
Cc: Kamal Dasu <kamal.dasu@broadcom.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Cc: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mips@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Phil Blundell <pb@handhelds.org>
Cc: Pierre Ossman <drzeus@drzeus.cx>
Cc: Pramod Gurav <pramod.gurav@linaro.org>
Cc: Ritesh Harjani <riteshh@codeaurora.org>
Cc: Robert Richter <rric@kernel.org>
Cc: Samuel Ortiz <sameo@openedhand.com>
Cc: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Ulf Hansson <ulfh@kernel.org>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Lee Jones (13):
  mmc: cavium: Remove MMC slots before destroying slot platform devices
  mmc: cavium: Prevent slot_pdev[] out-of-bounds write during probe
  mmc: sdhci-msm: Resume runtime PM before accessing registers on remove
  mmc: meson-gx: Fail request when descriptor chain DMA mapping fails
  mmc: jz4740: Skip DMA cleanup in PIO mode during post_req
  mmc: renesas_sdhi: Guard host->cmd access in internal DMAC issue work
  mmc: tifm_sd: Synchronise timeout handler with request completion
  mmc: omap: Shut down cover timer before disabling cover BH work
  mmc: renesas_sdhi: Disable internal DMAC BH work items on release
  mmc: jz4740: Apply DMA max_seg_size limit to unified tx-rx channel
  mmc: dw_mmc: Disarm central watchdog when ending a request
  mmc: renesas_sdhi: Fix SDIO manual tap correction in SDR104 mode
  mmc: sdhci-brcmstb: Handle absent optional sdio_freq clock in probe

 drivers/mmc/host/cavium-octeon.c              | 17 +++++++++++++----
 drivers/mmc/host/cavium-thunderx.c            | 15 +++++++++++++--
 drivers/mmc/host/dw_mmc.c                     | 14 +++++++++++---
 drivers/mmc/host/jz4740_mmc.c                 |  6 +++++-
 drivers/mmc/host/meson-gx-mmc.c               |  7 +++++++
 drivers/mmc/host/omap.c                       |  8 ++++----
 drivers/mmc/host/renesas_sdhi_core.c          |  9 ++++-----
 drivers/mmc/host/renesas_sdhi_internal_dmac.c | 13 +++++++++++++
 drivers/mmc/host/sdhci-brcmstb.c              |  6 ++++--
 drivers/mmc/host/sdhci-msm.c                  |  8 ++++----
 drivers/mmc/host/tifm_sd.c                    | 16 ++++++++++++++--
 11 files changed, 92 insertions(+), 27 deletions(-)

-- 
2.56.1.750.gf70dc682cf-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 08/13] mmc: omap: Shut down cover timer before disabling cover BH work
  2026-11-23 19:15 [PATCH 00/13] mmc: Assorted bug fixes across MMC host drivers Lee Jones
@ 2026-11-23 19:15 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2026-11-23 19:15 UTC (permalink / raw)
  To: lee, Aaro Koskinen, Ulf Hansson, Juha Yrjola, Tony Lindgren,
	Hiroshi DOYU, Jarkko Lavinen, Pierre Ossman, Aubin Constans,
	Michał Mirosław, Allen Pais, Christian Loehle,
	linux-omap, linux-mmc, linux-kernel
  Cc: stable

In mmc_omap_remove_slot(), cancel_work_sync(&slot->cover_bh_work) is
called before timer_delete_sync(&slot->cover_timer).  Because
mmc_omap_cover_timer() queues slot->cover_bh_work and
mmc_omap_cover_bh_handler() rearms slot->cover_timer, a timer expiry
between the two calls (or a concurrent omap_mmc_notify_cover_event()
before platform cleanup) can re-queue cover_bh_work so that it runs
after the slot and its struct mmc_host have been freed.

When cover state polling is configured, shut down slot->cover_timer
first with timer_shutdown_sync() to prevent re-arming, and then stop
slot->cover_bh_work with disable_work_sync() so no further work can be
queued during teardown.

Fixes: 7584d276d47a ("MMC: OMAP: Use tasklet instead of workqueue for cover switch notification")
Fixes: 921c87ba3893 ("mmc: Convert from tasklet to BH workqueue")
Closes: https://sashiko.dev/#/bug/linux-f30b1077-ed4d-4d62-a07b-11fff78d42c5
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/mmc/host/omap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 36df578298c3..55efc4ec9d03 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1356,11 +1356,11 @@ static void mmc_omap_remove_slot(struct mmc_omap_slot *slot)
 
 	if (slot->pdata->name != NULL)
 		device_remove_file(&mmc->class_dev, &dev_attr_slot_name);
-	if (slot->pdata->get_cover_state != NULL)
+	if (slot->pdata->get_cover_state) {
 		device_remove_file(&mmc->class_dev, &dev_attr_cover_switch);
-
-	cancel_work_sync(&slot->cover_bh_work);
-	timer_delete_sync(&slot->cover_timer);
+		timer_shutdown_sync(&slot->cover_timer);
+		disable_work_sync(&slot->cover_bh_work);
+	}
 	flush_workqueue(slot->host->mmc_omap_wq);
 
 	mmc_remove_host(mmc);
-- 
2.56.1.750.gf70dc682cf-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-23 19:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 19:15 [PATCH 00/13] mmc: Assorted bug fixes across MMC host drivers Lee Jones
2026-11-23 19:15 ` [PATCH 08/13] mmc: omap: Shut down cover timer before disabling cover BH work Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox