aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBard Liao <yung-chuan.liao@linux.intel.com>2025-05-08 14:20:29 +0800
committerVinod Koul <vkoul@kernel.org>2025-05-14 12:44:01 +0100
commit62ada17a6217a50fbd1b23f10899890f56effc97 (patch)
treea8ae48e7ace21ddb2241f1a1f69cbc46a87a7d80
parentASoC: SOF: Intel: hda: Set the mic_privacy flag for soundwire with ACE3+ (diff)
downloadlinux-rng-62ada17a6217a50fbd1b23f10899890f56effc97.tar.xz
linux-rng-62ada17a6217a50fbd1b23f10899890f56effc97.zip
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: 25befdf32aa4 ("soundwire: generic_bandwidth_allocation: count the bandwidth of active streams only") Link: https://github.com/thesofproject/linux/issues/5398 Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20250508062029.6596-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/soundwire/generic_bandwidth_allocation.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/soundwire/generic_bandwidth_allocation.c b/drivers/soundwire/generic_bandwidth_allocation.c
index 1cfaccf43eac..c18f0c16f929 100644
--- a/drivers/soundwire/generic_bandwidth_allocation.c
+++ b/drivers/soundwire/generic_bandwidth_allocation.c
@@ -204,6 +204,13 @@ static void _sdw_compute_port_params(struct sdw_bus *bus,
port_bo = 1;
list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) {
+ /*
+ * Only runtimes with CONFIGURED, PREPARED, ENABLED, and DISABLED
+ * states should be included in the bandwidth calculation.
+ */
+ if (m_rt->stream->state > SDW_STREAM_DISABLED ||
+ m_rt->stream->state < SDW_STREAM_CONFIGURED)
+ continue;
sdw_compute_master_ports(m_rt, &params[i], &port_bo, hstop);
}