mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rapidio: tsi721: Cancel the self-rearming doorbell work on removal
@ 2026-10-11 19:33 Myeonghun Pak
  0 siblings, 0 replies; only message in thread
From: Myeonghun Pak @ 2026-10-11 19:33 UTC (permalink / raw)
  To: mporter, alex.bou9; +Cc: linux-kernel, ae878000

tsi721_db_dpc() schedules idb_work again when another doorbell arrives
while it is restoring the queue interrupt. flush_work() waits for the
instance that was queued at the start of the flush, but does not prevent
that instance from queuing a successor. Removal can therefore free the
doorbell buffer and device state with another instance still pending.

Use cancel_work_sync() after freeing the IRQs. At that point the external
producer has stopped, and synchronous cancellation also handles a worker
that rearms itself. The non-rearming port-write work can still be flushed.

This issue was found by static analysis.

Fixes: 3670e7e12e58 ("rapidio/tsi721: fix inbound doorbell interrupt handling")
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
Compile-tested with GCC, W=1 (arm). No runtime testing.

 drivers/rapidio/devices/tsi721.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index 71b87bf..2bae63e 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -2978,7 +2978,7 @@ static void tsi721_remove(struct pci_dev *pdev)
 
 	tsi721_disable_ints(priv);
 	tsi721_free_irq(priv);
-	flush_work(&priv->idb_work);
+	cancel_work_sync(&priv->idb_work);
 	flush_work(&priv->pw_work);
 	rio_unregister_mport(&priv->mport);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-11 19:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11 19:33 [PATCH] rapidio: tsi721: Cancel the self-rearming doorbell work on removal Myeonghun Pak

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

all inboxes | Powered by JetHome®