diff options
| author | Karl Mehltretter <kmehltretter@gmail.com> | 2026-07-22 05:44:35 +0200 |
|---|---|---|
| committer | Denis Efremov (Oracle) <efremov@linux.com> | 2026-10-05 18:02:28 +0400 |
| commit | 74c2e2eeb7e51cdeb5e3eceaf324cfcf8dcd0d32 (patch) | |
| tree | 531d4dc10c883ad2102663115957cd81ec1ec4cf | |
| parent | 9690943353cec1690a715e000ba6a74e5139f530 (diff) | |
floppy: flush pending work before releasing resources on init failure
do_floppy_init() probes each FDC with user_reset_fdc(), which queues a
redo_fd_request() work item on floppy_wq that may still be pending when
the probe finishes. When no controller is found, the error path calls
floppy_release_irq_and_dma() to free the IRQ and DMA channel, and only
later destroys the workqueue. destroy_workqueue() drains the queued work
last, so it can run after the IRQ and DMA are already gone:
floppy0: no floppy controllers found
work still pending
The flush used to be here. Commit 070ad7e793dc ("floppy: convert to
delayed work and single-thread wq") renamed the label out_flush_work to
out_release_dma and dropped it. Restore it so the work drains before the
IRQ and DMA are released, as floppy_module_exit() already does.
Fixes: 070ad7e793dc ("floppy: convert to delayed work and single-thread wq")
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260722034435.13432-1-kmehltretter@gmail.com
Signed-off-by: Denis Efremov (Oracle) <efremov@linux.com>
| -rw-r--r-- | drivers/block/floppy.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index f04397b8e381..6cfd114d27df 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4744,6 +4744,8 @@ out_remove_drives: } } out_release_dma: + /* Drain the queued redo_fd_request() before releasing IRQ and DMA. */ + flush_workqueue(floppy_wq); if (atomic_read(&usage_count)) floppy_release_irq_and_dma(); out_unreg_driver: |
