From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=141.14.17.11 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796159174; b=DpyAoBwnH5cXmVNg9cJL2i7wzBFIiqrJMM3FE8m68GHhMFBzj79HUCHHMn+ISkFBtMrL Q23C9q8ZUlwmZfEgLO4/NyA40wwr1Svc7rkE1zd8GuMsXpeSVCAfVGBoDj396P6nQv/H7 YWtwE0CdGLgGrGVlRxESnJgon8kPbh1FamXqMI4eQKEzTo9YV6t/uC523f9YVUE6wahCJ JHt9XeI+wEumz7KcREO5Io/4YANwgcEtqSUIbswSysmWTq5A1dyHutrwGI/WBLLsv7y1W 4gNlZjvEkAHJ7bD1idVDrKAmaZFFD4eO1O9AaTdvLK1aMKLcNTa9jVaaWe6fggURr3A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796159174; h=DMARC-Filter:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding:DKIM-Signature; bh=i9aEuf4zVaZeW7Itl8Sw3YXyrMuG4cMi0LWIkAluxhM=; b=jwsGXGFwcShVZ07srLUHHCO+DQqYtx3pgCYrgHPAL6umTZb8/KT42iNKOvseNAP/0NDI c8x/UEjWEL7vs0BTYeBL3Yk1XUTGStfReDNUOPt9uLUVqWjZHRtYF1Dlc6LuZDHfGRQBC poHYH1WvNw7XTtW3KurnjHCeJqZZ9Mbm52M9BuDcJaeg+vsxXiY55Us48gQo9+u2HS+z5 ui3ldBA5VfEvY+8GXGeyoxXY08pJmhXN/46sYNteFt3k+7hTNnoXuJdR+AJ2T9Q7uWOLo xMS8S7LswLy1Oheo1GgSOFzh0DYQ5hRnBkUu6aFzMFQOayH2+8epbKHVIm9nruj/hVg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=molgen.mpg.de; spf=pass smtp.mailfrom=molgen.mpg.de; dkim=pass header.d=molgen.mpg.de header.i=@molgen.mpg.de header.a=rsa-sha256 header.s=20260906 header.b=qkvZgVyM; arc=none smtp.remote-ip=141.14.17.11 Received: from mx3.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 500C3606A33A; Tue, 1 Dec 2026 21:06:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 500C3606A33A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=molgen.mpg.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=molgen.mpg.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=molgen.mpg.de header.i=@molgen.mpg.de header.a=rsa-sha256 header.s=20260906 header.b=qkvZgVyM Received: from abreu.speedport.ip (p57bd904d.dip0.t-ipconnect.de [87.189.144.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id C9C5C4C2C90B4C; Tue, 01 Dec 2026 22:05:25 +0100 (CET) From: Paul Menzel To: Heikki Krogerus , Greg Kroah-Hartman , Saranya Gopal , Rajaram Regupathy Cc: Dell.Client.Kernel@dell.com, Paul Menzel , 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 Message-ID: <20261201210400.229743-2-pmenzel@molgen.mpg.de> X-Mailer: git-send-email 2.55.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=molgen.mpg.de; s=20260906; t=1796159126; h=from:from:subject:date:message-id:mime-version:content-type:content-transfer-encoding; bh=i9aEuf4zVaZeW7Itl8Sw3YXyrMuG4cMi0LWIkAluxhM=; b=qkvZgVyMjsOGEV9hNvra53De5PJvK1PQuxv3DKKc1Y9n+C+p3Sq+LqEo1TQibBACqhsMntqKcBji zbXZNgqb46sjweV+29YE98ms4tE/hJsnCK16WERcaZxJmtZH/qW9L2/EULH/pOYMOYEEv/JCaV/7a2 YfJ2T2AiooI0rcXgDpu6UGO6HusiyvxA5VNRLt4Idaw4ENljcJz0O+1Nw400kFtUFE++OBkZot/lee 9k6g4xdTXdHxSosZrpGCyNslKfjRrZMxqplCiib/cfuQI+yzhyoKg3YkND2Zl5mhjt0tgjcgB7n+Nb eRqCzBlxTAM8pA7bS+pEoTqES8EYqVDQ== 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 --- 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