From: Xu Yang <xu.yang_2@oss.nxp.com>
To: badhri@google.com, heikki.krogerus@linux.intel.com,
gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
imx@lists.linux.dev, jun.li@nxp.com
Subject: [PATCH] usb: typec: tcpm: advance vdm_discovery_state on Discover Identity Not_Supported
Date: Mon, 14 Sep 2026 17:38:28 +0800 [thread overview]
Message-ID: <20260914093828.1910201-1-xu.yang_2@oss.nxp.com> (raw)
From: Xu Yang <xu.yang_2@nxp.com>
Commit fa4d0a7cd036 ("usb: typec: tcpm: fix Discover Identity retry loop
on Control Message reject") advances vdm_discovery_state to
VDM_DISCOVERY_COMPLETE when a CMDT_RSP_NAK is received, but it does not
advance the state when a non-modal port returns PD_CTRL_NOT_SUPP.
This can re-arm another vdm_discovery_work if the port is going to
respond with PD_CTRL_NOT_SUPP to the partner.
tcpm_pd_handle_msg(port, PD_MSG_CTRL_NOT_SUPP, NONE_AMS);
tcpm_queue_message();
mod_tcpm_delayed_work();
tcpm_state_machine_work()
tcpm_send_queued_message() -> send PD_MSG_CTRL_NOT_SUPP
run_state_machine()
case SRC_READY:
case SNK_READY:
mod_vdm_discovery_delayed_work(port, 0);
If both the port and its partner do not support modal operation, they
will send DISCOVER_IDENTITY to each other infinitely.
Advance vdm_discovery_state to VDM_DISCOVERY_COMPLETE in this path as
well, mirroring the existing handling for the SVDM CMDT_RSP_NAK case.
Fixes: fa4d0a7cd036 ("usb: typec: tcpm: fix Discover Identity retry loop on Control Message reject")
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
drivers/usb/typec/tcpm/tcpm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 2d6b14aa2085..cc9ea5d5e78a 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -3891,6 +3891,9 @@ static void tcpm_pd_ctrl_request(struct tcpm_port *port,
case SRC_READY:
case SNK_READY:
if (port->vdm_state > VDM_STATE_READY) {
+ if (port->ams == DISCOVER_IDENTITY)
+ tcpm_update_vdm_discovery_state(port,
+ VDM_DISCOVERY_COMPLETE);
port->vdm_state = VDM_STATE_DONE;
if (tcpm_vdm_ams(port))
tcpm_ams_finish(port);
--
2.34.1
next reply other threads:[~2026-09-14 9:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 9:38 Xu Yang [this message]
2026-09-18 7:53 ` [PATCH] usb: typec: tcpm: advance vdm_discovery_state on Discover Identity Not_Supported Heikki Krogerus
2026-09-21 2:11 ` Xu Yang
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=20260914093828.1910201-1-xu.yang_2@oss.nxp.com \
--to=xu.yang_2@oss.nxp.com \
--cc=badhri@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=imx@lists.linux.dev \
--cc=jun.li@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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