Skip to content

Commit

Permalink
soundwire: take in count the bandwidth of a prepared stream
Browse files Browse the repository at this point in the history
When a stream's state is marked as prepared, it is ready for
playback/capture. Therefore, we need to include the stream's bandwidth
when we calculate the required bandwidth of a bus.

Fixes: 25befdf ("soundwire: generic_bandwidth_allocation: count the bandwidth of active streams only")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://github.com/thesofproject/linux/issues/5334
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20250310073653.56476-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Bard Liao authored and Vinod Koul committed Mar 10, 2025
1 parent 9452422 commit 08ae0d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/soundwire/generic_bandwidth_allocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,11 @@ static int sdw_compute_group_params(struct sdw_bus *bus,
continue;
} else {
/*
* Include runtimes with running (ENABLED state) and paused (DISABLED state)
* streams
* Include runtimes with running (ENABLED/PREPARED state) and
* paused (DISABLED state) streams
*/
if (m_rt->stream->state != SDW_STREAM_ENABLED &&
m_rt->stream->state != SDW_STREAM_PREPARED &&
m_rt->stream->state != SDW_STREAM_DISABLED)
continue;
}
Expand Down

0 comments on commit 08ae0d6

Please sign in to comment.