Re: [PATCH] usb: typec: tcpm: Complete discovery when the partner lacks SVDM support

From: Xu Yang

Date: Thu Nov 05 2026 - 21:56:29 EST


Hi,

On Mon, Nov 02, 2026 at 06:04:46PM +0400, Alexey Charkov wrote:
> A PD 3.0 port that does not support Structured VDMs answers Discover
> Identity with Not_Supported, as TCPM itself does when no sink-vdos are
> configured. TCPM treats a NAK to Discover Identity or Discover SVIDs as
> the end of discovery, but on Not_Supported it only ends the VDM exchange
> and leaves discovery pending. Every pass through the ready state then
> restarts it, and the state machine passes through it after each reply
> it sends.
>
> Two such ports therefore keep each other busy: each answers the other's
> Discover Identity with Not_Supported, which restarts its own discovery,
> which draws a Not_Supported in turn. Two RK3576 boards connected to each
> other exchange about 25 Discover Identity requests per second each way,
> indefinitely, crowding out other PD traffic.
>
> Mark discovery complete when the partner answers Discover Identity or
> Discover SVIDs with Not_Supported, as on a NAK. Leave a Not_Supported
> from the cable plug alone, so that it cannot cut short discovery of the
> partner.

I had sent a fix for this issue:
https://patchwork.kernel.org/project/linux-usb/patch/20260916043957.3362995-1-xu.yang_2@xxxxxxxxxxx/

Thanks,
Xu Yang

>
> Signed-off-by: Alexey Charkov <alchark@xxxxxxxxxxx>
> ---
> drivers/usb/typec/tcpm/tcpm.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index d721baef5210..e21fe544b2d4 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -3908,6 +3908,17 @@ static void tcpm_pd_ctrl_request(struct tcpm_port *port,
> case SNK_READY:
> if (port->vdm_state > VDM_STATE_READY) {
> port->vdm_state = VDM_STATE_DONE;
> + /*
> + * A partner without Structured VDM support answers
> + * discovery with Not_Supported: there is nothing left
> + * to discover, just as after a NAK.
> + */
> + if (type == PD_CTRL_NOT_SUPP &&
> + rx_sop_type == TCPC_TX_SOP &&
> + (port->ams == DISCOVER_IDENTITY ||
> + port->ams == DISCOVER_SVIDS))
> + tcpm_update_vdm_discovery_state(port,
> + VDM_DISCOVERY_COMPLETE);
> if (tcpm_vdm_ams(port))
> tcpm_ams_finish(port);
> mod_vdm_delayed_work(port, 0);
>
> ---
> base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c
> change-id: 20261102-tcpm-discovery-no-svdm-b8aa1f5768dd
>
> Best regards,
> --
> Alexey Charkov <alchark@xxxxxxxxxxx>
>