Linux USB
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Alexey Charkov <alchark@flipper.net>
Cc: Badhri Jagan Sridharan <badhri@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	RD Babiera <rdbabiera@google.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	linux-usb@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2 2/4] usb: typec: tcpm: Stop replaying Source_Capabilities after cable discovery
Date: Fri, 20 Nov 2026 15:32:18 +0100	[thread overview]
Message-ID: <awBZ8sPLAwQFxChs@black.igk.intel.com> (raw)
In-Reply-To: <20261118-tcpm-soft-reset-sop-v2-2-b6decdc95e66@flipper.net>

On Wed, Nov 18, 2026 at 11:26:40AM +0400, Alexey Charkov wrote:
> When its first Source_Capabilities goes unacknowledged, a source that is
> the VCONN source asks the cable plug for its identity in
> SRC_VDM_IDENTITY_REQUEST. Entering that state sets upcoming_state to
> SRC_SEND_CAPABILITIES, for a message from the sink that interrupts it
> through SRC_READY. The ACK and send error paths go to
> SRC_SEND_CAPABILITIES directly and leave upcoming_state set, so the
> first SRC_READY after the contract sends Source_Capabilities again. The
> second negotiation can cut into the sink's own Discover Identity, and
> once ended in a Hard Reset between two FUSB302B ports.
> 
> Clear upcoming_state when SRC_SEND_CAPABILITIES follows
> SRC_VDM_IDENTITY_REQUEST directly.
> 
> Fixes: af8b627046bc ("usb: typec: tcpm: add state machine support for SRC_VDM_IDENTITY_REQUEST")
> Cc: stable@vger.kernel.org
> Signed-off-by: Alexey Charkov <alchark@flipper.net>

Acked-by: Heikki Krogerus <heikki.krogeurus@linux.intel.com>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 8c5be904d772..b9146658f6e5 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -5544,6 +5544,12 @@ static void run_state_machine(struct tcpm_port *port)
>  		tcpm_ams_start(port, POWER_NEGOTIATION);
>  		break;
>  	case SRC_SEND_CAPABILITIES:
> +		/*
> +		 * Straight from Discover Identity to the cable plug, rather
> +		 * than back through SRC_READY after a message from the sink
> +		 */
> +		if (port->prev_state == SRC_VDM_IDENTITY_REQUEST)
> +			port->upcoming_state = INVALID_STATE;
>  		port->caps_count++;
>  		if (port->caps_count > PD_N_CAPS_COUNT) {
>  			tcpm_set_state(port, SRC_READY, 0);
> 
> -- 
> 2.56.0
> 

-- 
heikki

  parent reply	other threads:[~2026-11-20 14:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  7:26 [PATCH v2 0/4] usb: typec: tcpm: Fixes for talking to the cable plug as a VCONN source Alexey Charkov
2026-11-18  7:26 ` [PATCH v2 1/4] usb: typec: tcpm: Keep the Soft_Reset target apart from the VDM one Alexey Charkov
2026-11-18  7:32   ` sashiko-bot
2026-11-20 14:31   ` Heikki Krogerus
2026-11-18  7:26 ` [PATCH v2 2/4] usb: typec: tcpm: Stop replaying Source_Capabilities after cable discovery Alexey Charkov
2026-11-18  7:39   ` sashiko-bot
2026-11-20 14:32   ` Heikki Krogerus [this message]
2026-11-18  7:26 ` [PATCH v2 3/4] usb: typec: tcpm: Leave SRC_VDM_IDENTITY_REQUEST whatever the cable answers Alexey Charkov
2026-11-18  8:08   ` sashiko-bot
2026-11-18  7:26 ` [PATCH v2 4/4] usb: typec: tcpm: Keep cable plug messages away from the port partner Alexey Charkov
2026-11-18  7:51   ` sashiko-bot

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=awBZ8sPLAwQFxChs@black.igk.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=alchark@flipper.net \
    --cc=badhri@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rdbabiera@google.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=stable@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