From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.200 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796306427; b=Y3ulL2W0lF1jx/erPPEdU2ql6WMnqEWCX95N2RPmDsd2AbwWjYBUpUiiNtTTpwC/Aws8 xJF8YcBYMq8zUNSZxq/oM6twOPnzQvct5e2mVQKY/MW+Gq/yYnWYCpKaSx52qjoOhb5u0 4jeu3fxORMTCF3PtMk4t7JbcCeciwTvVfr8RCd2UZZLRAHN7QddRt3i1m7zCF8piblaq0 2Ot2oX+Jcew8FFMYer6nj8Pwtfday2MoyjSmMY0YGTYgj2e4jQa5FustQRYhoBQySmEE2 7M2z6F+DMM6kyAcm31NZU407O4bty0E7kTzMvFCsGjxXiLvaX6CfZ2/F8yqTuc8rBew== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796306427; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:Mime-Version: X-Mailer:Message-ID:Subject:From:To:Cc:Content-Type; bh=N8gbwl4d3ukOBMmx7xw6HDRVpTpdvhWYI7psgQGjayw=; b=dBe5WnOGUnhwNy30abINhWlF0gpZeWAHsVBlRRf3kMQAQnv4JpyCgZW1A2ykNSqR0cD+ 1AuywDHY1vk/7DjQwVmI+YRonIW30NOwOUSVxT5cOoZjH4zUxY9smc9y4kv4G8jvpzxrh gYzCgJBSlme/ImhChssp11TG/O3NLoV24M/j0StUdm7GsvUqOUfP0wtFQsbxyPAr1pE3D FbcjPLVH3naM8W1b4LUy2t0BwQuFI/LLsvwK2CFco/mCA1Vx6sR8MFl18sryc9g/ZQcxF cfppR3LglPzluTHhbRjgTCXxoxS4q/VeXVQvk67ItX6qvXVKjMRtpykyHgxGnPbiN3A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--kyletso.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b="S/Izod3D"; arc=none smtp.remote-ip=209.85.214.200 Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97A5A606A32D for ; Thu, 3 Dec 2026 14:00:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 97A5A606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--kyletso.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=S/Izod3D Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2f0578f1d51so166450745ad.3 for ; Thu, 03 Dec 2026 06:00:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796306426; x=1796911226; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=N8gbwl4d3ukOBMmx7xw6HDRVpTpdvhWYI7psgQGjayw=; b=S/Izod3DozbwLcRamt1R34Mn3FdY4d03eAmZvpAo8qx20Jbz+wtyNRjkISsnHlvT1M claQp3ds/aONQjm6lOmNH7LZWb7ShrElHK0O2fOlLA81w5atYOu399POBXd5vr7yji/Z MJiCyZzorDZcnDsdj0sqaKZK+BAVP9W4jQYIXVIeLvX5kmvGQlMA/KrmsSgds8j5hFi1 rDsVrAq2q47trfcnv6ohsjAhnPW5F0bWDHGJ7BcKVoeUiNEJJvDsSWuabW5ZpGBp868+ TSsb3ngNHOKOWWKygtTCGpv3HCCij0dYqglWs5KeNnPWdmarbpBsUsuFufcWNGQlhNLb m7wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796306426; x=1796911226; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=N8gbwl4d3ukOBMmx7xw6HDRVpTpdvhWYI7psgQGjayw=; b=aWd2kkoFJ+DHxITATX+vll7VX/9Mx+CLklHmoDCsVbdVSWugoask83nVxW9Sqs/iZt h5R4UG1hk/R09H0hhZXhuIGE6VBbH//3M39aFGDO/+5evI48EEeNt3ZwfefS7OFMXy9i NCTnTQ42ESc4UQ22SMAz/mLXC28rHIedPBfT/pwNWzsIdjGUC93IpOcxSc/OzCWmGp37 TtIDPhGJleK9yNiMRP+eFtkKvffSsVu3DDHGAPm1Tx5FeTWCDhos62smMnHV4/kxCKiN zwZa8CiwN02zQCafwKc0SY9Xi1f0PN8cToGZMyAtYFW9JocVh6FHWEWUPKHfOO7H/L6F VMuQ== X-Forwarded-Encrypted: i=1; AL+hErEDHAA2fqNIt+sC+dZibj9YsUgF7QvipKK//1FzuikEnobbYAOmkvM0K3ik7Q+Udw/T5KpOUkihF/k=@vger.kernel.org X-Gm-Message-State: APuU4Z88gwUWIZ15/dhT1VltwfMOQExYo8k36Y5JOwd+tkucql7FnHdo QxfV3KF8YmqXmQqie7gx1DReUCqdV8Z1BbWoY7sG5QvbhAlKOxj7swUHIfSKOOX/1nfkO7eNO/v m7mLCkvD7KA== X-Received: from plje12.prod.google.com ([2002:a17:902:ed8c:b0:2ef:b30a:ec66]) (user=kyletso job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:cec2:b0:2f0:6576:2815 with SMTP id d9443c01a7336-2f0657629aemr430127775ad.1.1796306425416; Thu, 03 Dec 2026 06:00:25 -0800 (PST) Date: Thu, 3 Dec 2026 14:00:23 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog Message-ID: <20261203140023.2275666-1-kyletso@google.com> Subject: [PATCH v1] usb: typec: tcpm: Clear pps_data in tcpm_reset_port() From: Kyle Tso To: Badhri Jagan Sridharan , Heikki Krogerus , Greg Kroah-Hartman Cc: Amit Sunil Dhamne , Guenter Roeck , linux-usb@vger.kernel.org, Kyle Tso Content-Type: text/plain; charset="UTF-8" tcpm_reset_port() currently clears only port->pps_data.supported on port detach or reset, leaving port->pps_data.active and the remaining fields (min_volt, max_volt, max_curr, and req_*) stale from a prior PPS session. Because the TCPM power_supply getters check port->pps_data.active, the voltage and current limit properties continue reporting the previous PPS adapter's bounds even after detach. When a new source is attached and charging is enabled in SNK_DISCOVERY, POWER_SUPPLY_PROP_ONLINE also falsely reports TCPM_PSY_PPS_ONLINE instead of TCPM_PSY_FIXED_ONLINE (along with the stale PPS limits instead of the 5V Type-C limits) until a new PD contract is accepted or SNK_HARD_RESET_SINK_OFF runs (if reached). Clear the entire port->pps_data structure in tcpm_reset_port(), matching SNK_HARD_RESET_SINK_OFF, before notifying port->psy. Fixes: 2eadc33f40d4 ("typec: tcpm: Add core support for sink side PPS") Cc: stable@vger.kernel.org Reviewed-by: Amit Sunil Dhamne Reviewed-by: Badhri Jagan Sridharan Signed-off-by: Kyle Tso --- drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index ca38e05f831a..72b08d69ff80 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -5178,7 +5178,7 @@ static void tcpm_reset_port(struct tcpm_port *port) tcpm_typec_disconnect(port); port->attached = false; port->pd_capable = false; - port->pps_data.supported = false; + memset(&port->pps_data, 0, sizeof(port->pps_data)); tcpm_set_partner_usb_comm_capable(port, false); /* base-commit: 9357829ac604c28510b71b154cb6630af81226ff -- 2.56.1.911.g883d8bcb20-goog