Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/5] soundwire: Fix bandwidth leak in multi-link aggregation failure
@ 2026-11-12  7:21 Bard Liao
  2026-11-12  7:21 ` [PATCH v2 1/5] soundwire: move lane bandwidth into bus params Bard Liao
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Bard Liao @ 2026-11-12  7:21 UTC (permalink / raw)
  To: linux-sound, vkoul
  Cc: vinod.koul, linux-kernel, pierre-louis.bossart, peter.ujfalusi,
	bard.liao

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-12 10:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12  7:21 [PATCH v2 0/5] soundwire: Fix bandwidth leak in multi-link aggregation failure Bard Liao
2026-11-12  7:21 ` [PATCH v2 1/5] soundwire: move lane bandwidth into bus params Bard Liao
2026-11-12  7:21 ` [PATCH v2 2/5] soundwire: Pass prepare context to parameter computation Bard Liao
2026-11-12  7:21 ` [PATCH v2 3/5] soundwire: Select the correct runtime for lane allocation Bard Liao
2026-11-12  7:41   ` sashiko-bot
2026-11-12  7:21 ` [PATCH v2 4/5] soundwire: Include the current stream when preparing again Bard Liao
2026-11-12  7:21 ` [PATCH v2 5/5] soundwire: stream: Fix bandwidth leak in multi-link aggregation failure Bard Liao
2026-11-12  7:37   ` sashiko-bot
2026-11-12 10:23     ` Liao, Bard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox