scsi: ufs-qcom: Fix scheduling while atomic issue
Subsystems (2)
PATCH 1/1 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().
--- drivers/scsi/ufs/ufs-qcom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/ufs/ufs-qcom.c +3 -3
@@ -1658,11 +1658,11 @@ static void ufs_qcom_dump_dbg_regs(struct ufs_hba *hba)/* sleep a bit intermittently as we are dumping too much data */ ufs_qcom_print_hw_debug_reg_all (hba,NULL , ufs_qcom_dump_regs_wrapper); -usleep_range (1000 ,1100 ); +udelay (1000 );ufs_qcom_testbus_read (hba); -usleep_range (1000 ,1100 ); +udelay (1000 );ufs_qcom_print_unipro_testbus (hba); -usleep_range (1000 ,1100 ); +udelay (1000 ); }/**
Signature · 1 line
2.17.1
Quoted 8 lines
ufs_qcom_dump_dbg_regs()usesusleep_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
Quoted 7 lines
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().Fixes 9c46b8676271 ("scsi: ufs-qcom: dump additional testbus registers")Signed-off-by Jeffrey Hugo <[email protected]>
Bean Huo
Reviewed-byQuoted 13 lines · Avri Altman
Quoted 13 lines
ufs_qcom_dump_dbg_regs()usesusleep_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_regsThis causes a boot crash on the Lenovo Miix 630 when the interrupt is
handled on the idle thread.
Quoted 7 lines
Quoted 5 lines
Fix the issue by switching to
udelay().Fixes 9c46b8676271 ("scsi: ufs-qcom: dump additional testbusregisters")
Signed-off-by Jeffrey Hugo <[email protected]>Reviewed-by Avri Altman <[email protected]>
Martin K. Petersen
AppliedQuoted 8 lines · Jeffrey Hugo
ufs_qcom_dump_dbg_regs()usesusleep_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[...]
Applied to 5.8/scsi-queue, thanks!
[1/1] scsi: ufs-qcom: Fix scheduling while atomic issue
https://git.kernel.org/mkp/scsi/c/3be60b564de4
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering