Skip to contentSkip to conversation

usb: typec: ucsi: acpi: Add DMI quirk for Dell XPS platforms

PATCH In review Heikki Krogerus 2 participants 2 messages Sep 11 – Sep 12

Subsystems (2)
lore
Share & tools
lore

Heikki Krogerus

author maintainer
#0 lore raw

PATCH 1/1 usb: typec: ucsi: acpi: Add DMI quirk for Dell XPS platforms

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.

---
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(+)
drivers/usb/typec/ucsi/ucsi_acpi.c +41 -0
index 18286d3e9cc59..58cdc07a095eb 100644
@@ -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,
+	},
 	{ }
 };
 
Signature · 1 line
2.50.1
Tested-by on v1 1/1
#1 lore raw

Tested on a Dell XPS 16 DA16260 (BIOS 1.10.1), which the DMI match hits ("Dell Inc." / "XPS 16 DA16260"). Unmodified patch built and loaded on 7.2.3-arch1-3: alt modes registered go 1 -> 0, the duplicate-altmode and VDO-mismatch warnings disappear, the new warning appears, all connectors still register, and a running DisplayPort link (5120x2160@60, HBR3, 4 lanes) is undisturbed by the module swap. The same change backported to the 5-argument sync_control signature behaves identically on 7.1.8.

Note it does not build on 7.1.x as-is - msg_out/msg_out_size only arrived in 7.2.

Details, and one caveat worth reading before this is taken as a fix, are in the bug thread:
https://lore.kernel.org/linux-usb/CAMRbua4oitgPgCXtWKTJa0_5AHbtzLV-47k=nCSP0Rq-Mhpx-w@mail.gmail.com/

Short form of the caveat: with the quirk active, DisplayPort still never comes back on hotplug or on resume. The quirk removes misleading data, it does not restore the function.

Am Fr., 11. Sept. 2026 um 15:28 Uhr schrieb Heikki Krogerus <[email protected]>:

Quoted 88 lines

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.

---
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(+)
drivers/usb/typec/ucsi/ucsi_acpi.c +41 -1
index 18286d3e9cc59..58cdc07a095eb 100644
@@ -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