From: 胡连勤 <hulianqin@vivo.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>,
Michal Pecio <michal.pecio@gmail.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: 答复: 答复: [PATCH] xhci: sideband: check vdev liveness before removing endpoints on unregister
Date: Tue, 15 Sep 2026 03:26:15 +0000 [thread overview]
Message-ID: <TYUPR06MB6217720687E47CBA59F6703AD2BA2@TYUPR06MB6217.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <6e2c9b03-4694-4f6b-8fc0-552c069de65f@linux.intel.com>
Hi Mathias,
> >> 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?
> >>
> > No, it is not. The device is a full-speed Apple EarPods
> > (USB 1.1):
> >
> > usb 1-1: new full-speed USB device number 2 using xhci-hcd
> > usb 1-1: Product: EarPods
> > usb 1-1: New USB device found, idVendor=05ac, idProduct=110b
> >
> > So the port_event() → usb_reset_device() warm-reset path for
> > SS.Inactive does not apply here.
> > The actual crash path is through usb_disconnect(), not
> > usb_reset_device(). The full sequence from dmesg + crash trace:
>
> Thanks for clarifying, the crash part is now clear.
>
> What is still unclear is the parts before this.
> How do we end up in a situation where we are resetting and addressing
> a device with sideband still registered.
>
> What codepath ends up calling the futile
>
> hub_port_init()
> ->hub_address_device()
>
> that ends up freeing and reallocating the xhci vdev?
>
The trigger is reset-resume, not warm reset. From dmesg:
[158077.907] usb 1-1: usb_autoresume_device: cnt 1 -> 0
[158078.017] xhci-hcd: WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state.
[158078.017] xhci-hcd: WARN urb submitted to disabled ep
[158078.017] usb 1-1: reset full-speed USB device number 2 using xhci-hcd
The device was resuming from autosuspend but the port was disabled.
In hub_port_status_check() (hub.c:3329):
else if (!(portstatus & USB_PORT_STAT_ENABLE) && !udev->reset_resume) {
if (udev->persist_enabled)
udev->reset_resume = 1;
This sets reset_resume = 1, then finish_port_resume() (hub.c:3678)
calls usb_reset_and_verify_device() → hub_port_init() →
hub_set_address() → xhci_setup_device().
> Is there a way (like drv->pre_reset call) among that path to
> inform audio driver to unregister sideband?
>
No. The reset-resume path goes through finish_port_resume() →
usb_reset_and_verify_device() (hub.c:3678), which calls
usb_reset_and_verify_device() directly, bypassing
usb_reset_device(). So drv->pre_reset() is never called in
this path, and the interface remains bound throughout the reset
attempt.
This is why the crash trace shows usb_unbind_interface() being
called from usb_disconnect() — the interface was never unbound
before the reset.
The snd-usb-audio driver does have a .reset_resume callback
(usb_audio_resume), but it handles stream restart, not sideband
unregistration. There is currently no hook in the reset-resume
path for the audio driver to unregister sideband before
usb_reset_and_verify_device() begins.
Regards,
Lianqin
next prev parent reply other threads:[~2026-09-15 3:26 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 12:24 胡连勤
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
2026-09-14 13:00 ` 答复: " 胡连勤
2026-09-14 13:40 ` Mathias Nyman
2026-09-15 3:26 ` 胡连勤 [this message]
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=TYUPR06MB6217720687E47CBA59F6703AD2BA2@TYUPR06MB6217.apcprd06.prod.outlook.com \
--to=hulianqin@vivo.com \
--cc=alim.akhtar@samsung.com \
--cc=broonie@kernel.org \
--cc=cpgs@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=mathias.nyman@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®