Skip to content

Commit ea593e0

Browse files
Mani-Sadhasivammartinkpetersen
authored andcommitted
scsi: ufs: qcom: Add UFSHCD_QUIRK_BROKEN_LSDBS_CAP for SM8550 SoC
SM8550 SoC has the UFSHCI 4.0 compliant UFS controller and only supports legacy single doorbell mode without MCQ. But due to a hardware bug, it reports 1 in the 'Legacy Queue & Single Doorbell Support (LSDBS)' field of the Controller Capabilities register. This field is supposed to read as 0 if legacy single doorbell mode is supported and 1 otherwise. Starting with commit 0c60eb0 ("scsi: ufs: core: Check LSDBS cap when !mcq"), ufshcd driver is now relying on the LSDBS field to decide when to use the legacy doorbell mode if MCQ is not supported. And this ends up breaking UFS on SM8550: ufshcd-qcom 1d84000.ufs: ufshcd_init: failed to initialize (legacy doorbell mode not supported) ufshcd-qcom 1d84000.ufs: error -EINVAL: Initialization failed with error -22 So use the UFSHCD_QUIRK_BROKEN_LSDBS_CAP quirk for SM8550 SoC so that the ufshcd driver could use legacy doorbell mode correctly. Fixes: 0c60eb0 ("scsi: ufs: core: Check LSDBS cap when !mcq") Tested-by: Amit Pundir <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent cd06b71 commit ea593e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/ufs/host/ufs-qcom.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,9 @@ static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
857857

858858
if (host->hw_ver.major > 0x3)
859859
hba->quirks |= UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH;
860+
861+
if (of_device_is_compatible(hba->dev->of_node, "qcom,sm8550-ufshc"))
862+
hba->quirks |= UFSHCD_QUIRK_BROKEN_LSDBS_CAP;
860863
}
861864

862865
static void ufs_qcom_set_phy_gear(struct ufs_qcom_host *host)
@@ -1847,7 +1850,8 @@ static void ufs_qcom_remove(struct platform_device *pdev)
18471850
}
18481851

18491852
static const struct of_device_id ufs_qcom_of_match[] __maybe_unused = {
1850-
{ .compatible = "qcom,ufshc"},
1853+
{ .compatible = "qcom,ufshc" },
1854+
{ .compatible = "qcom,sm8550-ufshc" },
18511855
{},
18521856
};
18531857
MODULE_DEVICE_TABLE(of, ufs_qcom_of_match);

0 commit comments

Comments
 (0)