Skip to content

Commit a67d8fc

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 in count 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") Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 845ad50 commit a67d8fc

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
@@ -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_CONFIGURED ||
214+
m_rt->stream->state > SDW_STREAM_DISABLED)
215+
continue;
209216
sdw_compute_master_ports(m_rt, &params[i], &port_bo, hstop);
210217
}
211218

0 commit comments

Comments
 (0)