* [PATCH] bus: mhi: host: Shut down the health check timer on removal
@ 2026-10-11 18:51 Myeonghun Pak
0 siblings, 0 replies; only message in thread
From: Myeonghun Pak @ 2026-10-11 18:51 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: Jeff Hugo, mhi, linux-arm-msm, linux-kernel, Ijae Kim
The recovery worker rearms health_check_timer after a successful device
recovery. Deleting the timer before cancel_work_sync() does not prevent
an already running recovery worker from adding it again while removal
waits for that worker. The timer can then run after the controller and
the managed mhi_pci_device have been released.
Use timer_shutdown_sync() before cancelling recovery_work. This waits for
the timer callback and rejects subsequent rearming, including rearming
by the worker being cancelled. Keep the reversible timer deletion used
by suspend and reset paths.
This issue was found by static analysis.
Fixes: 8562d4fe34a3 ("mhi: pci_generic: Add health-check")
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/bus/mhi/host/pci_generic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
index b636e2c..f8de889 100644
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -1488,7 +1488,7 @@ static void mhi_pci_remove(struct pci_dev *pdev)
pci_disable_sriov(pdev);
if (!pdev->is_virtfn)
- timer_delete_sync(&mhi_pdev->health_check_timer);
+ timer_shutdown_sync(&mhi_pdev->health_check_timer);
cancel_work_sync(&mhi_pdev->recovery_work);
if (test_and_clear_bit(MHI_PCI_DEV_STARTED, &mhi_pdev->status)) {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-11 18:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11 18:51 [PATCH] bus: mhi: host: Shut down the health check timer 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®