Skip to contentSkip to conversation

sound/soc/sof/ipc4-topology.c:2176 sof_ipc4_widget_free() warn: inconsistent returns '&ipc4_data->pipeline_state_mutex'.

PATCH kernel test robot 1 participant 1 message Mar 22, 2023

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

BCC: [email protected]
CC: [email protected]
TO: Jyri Sarha <[email protected]>
CC: Mark Brown <[email protected]>
CC: Rander Wang <[email protected]>
CC: Peter Ujfalusi <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-6.4
head:   e3057eb574bae296665f7dfdb1692acc101b3727
commit: ca5ce0caa67fa9eeecaa29d895c2e4c3151c159e [258/267] ASoC: SOF: ipc4/intel: Add support for chained DMA

:::::: branch date: 17 hours ago
:::::: commit date: 24 hours ago
config: s390-randconfig-m031-20230321 (https://download.01.org/0day-ci/archive/20230322/[email protected]/config)
compiler: s390-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable

| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Link: https://lore.kernel.org/r/[email protected]/

New smatch warnings:
sound/soc/sof/ipc4-topology.c:2176 sof_ipc4_widget_free() warn: inconsistent returns '&ipc4_data->pipeline_state_mutex'.

Old smatch warnings:
sound/soc/sof/ipc4-topology.c:1332 ipc4_copier_set_capture_fmt() error: uninitialized symbol 'sample_valid_bits'.

vim +2176 sound/soc/sof/ipc4-topology.c

6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2133  
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2134  static int sof_ipc4_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2135  {
711d0427c7134c Bard Liao         2022-07-15  2136  	struct sof_ipc4_fw_module *fw_module = swidget->module_info;
6bc4d1b714aafc Ranjani Sridharan 2023-01-27  2137  	struct sof_ipc4_fw_data *ipc4_data = sdev->private;
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2138  	int ret = 0;
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2139  
6bc4d1b714aafc Ranjani Sridharan 2023-01-27  2140  	mutex_lock(&ipc4_data->pipeline_state_mutex);
6bc4d1b714aafc Ranjani Sridharan 2023-01-27  2141  
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2142  	/* freeing a pipeline frees all the widgets associated with it */
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2143  	if (swidget->id == snd_soc_dapm_scheduler) {
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2144  		struct sof_ipc4_pipeline *pipeline = swidget->private;
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2145  		struct sof_ipc4_msg msg = {{ 0 }};
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2146  		u32 header;
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2147  
ca5ce0caa67fa9 Jyri Sarha        2023-03-21  2148  		if (pipeline->use_chain_dma)
ca5ce0caa67fa9 Jyri Sarha        2023-03-21  2149  			return 0;
ca5ce0caa67fa9 Jyri Sarha        2023-03-21  2150  
a2ba1f70b301b3 Bard Liao         2022-11-08  2151  		header = SOF_IPC4_GLB_PIPE_INSTANCE_ID(swidget->instance_id);
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2152  		header |= SOF_IPC4_MSG_TYPE_SET(SOF_IPC4_GLB_DELETE_PIPELINE);
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2153  		header |= SOF_IPC4_MSG_DIR(SOF_IPC4_MSG_REQUEST);
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2154  		header |= SOF_IPC4_MSG_TARGET(SOF_IPC4_FW_GEN_MSG);
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2155  
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2156  		msg.primary = header;
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2157  
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2158  		ret = sof_ipc_tx_message(sdev->ipc, &msg, 0, NULL, 0);
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2159  		if (ret < 0)
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2160  			dev_err(sdev->dev, "failed to free pipeline widget %s\n",
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2161  				swidget->widget->name);
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2162  
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2163  		pipeline->mem_usage = 0;
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2164  		pipeline->state = SOF_IPC4_PIPE_UNINITIALIZED;
a2ba1f70b301b3 Bard Liao         2022-11-08  2165  		ida_free(&pipeline_ida, swidget->instance_id);
711d0427c7134c Bard Liao         2022-07-15  2166  	} else {
ca5ce0caa67fa9 Jyri Sarha        2023-03-21  2167  		struct snd_sof_widget *pipe_widget = swidget->spipe->pipe_widget;
ca5ce0caa67fa9 Jyri Sarha        2023-03-21  2168  		struct sof_ipc4_pipeline *pipeline = pipe_widget->private;
ca5ce0caa67fa9 Jyri Sarha        2023-03-21  2169  
ca5ce0caa67fa9 Jyri Sarha        2023-03-21  2170  		if (!pipeline->use_chain_dma)
711d0427c7134c Bard Liao         2022-07-15  2171  			ida_free(&fw_module->m_ida, swidget->instance_id);
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2172  	}
6e9257a13c75b2 Ranjani Sridharan 2022-06-08  2173  
6bc4d1b714aafc Ranjani Sridharan 2023-01-27  2174  	mutex_unlock(&ipc4_data->pipeline_state_mutex);
6bc4d1b714aafc Ranjani Sridharan 2023-01-27  2175  

6e9257a13c75b2 Ranjani Sridharan 2022-06-08 @2176 return ret;
6e9257a13c75b2 Ranjani Sridharan 2022-06-08 2177 } 6e9257a13c75b2 Ranjani Sridharan 2022-06-08 2178

:::::: The code at line 2176 was first introduced by commit
:::::: 6e9257a13c75b2e4fc33477f9de4912fdfae81e1 ASoC: SOF: ipc4-topology: Add widget_setup/widget_free ops

:::::: TO: Ranjani Sridharan <[email protected]> :::::: CC: Mark Brown <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests