On 12/13/21 20:04, Bjorn Andersson wrote:
Can you please help me understand what I'm missing? Or how you tested
this?
Hi Bjorn,
Unfortunately I don't have access to a test setup with a Qualcomm
chipset. Please help verifying whether this patch is sufficient as a fix
(see also
https://lore.kernel.org/linux-scsi/101fa5ba-6d74-6c51-aaa2-e6c6d98f6bc7@xxxxxxx/):
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 6d692aae67ce..244eddf0caf8 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1084,7 +1084,9 @@ static u32 ufshcd_pending_cmds(struct ufs_hba *hba)
struct scsi_device *sdev;
u32 pending = 0;
- shost_for_each_device(sdev, hba->host)
+ lockdep_assert_held(hba->host->host_lock);
+
+ __shost_for_each_device(sdev, hba->host)
pending += sbitmap_weight(&sdev->budget_map);
return pending;
Thanks,
Bart.