Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: r852: prevent card work from being requeued during shutdown
@ 2026-11-08 21:04 James Hilliard
  2026-11-08 21:15 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: James Hilliard @ 2026-11-08 21:04 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Maxim Levitsky
  Cc: linux-mtd, linux-kernel, David Woodhouse, stable, James Hilliard

The card interrupt can queue card_detect_work after shutdown cancels it
but before interrupts are disabled. The worker can then access the
controller after pci_disable_device(), and can enable card interrupts
again while processing the event.

Disable and drain the delayed work before turning off interrupts and the
PCI device. Later queue attempts are rejected while the IRQ handler can
still acknowledge events until interrupt teardown completes.

Fixes: 67e054e91924 ("mtd: nand: Add driver for Ricoh xD/SmartMedia reader")
Cc: stable@vger.kernel.org
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 drivers/mtd/nand/raw/r852.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/r852.c b/drivers/mtd/nand/raw/r852.c
index 92c47d351c27..bf1c1be7f2aa 100644
--- a/drivers/mtd/nand/raw/r852.c
+++ b/drivers/mtd/nand/raw/r852.c
@@ -1007,7 +1007,7 @@ static void r852_shutdown(struct pci_dev *pci_dev)
 {
 	struct r852_device *dev = pci_get_drvdata(pci_dev);
 
-	cancel_delayed_work_sync(&dev->card_detect_work);
+	disable_delayed_work_sync(&dev->card_detect_work);
 	r852_disable_irqs(dev);
 	synchronize_irq(dev->irq);
 	pci_disable_device(pci_dev);

---
base-commit: 30daaf3e7897b4a8d9b72e5b0c86dd6e2a4d7d85
change-id: 20261107-submit-r852-shutdown-work-v1-15fe04537064

Best regards,
--  
James Hilliard <james.hilliard1@gmail.com>


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2026-11-08 21:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-08 21:04 [PATCH] mtd: rawnand: r852: prevent card work from being requeued during shutdown James Hilliard
2026-11-08 21:15 ` sashiko-bot

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