From: sashiko-bot@kernel.org
To: "Yaohan Li" <shunsheng1218@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [RFC PATCH v3] thunderbolt: cancel the queued control requests on teardown
Date: Fri, 20 Nov 2026 04:39:29 +0000 [thread overview]
Message-ID: <sashiko-outbox-224466@kernel.org> (raw)
In-Reply-To: <20261120042721.420468-1-shunsheng1218@gmail.com>
> tb_domain_remove() stops the control channel but nothing cancels the
> requests still in its queue. Their completion work is already scheduled
> and the queue itself holds a reference, so tb_ctl_free() releases the
> channel, the rings and the frame pool while that work is still pending.
>
> Splice the queue instead, cancel the work and release the callback data
> with -ENOTCONN. The reference the queue held is taken before the request
> becomes unprotected, so a completion that runs in the meantime cannot
> free it under the loop.
>
> The terminal state is published once. A request can be canceled by its
> owner after a timeout and by the teardown at the same time, so the error
> and the cancellation hook run under one small lock, and only for a request
> whose completion work has not finished: both callers reach this after
> cancel_work_sync(), so a request whose callback already ran keeps the
> [ ... ]
> well: a failing driver_ready() or start() leaves requests behind and that
> domain is released without tb_domain_remove().
>
> Fixes: d7f781bfdbf4 ("thunderbolt: Rework control channel to be more reliable")
> Signed-off-by: Yaohan Li <shunsheng1218@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120042721.420468-1-shunsheng1218@gmail.com?part=1
prev parent reply other threads:[~2026-11-20 4:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 7:55 [RFC PATCH] thunderbolt: cancel the queued control requests on teardown Yaohan Li
2026-11-19 8:12 ` sashiko-bot
2026-11-19 11:19 ` [RFC PATCH v2] " Yaohan Li
2026-11-19 11:43 ` sashiko-bot
2026-11-20 4:27 ` [RFC PATCH v3] " Yaohan Li
2026-11-20 4:39 ` 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-224466@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 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.