Skip to content

Commit 25befdf

Browse files
bardliaovinodkoul
authored andcommitted
soundwire: generic_bandwidth_allocation: count the bandwidth of active streams only
sdw_compute_group_params() should only count payload bandwidth of the active streams which is in the ENABLED and DISABLED state in the bus. And add the payload bandwidth of the stream that calls sdw_compute_group_params() in sdw_prepare_stream(). 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 168cdf9 commit 25befdf

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/soundwire/generic_bandwidth_allocation.c

+13
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,19 @@ static int sdw_compute_group_params(struct sdw_bus *bus,
188188
}
189189

190190
list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) {
191+
if (m_rt->stream == stream) {
192+
/* Only runtime during prepare should be added */
193+
if (stream->state != SDW_STREAM_CONFIGURED)
194+
continue;
195+
} else {
196+
/*
197+
* Include runtimes with running (ENABLED state) and paused (DISABLED state)
198+
* streams
199+
*/
200+
if (m_rt->stream->state != SDW_STREAM_ENABLED &&
201+
m_rt->stream->state != SDW_STREAM_DISABLED)
202+
continue;
203+
}
191204
list_for_each_entry(p_rt, &m_rt->port_list, port_node) {
192205
rate = m_rt->stream->params.rate;
193206
bps = m_rt->stream->params.bps;

0 commit comments

Comments
 (0)