Linux USB
 help / color / mirror / Atom feed
From: "Chunfeng Yun (云春峰)" <Chunfeng.Yun@mediatek.com>
To: "sashiko-reviews@lists.linux.dev" <sashiko-reviews@lists.linux.dev>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH v3 8/8] thunderbolt: Drop WARN_ON() in tb_disconnect_pci()
Date: Tue, 24 Nov 2026 06:32:12 +0000	[thread overview]
Message-ID: <caeafcf7ab501bb50ff65c320ba0a5877d7f72f5.camel@mediatek.com> (raw)
In-Reply-To: <sashiko-outbox-229158@kernel.org>

On 一, 2026-11-23 at 11:42 +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [Low] thunderbolt: missing Fixes trailer for tb_disconnect_pci()
>   WARN_ON() fix
> --
> 
> commit f6a685f6d3f79343c1ba3c57db3636a5afc5f46e
> Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
> 
> > thunderbolt: Drop WARN_ON() in tb_disconnect_pci()
> > 
> > tb_disconnect_pci() uses WARN_ON() if the upstream PCIe adapter
> > port
> > or the associated PCIe tunnel cannot be found. This triggers a full
> > kernel stack trace in dmesg.
> > 
> > However, tb_disconnect_pci() is invoked when userspace deauthorizes
> > a router via sysfs (writing 0 to 'authorized'). Under dynamic
> > runtime
> > conditions, an upstream port or active tunnel may not exist.
> > For example:
> > - If a USB4 router fails to resume or is unplugged during
> > system/link
> >   sleep, the disconnect flow may tear down and free the PCIe tunnel
> >   before userspace deauthorization runs.
> > - If PCIe tunnel activation previously failed (e.g., due to link
> >   training or Type-C handshake hiccups), the tunnel was never
> >   established in the first place.
> > 
> > it seems unnecessary due to it does not indicate a kernel bug.
> > Furthermore, it causes unnecessary kernel panics on systems
> > booted with panic_on_warn.
> > 
> > Since -ENODEV is already returned to notify callers, simply drop
> > the
> > WARN_ON() checks while keeping the -ENODEV return.
> > 
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> 
> [Severity: Low]
> This fixes spurious warnings in tb_disconnect_pci() when
> deauthorizing
> a router without an upstream PCIe port or active tunnel.  Should this
> include:
> 
>   Fixes: 3da88be24997 ("thunderbolt: Add support for de-authorizing
> devices")
> 
will add it in commit message

Thanks


      reply	other threads:[~2026-11-24  6:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 11:36 [PATCH 0/8] thunderbolt: Add support platform NHI driver Chunfeng Yun
2026-11-23 11:36 ` [PATCH v3 1/8] thunderbolt: Prefix NHI core functions with tb_ and tb_ring_ Chunfeng Yun
2026-11-23 11:54   ` sashiko-bot
2026-11-23 11:36 ` [PATCH v3 2/8] thunderbolt: Move ICM mailbox functions to icm.c and internalize interrupt work Chunfeng Yun
2026-11-23 11:36 ` [PATCH v3 3/8] thunderbolt: Make PCIe NHI support opt-in Chunfeng Yun
2026-11-23 11:36 ` [PATCH v3 4/8] thunderbolt: Fix error handling and unwind paths in tb_nhi_probe() Chunfeng Yun
2026-11-23 11:36 ` [PATCH v3 5/8] thunderbolt: Add platform NHI driver Chunfeng Yun
2026-11-23 11:54   ` sashiko-bot
2026-11-24  6:37     ` Chunfeng Yun (云春峰)
2026-11-24  7:15       ` Mika Westerberg
2026-11-23 11:36 ` [PATCH v3 6/8] thunderbolt: Increase the lane adapter link-up timeout value Chunfeng Yun
2026-11-23 11:36 ` [PATCH v3 7/8] thunderbolt: Decouple the waiting time of TB_PORT_UNPLUGGED and TB_PORT_UP Chunfeng Yun
2026-11-23 11:36 ` [PATCH v3 8/8] thunderbolt: Drop WARN_ON() in tb_disconnect_pci() Chunfeng Yun
2026-11-23 11:42   ` sashiko-bot
2026-11-24  6:32     ` Chunfeng Yun (云春峰) [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=caeafcf7ab501bb50ff65c320ba0a5877d7f72f5.camel@mediatek.com \
    --to=chunfeng.yun@mediatek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox