ufs: core: Fix runtime suspend error deadlock
Subsystems (3)
PATCH v3 1/1 ufs: core: Fix runtime suspend error deadlock
From: Peter Wang <[email protected]>
Resolve the deadlock issue during runtime suspend when an error triggers the error handler. Prevent the deadlock by checking pm_op_in_progress and performing a quick recovery. This approach ensures that the error handler does not wait indefinitely for runtime PM to resume, allowing runtime suspend to proceed smoothly.
--- drivers/ufs/core/ufshcd.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/ufs/core/ufshcd.c +8 -0
@@ -6681,6 +6681,14 @@ static void ufshcd_err_handler(struct work_struct *work) }spin_unlock_irqrestore (hba->host->host_lock, flags); +ufshcd_rpm_get_noresume (hba); +if (hba->pm_op_in_progress) { +ufshcd_link_recovery (hba); +ufshcd_rpm_put (hba); +return ; + } +ufshcd_rpm_put (hba); +ufshcd_err_handling_prepare (hba);spin_lock_irqsave (hba->host->host_lock, flags);
Signature · 1 line
2.45.2
Martin K. Petersen
AppliedPeter,
Quoted 5 lines
Resolve the deadlock issue during runtime suspend when an error triggers the error handler. Prevent the deadlock by checking
pm_op_in_progressand performing a quick recovery. This approach ensures that the error handler does not wait indefinitely for runtime PM to resume, allowing runtime suspend to proceed smoothly.
Applied to 6.18/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen