From: Paul Menzel <pmenzel@molgen.mpg.de>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Saranya Gopal <saranya.gopal@intel.com>,
Rajaram Regupathy <rajaram.regupathy@intel.com>
Cc: Dell.Client.Kernel@dell.com, Paul Menzel <pmenzel@molgen.mpg.de>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] usb: typec: ucsi: Ignore PD capabilities not starting with vSafe5V
Date: Tue, 1 Dec 2026 22:04:00 +0100 [thread overview]
Message-ID: <20261201210400.229743-2-pmenzel@molgen.mpg.de> (raw)
On the Dell XPS 13 9310 (system firmware/BIOS 3.17.0, 3.37.0) and the Dell
XPS 9315 (BIOS 1.26.0), the PPM answers GET_PDOS for the connectors’ own
Source Capabilities on both ports with a single, invalid PDO 0x912c2aa8,
independent of whether a partner is attached. It decodes as a Variable
Supply with a minimum voltage above its maximum, which is exported
unchanged:
$ grep -r . /sys/class/usb_power_delivery/pd0/source-capabilities/1:variable_supply/
…/maximum_current:6800mA
…/maximum_voltage:13700mV
…/minimum_voltage:38900mV
The ports actually offer 5 V at 3 A. A Samsung Galaxy Tab A requested
3 A from PDO 1 (RDO 0x1304b12c in GET_CONNECTOR_STATUS), and the PDO’s
upper half 0x912c equals the lower half of a 5 V/3 A Fixed Supply PDO.
The ACPI _DSM only copies the EC’s message bytes 0x90–0x9f, so the
value comes from the embedded controller firmware.
The USB PD specification requires the first PDO of Source and Sink
Capabilities to be a vSafe5V Fixed Supply PDO, which tcpm also checks
in tcpm_caps_err(). Apply that check in ucsi_get_pd_caps(), and report
the firmware bug instead of registering such capabilities. All-zero
responses are left alone, as before.
With the change, on the Dell XPS 13 9310:
ucsi_acpi USBC000:00: [Firmware Bug]: con1: port source PDO 1 is not vSafe5V (0x912c2aa8), ignoring
ucsi_acpi USBC000:00: [Firmware Bug]: con2: port source PDO 1 is not vSafe5V (0x912c2aa8), ignoring
The port’s sink capabilities and the partner capabilities of the
attached 45 W Dell adapter are registered as before.
Fixes: b04e1747fbcc ("usb: typec: ucsi: Register USB Power Delivery Capabilities")
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
Notes:
Detected by and analyzed with claude-opus-5.5.
drivers/usb/typec/ucsi/ucsi.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 9e453d216c169..def62cd981624 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -937,6 +937,20 @@ static struct usb_power_delivery_capabilities *ucsi_get_pd_caps(struct ucsi_conn
if (ret <= 0)
return ERR_PTR(ret);
+ /*
+ * USB PD requires Source and Sink Capabilities to start with a vSafe5V
+ * Fixed Supply PDO. Do not expose a list that does not.
+ */
+ if (pd_caps.pdo[0] &&
+ (pdo_type(pd_caps.pdo[0]) != PDO_TYPE_FIXED ||
+ pdo_fixed_voltage(pd_caps.pdo[0]) != VSAFE5V)) {
+ dev_warn(con->ucsi->dev,
+ FW_BUG "con%d: %s %s PDO 1 is not vSafe5V (0x%08x), ignoring\n",
+ con->num, is_partner ? "partner" : "port",
+ is_source(role) ? "source" : "sink", pd_caps.pdo[0]);
+ return NULL;
+ }
+
if (ret < PDO_MAX_OBJECTS)
pd_caps.pdo[ret] = 0;
--
2.54.0
reply other threads:[~2026-12-01 21:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261201210400.229743-2-pmenzel@molgen.mpg.de \
--to=pmenzel@molgen.mpg.de \
--cc=Dell.Client.Kernel@dell.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rajaram.regupathy@intel.com \
--cc=saranya.gopal@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®