Skip to content

Commit d9970c6

Browse files
ptr324opsiff
authored andcommitted
scsi: ufs: core: Fix another deadlock during RTC update
commit cb7e509 upstream. If ufshcd_rtc_work calls ufshcd_rpm_put_sync() and the pm's usage_count is 0, we will enter the runtime suspend callback. However, the runtime suspend callback will wait to flush ufshcd_rtc_work, causing a deadlock. Replace ufshcd_rpm_put_sync() with ufshcd_rpm_put() to avoid the deadlock. Fixes: 6bf999e ("scsi: ufs: core: Add UFS RTC support") Cc: stable@vger.kernel.org deepin-community#6.11.x Signed-off-by: Peter Wang <peter.wang@mediatek.com> Link: https://lore.kernel.org/r/20241024015453.21684-1-peter.wang@mediatek.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 9aa1f0d)
1 parent eaf249b commit d9970c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8182,7 +8182,7 @@ static void ufshcd_update_rtc(struct ufs_hba *hba)
81828182
ufshcd_rpm_get_sync(hba);
81838183
err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR, QUERY_ATTR_IDN_SECONDS_PASSED,
81848184
0, 0, &val);
8185-
ufshcd_rpm_put_sync(hba);
8185+
ufshcd_rpm_put(hba);
81868186

81878187
if (err)
81888188
dev_err(hba->dev, "%s: Failed to update rtc %d\n", __func__, err);

0 commit comments

Comments
 (0)