]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
scsi: ufs-qcom: Fix scheduling while atomic issue
authorJeffrey Hugo <jeffrey.l.hugo@gmail.com>
Mon, 25 May 2020 20:41:25 +0000 (13:41 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
commitdd24de36c52efa5e3633e23631019298e034bebd
treefdd0ec789d94f7104ee637939ba2bf3a0697296c
parent14c21557bb4c1cf07fa91a3ca5623448f5651579
scsi: ufs-qcom: Fix scheduling while atomic issue

BugLink: https://bugs.launchpad.net/bugs/1885322
[ Upstream commit 3be60b564de49875e47974c37fabced893cd0931 ]

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/20200525204125.46171-1-jeffrey.l.hugo@gmail.com
Fixes: 9c46b8676271 ("scsi: ufs-qcom: dump additional testbus registers")
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/scsi/ufs/ufs-qcom.c