Skip to content

Commit f966e02

Browse files
ptr324martinkpetersen
authored andcommitted
scsi: ufs: core: Fix runtime suspend error deadlock
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. Signed-off-by: Peter Wang <peter.wang@mediatek.com> Suggested-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Message-Id: <20250926012940.3933367-1-peter.wang@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 285654d commit f966e02

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6673,6 +6673,14 @@ static void ufshcd_err_handler(struct work_struct *work)
66736673
}
66746674
spin_unlock_irqrestore(hba->host->host_lock, flags);
66756675

6676+
ufshcd_rpm_get_noresume(hba);
6677+
if (hba->pm_op_in_progress) {
6678+
ufshcd_link_recovery(hba);
6679+
ufshcd_rpm_put(hba);
6680+
return;
6681+
}
6682+
ufshcd_rpm_put(hba);
6683+
66766684
ufshcd_err_handling_prepare(hba);
66776685

66786686
spin_lock_irqsave(hba->host->host_lock, flags);

0 commit comments

Comments
 (0)