Skip to content

Commit 6be7751

Browse files
committed
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: #5398 Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent a300bd9 commit 6be7751

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/soundwire/generic_bandwidth_allocation.c

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

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

0 commit comments

Comments
 (0)