From: sashiko-bot@kernel.org
To: "Arun Iyengar" <aiyengar1990@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 1/2] usb: typec: tcpm: Don't cut a pending state delay short on a re-queue
Date: Thu, 12 Nov 2026 08:36:33 +0000 [thread overview]
Message-ID: <sashiko-outbox-210747@kernel.org> (raw)
In-Reply-To: <20261112-tcpm-attach-reboot-v2-1-b4bc6ca83490@gmail.com>
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> tcpm_state_machine_work() applies port->delayed_state as soon as it
> runs, assuming it only runs when the state machine timer fired. The
> work can also run because it was queued for another reason while it was
> already running.
>
> This happens at every port registration: tcpm_init() runs with the port
> lock held and calls tcpm_set_state() twice with no delay (default state,
> then PORT_RESET). The first call queues the work, which starts and
> blocks on the lock; the second call queues it again. The first run
> handles PORT_RESET and schedules PORT_RESET_WAIT_OFF after
> PD_T_ERROR_RECOVERY; the second run then applies it at once. On an
> Orange Pi 5 (FUSB302) the log shows the 100 ms ErrorRecovery taking
> 6 us:
>
> pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms
> state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
>
> so the "clean slate" that tcpm_init() asks for never happens.
>
> If the delay has not expired yet, re-arm the timer for the time left
> and return, as tcpm_send_queued_message() already does.
>
> 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>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261112-tcpm-attach-reboot-v2-0-b4bc6ca83490@gmail.com?part=1
next prev parent reply other threads:[~2026-11-12 8:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 8:23 [PATCH v2 0/2] usb: typec: Find a Type-C partner after a warm reboot on the Orange Pi 5 Arun Iyengar
2026-11-12 8:23 ` Arun Iyengar via B4 Relay
2026-11-12 8:23 ` Arun Iyengar via B4 Relay
2026-11-12 8:23 ` [PATCH v2 1/2] usb: typec: tcpm: Don't cut a pending state delay short on a re-queue Arun Iyengar
2026-11-12 8:23 ` Arun Iyengar via B4 Relay
2026-11-12 8:23 ` Arun Iyengar via B4 Relay
2026-11-12 8:36 ` sashiko-bot [this message]
2026-11-12 8:23 ` [PATCH v2 2/2] usb: typec: fusb302: Toggle with the default Rp current Arun Iyengar
2026-11-12 8:23 ` Arun Iyengar via B4 Relay
2026-11-12 8:23 ` Arun Iyengar via B4 Relay
2026-11-12 8:45 ` 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=sashiko-outbox-210747@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=aiyengar1990@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.