Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yaohan Li" <shunsheng1218@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [RFC PATCH] thunderbolt: cancel pending DP bandwidth requests on teardown
Date: Thu, 19 Nov 2026 02:46:14 +0000	[thread overview]
Message-ID: <sashiko-outbox-222339@kernel.org> (raw)
In-Reply-To: <20261119023558.1495581-1-shunsheng1218@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] thunderbolt: missing Fixes trailer for DP bandwidth request
  teardown fix
--

commit a1d5bdb78755e49d17ae3a6f04ee54979d0f9eb0
Author: Yaohan Li <shunsheng1218@gmail.com>

> thunderbolt: cancel pending DP bandwidth requests on teardown
>
> tb_queue_dp_bandwidth_request() queues its delayed work and keeps no
> record of it.  The retry path in tb_handle_dp_bandwidth_request() queues
> the work again with a 50 ms delay, and tb_deinit() only cancels the
> bandwidth group release works.  The flush_workqueue() in
> tb_domain_remove() runs before tb_deinit() but it does not cover a
> delayed work whose timer has not expired yet, so a request that is
> waiting for its retry can run after the domain has been removed and the
> tb structure has been freed.
>
> Record the queued requests in tb_cm and cancel the remaining ones in
> tb_deinit(), which runs after the workqueue has been flushed and before
> the domain device is unregistered.  A request is recorded and queued
> while holding dp_bandwidth_lock, so tb_deinit() either sees it and
> cancels it or the request is rejected before it is queued at all.  A
> work item that is already running hands the ownership of its request
> back to tb_deinit() through the canceled flag.
>
> This covers the list and the delayed work, not the lifetime of @tb.
> dp_bandwidth_closed keeps new work from being queued, but it is not a
> reference on @tb.  Both in-tree callers are reached from the DP
> bandwidth handling in tb.c - one from the bandwidth work that runs on
> tb->wq, one from the control channel event path that tb_ctl_stop()
> stops - and tb_deinit() runs after both have been drained.
>
> Signed-off-by: Yaohan Li <shunsheng1218@gmail.com>

[Severity: Low]
Commit d6d458d42e1e ("thunderbolt: Handle DisplayPort tunnel activation
asynchronously") converted tb_hotplug_event.work to a delayed_work and added
the 50 ms retry path in tb_handle_dp_bandwidth_request().  Should this
include a Fixes tag?

  Fixes: d6d458d42e1e ("thunderbolt: Handle DisplayPort tunnel activation asynchronously")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119023558.1495581-1-shunsheng1218@gmail.com?part=1

      reply	other threads:[~2026-11-19  2:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  2:35 [RFC PATCH] thunderbolt: cancel pending DP bandwidth requests on teardown Yaohan Li
2026-11-19  2:46 ` sashiko-bot [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=sashiko-outbox-222339@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shunsheng1218@gmail.com \
    /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