mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH V2] scsi: ufs: ufs-qcom: add fixup_dev_quirks vops
@ 2024-08-28 13:40 Manish Pandey
  2024-08-28 14:08 ` Manivannan Sadhasivam
  0 siblings, 1 reply; 3+ messages in thread
From: Manish Pandey @ 2024-08-28 13:40 UTC (permalink / raw)
  To: Manivannan Sadhasivam, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-arm-msm, linux-scsi, linux-kernel, quic_nitirawa,
	quic_bhaskarv, quic_narepall, quic_rampraka, quic_mapa,
	quic_cang, quic_nguyenb

Add fixup_dev_quirk vops in QCOM UFS platforms and provide an initial
vendor-specific device quirk table to add UFS device specific quirks
which are enabled only for specified UFS devices.

Micron and Skhynix UFS device needs DELAY_BEFORE_LPM quirk to have a
delay before VCC is powered off.

Toshiba UFS devices require delay after VCC power rail is turned-off
in QCOM platforms. Hence add Toshiba vendor ID and DELAY_AFTER_LPM
quirk for Toshiba UFS devices in QCOM platforms.

Signed-off-by: Manish Pandey <quic_mapa@quicinc.com>
---
 drivers/ufs/host/ufs-qcom.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 810e637047d0..9dbfbe643e5e 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -834,6 +834,25 @@ static int ufs_qcom_apply_dev_quirks(struct ufs_hba *hba)
 	return err;
 }
 
+/* UFS device-specific quirks */
+static struct ufs_dev_quirk ufs_qcom_dev_fixups[] = {
+	{ .wmanufacturerid = UFS_VENDOR_MICRON,
+	  .model = UFS_ANY_MODEL,
+	  .quirk = UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM },
+	{ .wmanufacturerid = UFS_VENDOR_SKHYNIX,
+	  .model = UFS_ANY_MODEL,
+	  .quirk = UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM },
+	{ .wmanufacturerid = UFS_VENDOR_TOSHIBA,
+	  .model = UFS_ANY_MODEL,
+	  .quirk = UFS_DEVICE_QUIRK_DELAY_AFTER_LPM },
+	{}
+};
+
+static void ufs_qcom_fixup_dev_quirks(struct ufs_hba *hba)
+{
+	ufshcd_fixup_dev_quirks(hba, ufs_qcom_dev_fixups);
+}
+
 static u32 ufs_qcom_get_ufs_hci_version(struct ufs_hba *hba)
 {
 	return ufshci_version(2, 0);
@@ -1798,6 +1817,7 @@ static const struct ufs_hba_variant_ops ufs_hba_qcom_vops = {
 	.link_startup_notify    = ufs_qcom_link_startup_notify,
 	.pwr_change_notify	= ufs_qcom_pwr_change_notify,
 	.apply_dev_quirks	= ufs_qcom_apply_dev_quirks,
+	.fixup_dev_quirks       = ufs_qcom_fixup_dev_quirks,
 	.suspend		= ufs_qcom_suspend,
 	.resume			= ufs_qcom_resume,
 	.dbg_register_dump	= ufs_qcom_dump_dbg_regs,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-03 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-28 13:40 [PATCH V2] scsi: ufs: ufs-qcom: add fixup_dev_quirks vops Manish Pandey
2024-08-28 14:08 ` Manivannan Sadhasivam
2024-09-03 13:18   ` MANISH PANDEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®