From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Badhri Jagan Sridharan <badhri@google.com>
Cc: gregkh@linuxfoundation.org, linux@roeck-us.net,
kyletso@google.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v1] tcpm: Avoid soft reset when partner does not support get_status
Date: Wed, 23 Aug 2023 09:49:07 +0300 [thread overview]
Message-ID: <ZOWr42vfSexOFDjq@kuha.fi.intel.com> (raw)
In-Reply-To: <20230820044449.1005889-1-badhri@google.com>
On Sun, Aug 20, 2023 at 04:44:48AM +0000, Badhri Jagan Sridharan wrote:
> When partner does not support get_status message, tcpm right now
> responds with soft reset message. This causes PD renegotiation to
> happen and resets PPS link. Avoid soft resetting the link when
> partner does not support get_status message to mitigate PPS resets.
>
> [ 208.926752] Setting voltage/current limit 9500 mV 2450 mA
> [ 208.930407] set_auto_vbus_discharge_threshold mode:3 pps_active:y vbus:9500 ret:0
> [ 208.930418] state change SNK_TRANSITION_SINK -> SNK_READY [rev3 POWER_NEGOTIATION]
> [ 208.930455] AMS POWER_NEGOTIATION finished
>
> // ALERT message from the Source
> [ 213.948442] PD RX, header: 0x19a6 [1]
> [ 213.948451] state change SNK_READY -> GET_STATUS_SEND [rev3 GETTING_SOURCE_SINK_STATUS]
> [ 213.948457] PD TX, header: 0x492
> [ 213.950402] PD TX complete, status: 0
> [ 213.950427] pending state change GET_STATUS_SEND -> GET_STATUS_SEND_TIMEOUT @ 60 ms [rev3 GETTING_SOURCE_SINK_STATUS]
>
> // NOT_SUPPORTED from the Source
> [ 213.959954] PD RX, header: 0xbb0 [1]
>
> // sink sends SOFT_RESET
> [ 213.959958] state change GET_STATUS_SEND -> SNK_SOFT_RESET [rev3 GETTING_SOURCE_SINK_STATUS]
> [ 213.959962] AMS GETTING_SOURCE_SINK_STATUS finished
> [ 213.959964] AMS SOFT_RESET_AMS start
> [ 213.959966] state change SNK_SOFT_RESET -> AMS_START [rev3 SOFT_RESET_AMS]
> [ 213.959969] state change AMS_START -> SOFT_RESET_SEND [rev3 SOFT_RESET_AMS]
>
> Cc: stable@vger.kernel.org
> Fixes: 8dea75e11380 ("usb: typec: tcpm: Protocol Error handling")
> Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/tcpm/tcpm.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 5639b9a1e0bf..280ce1bd7b53 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -2753,6 +2753,13 @@ static void tcpm_pd_ctrl_request(struct tcpm_port *port,
> port->sink_cap_done = true;
> tcpm_set_state(port, ready_state(port), 0);
> break;
> + /*
> + * Some port partners do not support GET_STATUS, avoid soft reset the link to
> + * prevent redundant power re-negotiation
> + */
> + case GET_STATUS_SEND:
> + tcpm_set_state(port, ready_state(port), 0);
> + break;
> case SRC_READY:
> case SNK_READY:
> if (port->vdm_state > VDM_STATE_READY) {
>
> base-commit: bbb9e06d2c6435af9c62074ad7048910eeb2e7bc
> --
> 2.42.0.rc1.204.g551eb34607-goog
--
heikki
next prev parent reply other threads:[~2023-08-23 6:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-20 4:44 [PATCH v1] tcpm: Avoid soft reset when partner does not support get_status Badhri Jagan Sridharan
2023-08-23 6:49 ` Heikki Krogerus [this message]
2023-08-23 13:25 ` Guenter Roeck
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=ZOWr42vfSexOFDjq@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=badhri@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kyletso@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--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