usb: offload: Decouple interrupter lifecycle and refactor usage tracking
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 3 repliesIn review
Changes in v1 from the cover letter
- Fix build error when building sound/usb/qcom/qc_audio_offload.o
- Link to RFC v2: https://lore.kernel.org/all/[email protected]/
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | usb: offload: move device locking to callers in offload.cdrivers/ drivers/ | +13 | 1 reply | |
| 2/2 | ALSA: usb: qcom: manage offload device usagesound/ | +60 | 2 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by.
| Patch | Hailong Liu |
|---|---|
| 1/2 | T-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v1 0/2] usb: offload: Decouple interrupter lifecycle and refactor usage tracking
The current USB offload implementation couples the allocation of xHCI sideband interrupters with the device's offload usage counter. This coupling is conceptually incorrect, as hardware resource availability and power management state serve distinct purposes.
This series decouples these mechanisms by removing the usage counting logic from the xHCI sideband layer and shifting the responsibility to the consumer drivers. This allows interrupters to be managed independently of the device's active offload status.
Furthermore, this refactoring addresses a recursive locking issue. When a USB device is disconnected, the USB core invokes the driver's disconnect callback while holding the udev device lock. Previously, the xHCI sideband layer would call usb_offload_put(), which attempted to re-acquire the same udev lock, resulting in a deadlock.
By shifting lock acquisition responsibility to the upper-level USB driver, we ensure that offload usage updates can be safely performed from contexts where the lock is already held. This standardizes the lock hierarchy and prevents potential deadlocks during teardown.
Patch 1 performs the core refactoring by updating the offload APIs to require caller-held device locks and removing implicit usage counting from the interrupter paths.
Patch 2 updates the Qualcomm USB audio offload driver to explicitly manage the usage counter during its stream lifecycle, serving as a derivative consumer of the new API contract. This also ensures the device remains active during playback, preventing premature autosuspend.
---
Changes in v1:
- Fix build error when building sound/usb/qcom/qc_audio_offload.o
- Link to RFC v2: https://lore.kernel.org/all/[email protected]/
Changes in RFC v2:
- Move device locking to callers
- Decouple sideband from offload counting.
- Link to RFC v1: https://lore.kernel.org/all/[email protected]/
---
Guan-Yu Lin (2):
usb: offload: move device locking to callers in offload.c
ALSA: usb: qcom: manage offload device usage
drivers/usb/core/offload.c | 34 ++++------ drivers/usb/host/xhci-sideband.c | 14 +--- sound/usb/qcom/qc_audio_offload.c | 102 ++++++++++++++++++------------ 3 files changed, 73 insertions(+), 77 deletions(-)
Signature · 1 line
2.53.0.414.gf7e9f6c205-goog