Skip to content

Commit 3be60b5

Browse files
Jeffrey Hugomartinkpetersen
authored andcommitted
scsi: ufs-qcom: Fix scheduling while atomic issue
ufs_qcom_dump_dbg_regs() uses usleep_range, a sleeping function, but can be called from atomic context in the following flow: ufshcd_intr -> ufshcd_sl_intr -> ufshcd_check_errors -> ufshcd_print_host_regs -> ufshcd_vops_dbg_register_dump -> ufs_qcom_dump_dbg_regs This causes a boot crash on the Lenovo Miix 630 when the interrupt is handled on the idle thread. Fix the issue by switching to udelay(). Link: https://lore.kernel.org/r/[email protected] Fixes: 9c46b86 ("scsi: ufs-qcom: dump additional testbus registers") Reviewed-by: Bean Huo <[email protected]> Reviewed-by: Avri Altman <[email protected]> Signed-off-by: Jeffrey Hugo <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent f56577e commit 3be60b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/scsi/ufs/ufs-qcom.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,11 +1658,11 @@ static void ufs_qcom_dump_dbg_regs(struct ufs_hba *hba)
16581658

16591659
/* sleep a bit intermittently as we are dumping too much data */
16601660
ufs_qcom_print_hw_debug_reg_all(hba, NULL, ufs_qcom_dump_regs_wrapper);
1661-
usleep_range(1000, 1100);
1661+
udelay(1000);
16621662
ufs_qcom_testbus_read(hba);
1663-
usleep_range(1000, 1100);
1663+
udelay(1000);
16641664
ufs_qcom_print_unipro_testbus(hba);
1665-
usleep_range(1000, 1100);
1665+
udelay(1000);
16661666
}
16671667

16681668
/**

0 commit comments

Comments
 (0)