summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCan Guo <can.guo@oss.qualcomm.com>2026-05-01 06:16:40 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2026-05-22 21:14:59 -0400
commit8933fa6695aaea6559d3469581139a4c1f427369 (patch)
treea6b9cddba4dfe4dd4bbcc18673b59c6f576e0cb6
parent09be9d404f42fd2e7d4d378cae07499879f837f4 (diff)
scsi: ufs: core: Add a quirk for extended TX EQTR Adapt L0L1L2L3 length
Add a quirk to support TX Equalization Training (EQTR) using Adapt L0L1L2L3 length which is larger than what is allowed by M-PHY spec ver 6.0. Signed-off-by: Can Guo <can.guo@oss.qualcomm.com> Reviewed-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Peter Wang <peter.wang@mediatek.com> Reviewed-by: Ziqi Chen <ziqi.chen@oss.qualcomm.com> Link: https://patch.msgid.link/20260501131641.826258-2-can.guo@oss.qualcomm.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/ufs/core/ufs-txeq.c8
-rw-r--r--include/ufs/ufshcd.h7
2 files changed, 13 insertions, 2 deletions
diff --git a/drivers/ufs/core/ufs-txeq.c b/drivers/ufs/core/ufs-txeq.c
index 4b264adfdf49..aa64f2bf4f1e 100644
--- a/drivers/ufs/core/ufs-txeq.c
+++ b/drivers/ufs/core/ufs-txeq.c
@@ -885,7 +885,9 @@ static int ufshcd_setup_tx_eqtr_adapt_length(struct ufs_hba *hba,
if (adapt_l0l1l2l3_cap_local > ADAPT_L0L1L2L3_LENGTH_MAX) {
dev_err(hba->dev, "local RX_HS_G%u_ADAPT_INITIAL_L0L1L2L3_CAP (0x%x) exceeds MAX\n",
gear, adapt_l0l1l2l3_cap_local);
- return -EINVAL;
+
+ if (!(hba->quirks & UFSHCD_QUIRK_EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3))
+ return -EINVAL;
}
ret = ufshcd_dme_get(hba, UIC_ARG_MIB(PA_PEERRXHSG6ADAPTINITIALL0L1L2L3),
@@ -896,7 +898,9 @@ static int ufshcd_setup_tx_eqtr_adapt_length(struct ufs_hba *hba,
if (adapt_l0l1l2l3_cap_peer > ADAPT_L0L1L2L3_LENGTH_MAX) {
dev_err(hba->dev, "peer RX_HS_G%u_ADAPT_INITIAL_L0L1L2L3_CAP (0x%x) exceeds MAX\n",
gear, adapt_l0l1l2l3_cap_peer);
- return -EINVAL;
+
+ if (!(hba->quirks & UFSHCD_QUIRK_EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3))
+ return -EINVAL;
}
t_adapt_l0l1l2l3_local = adapt_cap_to_t_adapt_l0l1l2l3(adapt_l0l1l2l3_cap_local);
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index f48d6416e299..3eaae082329c 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -806,6 +806,13 @@ enum ufshcd_quirks {
* delay after enabling VCC to ensure it's stable.
*/
UFSHCD_QUIRK_VCC_ON_DELAY = 1 << 27,
+
+ /*
+ * This quirk indicates that Host supports TX Equalization Training
+ * (EQTR) using Adapt L0L1L2L3 length which is larger than what is
+ * allowed by M-PHY spec ver 6.0.
+ */
+ UFSHCD_QUIRK_EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3 = 1 << 28,
};
enum ufshcd_caps {