Skip to content

Commit 89dd87a

Browse files
Can Guomartinkpetersen
Can Guo
authored andcommitted
scsi: ufs: ufs-qcom: Fix race conditions caused by ufs_qcom_testbus_config()
If ufs_qcom_dump_dbg_regs() calls ufs_qcom_testbus_config() from ufshcd_suspend/resume and/or clk gate/ungate context, pm_runtime_get_sync() and ufshcd_hold() will cause a race condition. Fix this by removing the unnecessary calls of pm_runtime_get_sync() and ufshcd_hold(). Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hongwu Su <[email protected]> Reviewed-by: Avri Altman <[email protected]> Reviewed-by: Bean Huo <[email protected]> Reviewed-by: Asutosh Das <[email protected]> Signed-off-by: Can Guo <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 2dec947 commit 89dd87a

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

drivers/scsi/ufs/ufs-qcom.c

-5
Original file line numberDiff line numberDiff line change
@@ -1614,9 +1614,6 @@ int ufs_qcom_testbus_config(struct ufs_qcom_host *host)
16141614
*/
16151615
}
16161616
mask <<= offset;
1617-
1618-
pm_runtime_get_sync(host->hba->dev);
1619-
ufshcd_hold(host->hba, false);
16201617
ufshcd_rmwl(host->hba, TEST_BUS_SEL,
16211618
(u32)host->testbus.select_major << 19,
16221619
REG_UFS_CFG1);
@@ -1629,8 +1626,6 @@ int ufs_qcom_testbus_config(struct ufs_qcom_host *host)
16291626
* committed before returning.
16301627
*/
16311628
mb();
1632-
ufshcd_release(host->hba);
1633-
pm_runtime_put_sync(host->hba->dev);
16341629

16351630
return 0;
16361631
}

0 commit comments

Comments
 (0)