All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: "Michal Pecio" <michal.pecio@gmail.com>, 胡连勤 <hulianqin@vivo.com>
Cc: Selvarasu Ganesan <selvarasu.g@samsung.com>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"quic_wcheng@quicinc.com" <quic_wcheng@quicinc.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"cpgs@samsung.com" <cpgs@samsung.com>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"thiagu.r@samsung.com" <thiagu.r@samsung.com>
Subject: Re: [PATCH] xhci: sideband: check vdev liveness before removing endpoints on unregister
Date: Mon, 14 Sep 2026 15:26:34 +0300	[thread overview]
Message-ID: <852003c6-317c-4004-ba2c-d6c4b0bd31e6@linux.intel.com> (raw)
In-Reply-To: <20260914110949.38a46596.michal.pecio@gmail.com>

On 9/14/26 12:09, Michal Pecio wrote:
> On Mon, 14 Sep 2026 07:04:17 +0000, 胡连勤 wrote:
>>> It doesn't cover hub_port_reset() called by port_event() for
>>> SuperSpeed devices, not sure what that is and whether it's
>>> dangerous. I noted that the original patch talks about hub_event(),
>>> but maybe it's a mistake?
>>
>> Thanks for the analysis. A clarification on the hub_event() reference
>> in my patch:
>>
>> The crash trace shows hub_event() at the top because that's the actual
>> crash call stack from the failing device. The full sequence is:
>>
>>    hub_event()
>>      -> port_event()                           [hub.c:5966]
>>         -> usb_reset_device(udev)              [hub.c:5875]
>>            -> usb_reset_and_verify_device()    [hub.c:6183]
>>               -> hub_port_init()               [hub.c:6228]
>>                  -> hcd->driver->address_device()  [hub.c:4781]
>>                     -> xhci_setup_device()     <-- COMP_USB_TRANSACTION_ERROR
>>                        -> xhci_disable_and_free_slot()  [xhci.c:4438]
>>                           -> xhci_free_virt_device()   <-- frees vdev here
> 
> So not a mistake and this is indeed a dangerous case. And AFAICT, in
> this path udev's pre_reset() routine isn't called and therefore can't
> be used to fix your issue, unless USB core is patched to call it.
> 
> But xhci_discover_or_reset_device() is called: before hub_port_init()
> calls problematic hub_enable_device() / hub_address_device() functions,
> it calls hub_port_reset(), which calls hcd->driver->reset_device().

To me it looks like both drv->pre_reset and xhci_discover_or_reset_device()
are called in this path.

hub_event()
   port_event()
     usb_reset_device(udev)
       if (config) //and for each interface in this config: , for each interface)
         if (cintf->dev.driver) {
           drv = to_usb_driver(cintf->dev.driver);
           if (drv->pre_reset && drv->post_reset)
           unbind = (drv->pre_reset)(cintf);


Any chance you could trace the whole call path in more details and see exactly which path
is staken before the crash.

port_event() should only call usb_reset_device() for usb3 devices with link stuck in
ss.inactive for longer than ~100ms.  Is this really a usb3 audio device?

Thanks
Mathias

  parent reply	other threads:[~2026-09-14 12:27 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 12:24 [PATCH] xhci: sideband: check vdev liveness before removing endpoints on unregister 胡连勤
2026-09-10  9:34 ` Mathias Nyman
2026-09-10 11:10   ` Selvarasu Ganesan
2026-09-10 12:11     ` 答复: " 胡连勤
2026-09-10 13:50       ` Mathias Nyman
2026-09-11  5:10       ` Selvarasu Ganesan
2026-09-11  7:29         ` 答复: " 胡连勤
2026-09-11  8:41           ` Selvarasu Ganesan
2026-09-11 13:10             ` Mathias Nyman
2026-09-11 14:49               ` 答复: " 胡连勤
2026-09-12 12:18               ` Michal Pecio
2026-09-14  7:04                 ` 答复: " 胡连勤
2026-09-14  9:09                   ` Michal Pecio
2026-09-14 12:24                     ` 答复: " 胡连勤
2026-09-14 13:09                       ` Mathias Nyman
2026-09-14 14:06                         ` Mathias Nyman
2026-09-14 15:34                           ` Michal Pecio
2026-09-15  2:57                         ` 答复: 答复: " 胡连勤
2026-10-02 10:12                           ` 胡连勤
2026-10-06 19:07                             ` Mathias Nyman
2026-10-08  3:23                               ` 答复: " 胡连勤
2026-09-14 12:26                     ` Mathias Nyman [this message]
2026-09-14 13:00                       ` 胡连勤
2026-09-14 13:40                         ` Mathias Nyman
2026-09-15  3:26                           ` 答复: " 胡连勤
2026-09-14 13:46                         ` Michal Pecio
2026-09-15  7:45                           ` 答复: " 胡连勤
2026-09-15  8:01                             ` Michal Pecio
2026-09-15  8:35                               ` 答复: " 胡连勤
2026-09-15  9:38                                 ` Michal Pecio
2026-09-15 10:11                                   ` 答复: " 胡连勤
2026-09-21 21:50                                 ` Wesley Cheng
2026-09-22  3:40                                   ` 答复: " 胡连勤

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=852003c6-317c-4004-ba2c-d6c4b0bd31e6@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=broonie@kernel.org \
    --cc=cpgs@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hulianqin@vivo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=michal.pecio@gmail.com \
    --cc=quic_wcheng@quicinc.com \
    --cc=selvarasu.g@samsung.com \
    --cc=thiagu.r@samsung.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.