All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] usb: typec: ucsi: acpi: Add DMI quirk for Dell XPS platforms
@ 2026-09-11 13:28 Heikki Krogerus
  2026-09-12 13:12 ` Manuel Knitza
  0 siblings, 1 reply; 2+ messages in thread
From: Heikki Krogerus @ 2026-09-11 13:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Manuel Knitza; +Cc: linux-usb

On Dell XPS systems, the UCSI firmware incorrectly reports duplicate
or extra DisplayPort and Thunderbolt alternate mode entries with
conflicting and malformed VDOs when querying alternate mode details.
This causes the kernel to retain an invalid VDO descriptor, breaking
DisplayPort Alternate Mode functionality during hotplug events.

Work around this issue by clearing the UCSI_CAP_ALT_MODE_DETAILS
feature flag in a DMI quirk matching Dell XPS platforms so that the
driver does not attempt to register alternate modes on these systems.

Reported-by: Manuel Knitza <manuel.knitza@googlemail.com>
Closes: https://lore.kernel.org/linux-usb/CAMRbua4xZfsQ0FXsrfq=SCbyZa1n=Aw5UrD3bEaU41d+J3KmXw@mail.gmail.com/
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
Hi,

This has to be tested, I'm "guessing" the DMI match.
Manuel, can you test this?

Thanks,

---
 drivers/usb/typec/ucsi/ucsi_acpi.c | 41 ++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c
index 18286d3e9cc59..58cdc07a095eb 100644
--- a/drivers/usb/typec/ucsi/ucsi_acpi.c
+++ b/drivers/usb/typec/ucsi/ucsi_acpi.c
@@ -161,6 +161,39 @@ static const struct ucsi_operations ucsi_gram_ops = {
 	.async_control = ucsi_acpi_async_control
 };
 
+static int ucsi_dell_sync_control(struct ucsi *ucsi, u64 command, u32 *cci,
+				  void *val, size_t len, void *msg_out,
+				  size_t msg_out_size)
+{
+	int ret;
+
+	ret = ucsi_sync_control_common(ucsi, command, cci, val, len,
+				       msg_out, msg_out_size);
+	if (ret < 0)
+		return ret;
+
+	if (UCSI_COMMAND(command) == UCSI_GET_CAPABILITY && val) {
+		struct ucsi_capability *cap = val;
+
+		if (cap->features & UCSI_CAP_ALT_MODE_DETAILS) {
+			dev_warn(ucsi->dev,
+				 "Firmware bug: broken altmode details reporting, disabling\n");
+			cap->features &= ~UCSI_CAP_ALT_MODE_DETAILS;
+		}
+	}
+
+	return ret;
+}
+
+static const struct ucsi_operations ucsi_dell_ops = {
+	.read_version = ucsi_acpi_read_version,
+	.read_cci = ucsi_acpi_read_cci,
+	.poll_cci = ucsi_acpi_poll_cci,
+	.read_message_in = ucsi_acpi_read_message_in,
+	.sync_control = ucsi_dell_sync_control,
+	.async_control = ucsi_acpi_async_control
+};
+
 static const struct dmi_system_id ucsi_acpi_quirks[] = {
 	{
 		.matches = {
@@ -170,6 +203,14 @@ static const struct dmi_system_id ucsi_acpi_quirks[] = {
 		},
 		.driver_data = (void *)&ucsi_gram_ops,
 	},
+	{
+		.ident = "Dell XPS",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "XPS"),
+		},
+		.driver_data = (void *)&ucsi_dell_ops,
+	},
 	{ }
 };
 
-- 
2.50.1


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

end of thread, other threads:[~2026-09-12 13:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11 13:28 [PATCH v1] usb: typec: ucsi: acpi: Add DMI quirk for Dell XPS platforms Heikki Krogerus
2026-09-12 13:12 ` Manuel Knitza

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.