Skip to content

Commit 62ada17

Browse files
bardliaovinodkoul
authored andcommitted
soundwire: only compute port params in specific stream states
Currently, sdw_compute_master_ports() is blindly called for every single Manager runtime. However, we should not take into account the stream's bandwidth if the stream is just allocated or already deprepared. Fixes: 25befdf ("soundwire: generic_bandwidth_allocation: count the bandwidth of active streams only") Link: thesofproject#5398 Signed-off-by: Bard Liao <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent d028b57 commit 62ada17

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/soundwire/generic_bandwidth_allocation.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ static void _sdw_compute_port_params(struct sdw_bus *bus,
204204
port_bo = 1;
205205

206206
list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) {
207+
/*
208+
* Only runtimes with CONFIGURED, PREPARED, ENABLED, and DISABLED
209+
* states should be included in the bandwidth calculation.
210+
*/
211+
if (m_rt->stream->state > SDW_STREAM_DISABLED ||
212+
m_rt->stream->state < SDW_STREAM_CONFIGURED)
213+
continue;
207214
sdw_compute_master_ports(m_rt, &params[i], &port_bo, hstop);
208215
}
209216

0 commit comments

Comments
 (0)