All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Max Andreev <drunkbatya.js@gmail.com>
Cc: Badhri Jagan Sridharan <badhri@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kyle Tso <kyletso@google.com>,
	stable@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, RD Babiera <rdbabiera@google.com>
Subject: Re: [PATCH v2] usb: typec: tcpm: fix missed frs_sourcing_vbus() call during FRS
Date: Wed, 25 Nov 2026 10:27:30 +0100	[thread overview]
Message-ID: <awaqAnBF94n5t3sC@black.igk.intel.com> (raw)
In-Reply-To: <20261122115639.2912666-1-drunkbatya.js@gmail.com>

+RD

On Sun, Nov 22, 2026 at 11:56:38AM +0000, Max Andreev wrote:
> Since commit 0908c5aca31e ("usb: typec: tcpm: AMS and Collision
> Avoidance") the TCPC reports sourcing vbus while the port is still in
> AMS_START with FR_SWAP_SEND as the upcoming state. Because of
> _tcpm_pd_vbus_on() ignores this state, frs_sourcing_vbus() is never called
> during FRS.
> 
> On Pixel 11 Pro XL after an FRS from sink to source the phone keeps
> showing the charging indicator, and about 20 seconds later VBUS drops
> and the attached device reboots.
> 
> Call frs_sourcing_vbus() from AMS_START when the upcoming state is
> FR_SWAP_SEND.
> 
> Fixes: 0908c5aca31e ("usb: typec: tcpm: AMS and Collision Avoidance")
> Cc: stable@vger.kernel.org
> Signed-off-by: Max Andreev <drunkbatya.js@gmail.com

Looks okay to me, but just in case, let's wait for comments from
Badhri, Kyle an RD.

thanks,

> ---
> v2: moved the trailers above the --- line
> 
> I'm not test theese changes on mainline, but tested on Pixel 11 Pro XL
> vendor kernel 6.1 with the same _tcpm_pd_vbus_on() code, as i see
> mainline tcpm.c is identical in this area.
> 
>  drivers/usb/typec/tcpm/tcpm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 51e5c72799f2..5caa649a92f1 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -6889,6 +6889,11 @@ static void _tcpm_pd_vbus_on(struct tcpm_port *port)
>  			port->tcpc->frs_sourcing_vbus(port->tcpc);
>  		tcpm_set_state(port, FR_SWAP_SNK_SRC_SOURCE_VBUS_APPLIED, 0);
>  		break;
> +	case AMS_START:
> +		if (port->upcoming_state == FR_SWAP_SEND &&
> +		    port->tcpc->frs_sourcing_vbus)
> +			port->tcpc->frs_sourcing_vbus(port->tcpc);
> +		break;
>  
>  	case PORT_RESET:
>  	case PORT_RESET_WAIT_OFF:
> -- 
> 2.47.3

-- 
heikki

      parent reply	other threads:[~2026-11-25  9:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 10:28 [PATCH] usb: typec: tcpm: fix missed frs_sourcing_vbus() call during FRS Max Andreev
2026-11-22 10:36 ` sashiko-bot
2026-11-22 10:38 ` Greg Kroah-Hartman
2026-11-22 11:54   ` Max Andreev
2026-11-22 11:56   ` [PATCH v2] " Max Andreev
2026-11-22 12:01     ` sashiko-bot
2026-11-25  9:27     ` Heikki Krogerus [this message]

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=awaqAnBF94n5t3sC@black.igk.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=badhri@google.com \
    --cc=drunkbatya.js@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kyletso@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rdbabiera@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.