drivers/usb/typec/ucsi/ucsi.c | 4 ++++ drivers/usb/typec/ucsi/ucsi.h | 2 ++ drivers/usb/typec/ucsi/ucsi_glink.c | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-)
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Firmware on at least the Qualcomm X1E80100 SoC ignores the offset and
number fields of the GET_ALTERNATE_MODES command (with the recipient
set to SOP specifically), resulting in the UCSI core getting a payload
containing _all_ of the supported altmodes over and over and over again
(15 times 2 modes in total).
This leads to a number of 'already exists' splats from sysfs, as the
code tries to repeatedly register the same modes, with the same VDO and
SVIDs, most notably when connected to a TBT3 device that also supports
DP altmode.
Since this problem is isolated and the firmware can not really be
updated, work around it explicitly.
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
drivers/usb/typec/ucsi/ucsi.c | 4 ++++
drivers/usb/typec/ucsi/ucsi.h | 2 ++
drivers/usb/typec/ucsi/ucsi_glink.c | 4 +++-
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index f6bb88b1ccee..88107af5f27a 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -632,6 +632,10 @@ static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient)
if (ret)
return ret;
}
+
+ if (recipient == UCSI_RECIPIENT_SOP &&
+ con->ucsi->quirks & UCSI_REPEATING_SOP_ALTMODES)
+ return 0;
}
return 0;
diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
index cff9ddc2ae21..1dcf8343d00a 100644
--- a/drivers/usb/typec/ucsi/ucsi.h
+++ b/drivers/usb/typec/ucsi/ucsi.h
@@ -500,6 +500,8 @@ struct ucsi {
/* USB4 connection can imply that USB communcation is supported */
#define UCSI_USB4_IMPLIES_USB BIT(2)
+/* GET_ALTERNATE_MODES ignores OFFSET field for recipient == SOP */
+#define UCSI_REPEATING_SOP_ALTMODES BIT(3)
};
#define UCSI_MAX_DATA_LENGTH(u) (((u)->version < UCSI_VERSION_2_0) ? 0x10 : 0xff)
diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c
index 12e07b9fe622..358b69db71b7 100644
--- a/drivers/usb/typec/ucsi/ucsi_glink.c
+++ b/drivers/usb/typec/ucsi/ucsi_glink.c
@@ -371,7 +371,9 @@ static void pmic_glink_ucsi_destroy(void *data)
static unsigned long quirk_sc8180x = UCSI_NO_PARTNER_PDOS;
static unsigned long quirk_sc8280xp = UCSI_NO_PARTNER_PDOS | UCSI_DELAY_DEVICE_PDOS;
static unsigned long quirk_sm8450 = UCSI_DELAY_DEVICE_PDOS;
-static unsigned long quirk_x1e80100 = UCSI_DELAY_DEVICE_PDOS | UCSI_USB4_IMPLIES_USB;
+static unsigned long quirk_x1e80100 = UCSI_DELAY_DEVICE_PDOS |
+ UCSI_USB4_IMPLIES_USB |
+ UCSI_REPEATING_SOP_ALTMODES;
static const struct of_device_id pmic_glink_ucsi_of_quirks[] = {
{ .compatible = "qcom,glymur-pmic-glink", .data = &quirk_sm8450, },
---
base-commit: f3e6330d7fe42b204af05a2dbc68b379e0ad179e
change-id: 20260408-topic-repeating_sop_altmodes_x1-cf19cc381b42
Best regards,
--
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
© 2016 - 2026 Red Hat, Inc.