mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 胡连勤 <hulianqin@vivo.com>
To: Michal Pecio <michal.pecio@gmail.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>,
	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 08:35:40 +0000	[thread overview]
Message-ID: <TYUPR06MB6217CD9B8231A5A7EBECEB53D2BA2@TYUPR06MB6217.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <20260915100136.38b4c31f.michal.pecio@gmail.com>

Hi Michal,

> > Unfortunately, no. The reproduction rate is very low, and we have
> > not yet found a stable way to reproduce it — it requires the
> > device to be in a specific state where the port is disabled after
> > autosuspend resume, which happens rarely in the field.
> 
> Why are offloaded devices being suspended at all? Obviously, no
> "sideband entity" can be using a suspended device, so it seems that:
> 
> - if the device is unused and meant to be suspended, sideband can be
>   removed before suspending
> - if the device becomes suspended while in use, obviously it's a bug
> 

You raise a valid point. Looking at the code:

The snd-usb-audio driver sets supports_autosuspend = 1
(card.c:1347), so the device can autosuspend when no audio stream
is active.

During suspend, usb_audio_suspend() calls
platform_ops->suspend_cb → qc_usb_audio_offload_suspend(),
which sends a QMI disconnect indication to the ADSP and waits for
dev->in_use to be cleared.

However, qc_usb_audio_offload_suspend() does not call
xhci_sideband_remove_endpoint() or xhci_sideband_unregister().
The sideband registration stays active during suspend — the
endpoint pointers to xHCI ring buffers remain in place.

This is the root design issue: the sideband client assumes the
xHCI ring buffers remain valid across suspend/resume cycles. But
on reset-resume, usb_reset_and_verify_device() → hub_port_init()
→ xhci_discover_or_reset_device() frees and reallocates those
rings, invalidating the sideband's pointers.

Your suggestion is correct — the proper fix is for the audio
offload driver to remove sideband endpoints during suspend and
re-add them during resume, rather than leaving them registered
across suspend/resume cycles.

Regards,
Lianqin

  reply	other threads:[~2026-09-15  8:35 UTC|newest]

Thread overview: 28+ 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-09-14 12:26                     ` Mathias Nyman
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                               ` 胡连勤 [this message]
2026-09-15  9:38                                 ` Michal Pecio
2026-09-15 10:11                                   ` 答复: " 胡连勤

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=TYUPR06MB6217CD9B8231A5A7EBECEB53D2BA2@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®