[PATCH v2 0/5] soundwire: Fix bandwidth leak in multi-link aggregation failure
From: Bard Liao
Date: Thu Nov 12 2026 - 02:31:13 EST
The existing code only copies the params from the first link to the
bus params, but it doesn't copy the bandwidth from the other links.
This can lead to a bandwidth leak when multi-link aggregation fails.
Fix this by saving a snapshot of each bus's parameters before making
any modifications.
Changes in v2:
- Fix lane and rate group handling in the generic bandwidth allocation
that the rollback depends on:
- Pass the prepare/deprepare context to compute_params().
- Select the runtime of the stream being prepared for lane allocation
instead of the first runtime on the bus, which could be an already
running stream.
- Include the current stream in the group and port computation when
it is prepared again from the DEPREPARED state.
- Reset the lane of the stream being prepared to 0 when no multi-lane
is selected, so the lane assignment matches the restored lane_used_bandwidth.
Bard Liao (4):
soundwire: move lane bandwidth into bus params
soundwire: Pass prepare context to parameter computation
soundwire: Select the correct runtime for lane allocation
soundwire: Include the current stream when preparing again
David Lin (1):
soundwire: stream: Fix bandwidth leak in multi-link aggregation
failure
drivers/soundwire/amd_manager.c | 3 +-
drivers/soundwire/bus.h | 3 +
.../soundwire/generic_bandwidth_allocation.c | 81 ++++++++++++++-----
drivers/soundwire/qcom.c | 3 +-
drivers/soundwire/stream.c | 25 ++++--
include/linux/soundwire/sdw.h | 13 +--
6 files changed, 92 insertions(+), 36 deletions(-)
--
2.43.0