From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: aiyengar1990@gmail.com
Cc: Badhri Jagan Sridharan <badhri@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Guenter Roeck <linux@roeck-us.net>,
Heiko Stuebner <heiko@sntech.de>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, stable@vger.kernel.org
Subject: Re: [PATCH v3 1/2] usb: typec: tcpm: Don't cut a pending state delay short on a re-queue
Date: Mon, 30 Nov 2026 14:47:44 +0100 [thread overview]
Message-ID: <aw1-gEcCXWg8UgkG@black.igk.intel.com> (raw)
In-Reply-To: <20261126-tcpm-attach-reboot-v3-1-1c97dfa5024a@gmail.com>
On Thu, Nov 26, 2026 at 09:19:21AM +0000, Arun Iyengar via B4 Relay wrote:
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> A re-queue while the work runs applies a pending delayed state at once
> (the 100 ms ErrorRecovery took 6 us). Re-arm the timer for the time left.
>
> Fixes: 3ed8e1c2ac99 ("usb: typec: tcpm: Migrate workqueue to RT priority for processing events")
> Cc: stable@vger.kernel.org
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> 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..565073b4ca93 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -6572,6 +6572,11 @@ static void tcpm_state_machine_work(struct kthread_work *work)
>
> /* If we were queued due to a delayed state change, update it now */
> if (port->delayed_state) {
> + if (ktime_after(port->delayed_runtime, ktime_get())) {
> + hrtimer_start(&port->state_machine_timer,
> + port->delayed_runtime, HRTIMER_MODE_ABS);
> + goto done;
> + }
> tcpm_log(port, "state change %s -> %s [delayed %ld ms]",
> tcpm_states[port->state],
> tcpm_states[port->delayed_state], port->delay_ms);
>
> --
> 2.55.0
>
>
--
heikki
WARNING: multiple messages have this Message-ID (diff)
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: aiyengar1990@gmail.com
Cc: Badhri Jagan Sridharan <badhri@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Guenter Roeck <linux@roeck-us.net>,
Heiko Stuebner <heiko@sntech.de>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, stable@vger.kernel.org
Subject: Re: [PATCH v3 1/2] usb: typec: tcpm: Don't cut a pending state delay short on a re-queue
Date: Mon, 30 Nov 2026 14:47:44 +0100 [thread overview]
Message-ID: <aw1-gEcCXWg8UgkG@black.igk.intel.com> (raw)
In-Reply-To: <20261126-tcpm-attach-reboot-v3-1-1c97dfa5024a@gmail.com>
On Thu, Nov 26, 2026 at 09:19:21AM +0000, Arun Iyengar via B4 Relay wrote:
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> A re-queue while the work runs applies a pending delayed state at once
> (the 100 ms ErrorRecovery took 6 us). Re-arm the timer for the time left.
>
> Fixes: 3ed8e1c2ac99 ("usb: typec: tcpm: Migrate workqueue to RT priority for processing events")
> Cc: stable@vger.kernel.org
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> 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..565073b4ca93 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -6572,6 +6572,11 @@ static void tcpm_state_machine_work(struct kthread_work *work)
>
> /* If we were queued due to a delayed state change, update it now */
> if (port->delayed_state) {
> + if (ktime_after(port->delayed_runtime, ktime_get())) {
> + hrtimer_start(&port->state_machine_timer,
> + port->delayed_runtime, HRTIMER_MODE_ABS);
> + goto done;
> + }
> tcpm_log(port, "state change %s -> %s [delayed %ld ms]",
> tcpm_states[port->state],
> tcpm_states[port->delayed_state], port->delay_ms);
>
> --
> 2.55.0
>
>
--
heikki
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2026-11-30 13:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 9:19 [PATCH v3 0/2] usb: typec: Find a Type-C partner after a warm reboot on the Orange Pi 5 Arun Iyengar via B4 Relay
2026-11-26 9:19 ` Arun Iyengar via B4 Relay
2026-11-26 9:19 ` Arun Iyengar
2026-11-26 9:19 ` [PATCH v3 1/2] usb: typec: tcpm: Don't cut a pending state delay short on a re-queue Arun Iyengar via B4 Relay
2026-11-26 9:19 ` Arun Iyengar via B4 Relay
2026-11-26 9:19 ` Arun Iyengar
2026-11-30 13:47 ` Heikki Krogerus [this message]
2026-11-30 13:47 ` Heikki Krogerus
2026-11-26 9:19 ` [PATCH v3 2/2] usb: typec: fusb302: Toggle with the default Rp current Arun Iyengar via B4 Relay
2026-11-26 9:19 ` Arun Iyengar via B4 Relay
2026-11-26 9:19 ` Arun Iyengar
2026-11-30 13:50 ` Heikki Krogerus
2026-11-30 13:50 ` Heikki Krogerus
2026-11-26 9:29 ` [PATCH v3 0/2] usb: typec: Find a Type-C partner after a warm reboot on the Orange Pi 5 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=aw1-gEcCXWg8UgkG@black.igk.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=aiyengar1990@gmail.com \
--cc=badhri@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=heiko@sntech.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.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 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.