tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 6d9bd4ad4ca08b1114e814c2c42383b8b13be631 commit: 3dc0d709177828a22dfc9d0072e3ac937ef90d06 [4766/5417] ASoC: SOF: Convert the generic probe support to SOF client config: i386-randconfig-a003-20210930 (https://download.01.org/0day-ci/archive/20220213/202202130429.GEdTKNDQ-lkp@xxxxxxxxx/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=1 build): # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3dc0d709177828a22dfc9d0072e3ac937ef90d06 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 3dc0d709177828a22dfc9d0072e3ac937ef90d06 # save the config file to linux build tree mkdir build_dir make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All errors (new ones prefixed by >>): ld: sound/soc/sof/core.o: in function `sof_set_fw_state': >> sound/soc/sof/core.c:135: undefined reference to `sof_client_fw_state_dispatcher' ld: sound/soc/sof/core.o: in function `sof_probe_continue': >> sound/soc/sof/core.c:287: undefined reference to `sof_register_clients' ld: sound/soc/sof/core.o: in function `sof_set_fw_state': >> sound/soc/sof/core.c:135: undefined reference to `sof_client_fw_state_dispatcher' ld: sound/soc/sof/core.o: in function `snd_sof_device_remove': >> sound/soc/sof/core.c:427: undefined reference to `sof_unregister_clients' ld: sound/soc/sof/core.o: in function `sof_set_fw_state': >> sound/soc/sof/core.c:135: undefined reference to `sof_client_fw_state_dispatcher' ld: sound/soc/sof/ipc.o: in function `snd_sof_ipc_msgs_rx': >> sound/soc/sof/ipc.c:574: undefined reference to `sof_client_ipc_rx_dispatcher' ld: sound/soc/sof/pm.o: in function `sof_suspend': >> sound/soc/sof/pm.c:227: undefined reference to `sof_suspend_clients' >> ld: sound/soc/sof/pm.c:217: undefined reference to `sof_suspend_clients' ld: sound/soc/sof/pm.o: in function `sof_resume': >> sound/soc/sof/pm.c:171: undefined reference to `sof_resume_clients' vim +135 sound/soc/sof/core.c c16211d6226dbd Liam Girdwood 2019-04-12 121 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 122 /* Helper to manage DSP state */ 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 123 void sof_set_fw_state(struct snd_sof_dev *sdev, enum sof_fw_state new_state) 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 124 { 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 125 if (sdev->fw_state == new_state) 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 126 return; 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 127 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 128 dev_dbg(sdev->dev, "fw_state change: %d -> %d\n", sdev->fw_state, new_state); 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 129 sdev->fw_state = new_state; 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 130 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 131 switch (new_state) { 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 132 case SOF_FW_BOOT_NOT_STARTED: 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 133 case SOF_FW_BOOT_COMPLETE: 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 134 case SOF_FW_CRASHED: 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 @135 sof_client_fw_state_dispatcher(sdev); 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 136 fallthrough; 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 137 default: 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 138 break; 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 139 } 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 140 } 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 141 EXPORT_SYMBOL(sof_set_fw_state); 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 142 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 143 /* 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 144 * FW Boot State Transition Diagram 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 145 * 9f89a988d5c222 Peter Ujfalusi 2021-12-23 146 * +----------------------------------------------------------------------+ 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 147 * | | 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 148 * ------------------ ------------------ | 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 149 * | | | | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 150 * | BOOT_FAILED |<-------| READY_FAILED | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 151 * | |<--+ | | ------------------ | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 152 * ------------------ | ------------------ | | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 153 * ^ | ^ | CRASHED |---+ | 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 154 * | | | | | | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 155 * (FW Boot Timeout) | (FW_READY FAIL) ------------------ | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 156 * | | | ^ | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 157 * | | | |(DSP Panic) | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 158 * ------------------ | | ------------------ | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 159 * | | | | | | | | 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 160 * | IN_PROGRESS |---------------+------------->| COMPLETE | | | 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 161 * | | (FW Boot OK) (FW_READY OK) | | | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 162 * ------------------ | ------------------ | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 163 * ^ | | | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 164 * | | | | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 165 * (FW Loading OK) | (System Suspend/Runtime Suspend) 9f89a988d5c222 Peter Ujfalusi 2021-12-23 166 * | | | | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 167 * | (FW Loading Fail) | | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 168 * ------------------ | ------------------ | | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 169 * | | | | |<-----+ | | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 170 * | PREPARE |---+ | NOT_STARTED |<---------------------+ | 9f89a988d5c222 Peter Ujfalusi 2021-12-23 171 * | | | |<--------------------------+ 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 172 * ------------------ ------------------ 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 173 * | ^ | ^ 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 174 * | | | | 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 175 * | +-----------------------+ | 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 176 * | (DSP Probe OK) | 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 177 * | | 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 178 * | | 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 179 * +------------------------------------+ 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 180 * (System Suspend/Runtime Suspend) 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 181 */ 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 182 c16211d6226dbd Liam Girdwood 2019-04-12 183 static int sof_probe_continue(struct snd_sof_dev *sdev) c16211d6226dbd Liam Girdwood 2019-04-12 184 { c16211d6226dbd Liam Girdwood 2019-04-12 185 struct snd_sof_pdata *plat_data = sdev->pdata; c16211d6226dbd Liam Girdwood 2019-04-12 186 int ret; c16211d6226dbd Liam Girdwood 2019-04-12 187 c16211d6226dbd Liam Girdwood 2019-04-12 188 /* probe the DSP hardware */ c16211d6226dbd Liam Girdwood 2019-04-12 189 ret = snd_sof_probe(sdev); c16211d6226dbd Liam Girdwood 2019-04-12 190 if (ret < 0) { c16211d6226dbd Liam Girdwood 2019-04-12 191 dev_err(sdev->dev, "error: failed to probe DSP %d\n", ret); c16211d6226dbd Liam Girdwood 2019-04-12 192 return ret; c16211d6226dbd Liam Girdwood 2019-04-12 193 } c16211d6226dbd Liam Girdwood 2019-04-12 194 58a5c9a4aa993f Peter Ujfalusi 2021-10-06 195 sof_set_fw_state(sdev, SOF_FW_BOOT_PREPARE); 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 196 c16211d6226dbd Liam Girdwood 2019-04-12 197 /* check machine info */ c16211d6226dbd Liam Girdwood 2019-04-12 198 ret = sof_machine_check(sdev); c16211d6226dbd Liam Girdwood 2019-04-12 199 if (ret < 0) { c16211d6226dbd Liam Girdwood 2019-04-12 200 dev_err(sdev->dev, "error: failed to get machine info %d\n", c16211d6226dbd Liam Girdwood 2019-04-12 201 ret); 11fd6d8e097b5b Guennadi Liakhovetski 2021-03-15 202 goto dsp_err; c16211d6226dbd Liam Girdwood 2019-04-12 203 } c16211d6226dbd Liam Girdwood 2019-04-12 204 c16211d6226dbd Liam Girdwood 2019-04-12 205 /* set up platform component driver */ c16211d6226dbd Liam Girdwood 2019-04-12 206 snd_sof_new_platform_drv(sdev); c16211d6226dbd Liam Girdwood 2019-04-12 207 c16211d6226dbd Liam Girdwood 2019-04-12 208 /* register any debug/trace capabilities */ c16211d6226dbd Liam Girdwood 2019-04-12 209 ret = snd_sof_dbg_init(sdev); c16211d6226dbd Liam Girdwood 2019-04-12 210 if (ret < 0) { c16211d6226dbd Liam Girdwood 2019-04-12 211 /* c16211d6226dbd Liam Girdwood 2019-04-12 212 * debugfs issues are suppressed in snd_sof_dbg_init() since c16211d6226dbd Liam Girdwood 2019-04-12 213 * we cannot rely on debugfs c16211d6226dbd Liam Girdwood 2019-04-12 214 * here we trap errors due to memory allocation only. c16211d6226dbd Liam Girdwood 2019-04-12 215 */ c16211d6226dbd Liam Girdwood 2019-04-12 216 dev_err(sdev->dev, "error: failed to init DSP trace/debug %d\n", c16211d6226dbd Liam Girdwood 2019-04-12 217 ret); c16211d6226dbd Liam Girdwood 2019-04-12 218 goto dbg_err; c16211d6226dbd Liam Girdwood 2019-04-12 219 } c16211d6226dbd Liam Girdwood 2019-04-12 220 c16211d6226dbd Liam Girdwood 2019-04-12 221 /* init the IPC */ c16211d6226dbd Liam Girdwood 2019-04-12 222 sdev->ipc = snd_sof_ipc_init(sdev); c16211d6226dbd Liam Girdwood 2019-04-12 223 if (!sdev->ipc) { 7d8785bc7adbb4 Wei Yongjun 2020-05-09 224 ret = -ENOMEM; c16211d6226dbd Liam Girdwood 2019-04-12 225 dev_err(sdev->dev, "error: failed to init DSP IPC %d\n", ret); c16211d6226dbd Liam Girdwood 2019-04-12 226 goto ipc_err; c16211d6226dbd Liam Girdwood 2019-04-12 227 } c16211d6226dbd Liam Girdwood 2019-04-12 228 c16211d6226dbd Liam Girdwood 2019-04-12 229 /* load the firmware */ c16211d6226dbd Liam Girdwood 2019-04-12 230 ret = snd_sof_load_firmware(sdev); c16211d6226dbd Liam Girdwood 2019-04-12 231 if (ret < 0) { c16211d6226dbd Liam Girdwood 2019-04-12 232 dev_err(sdev->dev, "error: failed to load DSP firmware %d\n", c16211d6226dbd Liam Girdwood 2019-04-12 233 ret); e2406275be2b6b Peter Ujfalusi 2021-12-23 234 sof_set_fw_state(sdev, SOF_FW_BOOT_FAILED); c16211d6226dbd Liam Girdwood 2019-04-12 235 goto fw_load_err; c16211d6226dbd Liam Girdwood 2019-04-12 236 } c16211d6226dbd Liam Girdwood 2019-04-12 237 58a5c9a4aa993f Peter Ujfalusi 2021-10-06 238 sof_set_fw_state(sdev, SOF_FW_BOOT_IN_PROGRESS); 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 239 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 240 /* 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 241 * Boot the firmware. The FW boot status will be modified 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 242 * in snd_sof_run_firmware() depending on the outcome. 6ca5cecbd1c175 Ranjani Sridharan 2019-12-17 243 */ c16211d6226dbd Liam Girdwood 2019-04-12 244 ret = snd_sof_run_firmware(sdev); c16211d6226dbd Liam Girdwood 2019-04-12 245 if (ret < 0) { c16211d6226dbd Liam Girdwood 2019-04-12 246 dev_err(sdev->dev, "error: failed to boot DSP firmware %d\n", c16211d6226dbd Liam Girdwood 2019-04-12 247 ret); e2406275be2b6b Peter Ujfalusi 2021-12-23 248 sof_set_fw_state(sdev, SOF_FW_BOOT_FAILED); c16211d6226dbd Liam Girdwood 2019-04-12 249 goto fw_run_err; c16211d6226dbd Liam Girdwood 2019-04-12 250 } c16211d6226dbd Liam Girdwood 2019-04-12 251 12b401f4de7876 Peter Ujfalusi 2021-12-23 252 if (sof_debug_check_flag(SOF_DBG_ENABLE_TRACE)) { 2ab4c50f695551 Pierre-Louis Bossart 2019-09-27 253 sdev->dtrace_is_supported = true; 2ab4c50f695551 Pierre-Louis Bossart 2019-09-27 254 c16211d6226dbd Liam Girdwood 2019-04-12 255 /* init DMA trace */ c16211d6226dbd Liam Girdwood 2019-04-12 256 ret = snd_sof_init_trace(sdev); c16211d6226dbd Liam Girdwood 2019-04-12 257 if (ret < 0) { c16211d6226dbd Liam Girdwood 2019-04-12 258 /* non fatal */ c16211d6226dbd Liam Girdwood 2019-04-12 259 dev_warn(sdev->dev, 2ab4c50f695551 Pierre-Louis Bossart 2019-09-27 260 "warning: failed to initialize trace %d\n", 2ab4c50f695551 Pierre-Louis Bossart 2019-09-27 261 ret); 2ab4c50f695551 Pierre-Louis Bossart 2019-09-27 262 } 2ab4c50f695551 Pierre-Louis Bossart 2019-09-27 263 } else { 2ab4c50f695551 Pierre-Louis Bossart 2019-09-27 264 dev_dbg(sdev->dev, "SOF firmware trace disabled\n"); c16211d6226dbd Liam Girdwood 2019-04-12 265 } c16211d6226dbd Liam Girdwood 2019-04-12 266 c16211d6226dbd Liam Girdwood 2019-04-12 267 /* hereafter all FW boot flows are for PM reasons */ c16211d6226dbd Liam Girdwood 2019-04-12 268 sdev->first_boot = false; c16211d6226dbd Liam Girdwood 2019-04-12 269 c16211d6226dbd Liam Girdwood 2019-04-12 270 /* now register audio DSP platform driver and dai */ c16211d6226dbd Liam Girdwood 2019-04-12 271 ret = devm_snd_soc_register_component(sdev->dev, &sdev->plat_drv, c16211d6226dbd Liam Girdwood 2019-04-12 272 sof_ops(sdev)->drv, c16211d6226dbd Liam Girdwood 2019-04-12 273 sof_ops(sdev)->num_drv); c16211d6226dbd Liam Girdwood 2019-04-12 274 if (ret < 0) { c16211d6226dbd Liam Girdwood 2019-04-12 275 dev_err(sdev->dev, c16211d6226dbd Liam Girdwood 2019-04-12 276 "error: failed to register DSP DAI driver %d\n", ret); 37e97e6faeabda Pierre-Louis Bossart 2020-01-24 277 goto fw_trace_err; c16211d6226dbd Liam Girdwood 2019-04-12 278 } c16211d6226dbd Liam Girdwood 2019-04-12 279 285880a23d105e Daniel Baluta 2019-12-04 280 ret = snd_sof_machine_register(sdev, plat_data); 3bcae98e101727 Peter Ujfalusi 2021-04-09 281 if (ret < 0) { 3bcae98e101727 Peter Ujfalusi 2021-04-09 282 dev_err(sdev->dev, 3bcae98e101727 Peter Ujfalusi 2021-04-09 283 "error: failed to register machine driver %d\n", ret); 37e97e6faeabda Pierre-Louis Bossart 2020-01-24 284 goto fw_trace_err; 3bcae98e101727 Peter Ujfalusi 2021-04-09 285 } c16211d6226dbd Liam Girdwood 2019-04-12 286 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 @287 ret = sof_register_clients(sdev); 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 288 if (ret < 0) { 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 289 dev_err(sdev->dev, "failed to register clients %d\n", ret); 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 290 goto sof_machine_err; 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 291 } 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 292 8c583f526ee9df Ranjani Sridharan 2019-12-04 293 /* 8c583f526ee9df Ranjani Sridharan 2019-12-04 294 * Some platforms in SOF, ex: BYT, may not have their platform PM 8c583f526ee9df Ranjani Sridharan 2019-12-04 295 * callbacks set. Increment the usage count so as to 8c583f526ee9df Ranjani Sridharan 2019-12-04 296 * prevent the device from entering runtime suspend. 8c583f526ee9df Ranjani Sridharan 2019-12-04 297 */ 8c583f526ee9df Ranjani Sridharan 2019-12-04 298 if (!sof_ops(sdev)->runtime_suspend || !sof_ops(sdev)->runtime_resume) 8c583f526ee9df Ranjani Sridharan 2019-12-04 299 pm_runtime_get_noresume(sdev->dev); 8c583f526ee9df Ranjani Sridharan 2019-12-04 300 c16211d6226dbd Liam Girdwood 2019-04-12 301 if (plat_data->sof_probe_complete) c16211d6226dbd Liam Girdwood 2019-04-12 302 plat_data->sof_probe_complete(sdev->dev); c16211d6226dbd Liam Girdwood 2019-04-12 303 271d9373db1c76 Kai Vehmanen 2021-02-10 304 sdev->probe_completed = true; 271d9373db1c76 Kai Vehmanen 2021-02-10 305 c16211d6226dbd Liam Girdwood 2019-04-12 306 return 0; c16211d6226dbd Liam Girdwood 2019-04-12 307 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 308 sof_machine_err: 6955d9512d0ea8 Peter Ujfalusi 2022-02-10 309 snd_sof_machine_unregister(sdev, plat_data); 37e97e6faeabda Pierre-Louis Bossart 2020-01-24 310 fw_trace_err: 37e97e6faeabda Pierre-Louis Bossart 2020-01-24 311 snd_sof_free_trace(sdev); c16211d6226dbd Liam Girdwood 2019-04-12 312 fw_run_err: c16211d6226dbd Liam Girdwood 2019-04-12 313 snd_sof_fw_unload(sdev); c16211d6226dbd Liam Girdwood 2019-04-12 314 fw_load_err: c16211d6226dbd Liam Girdwood 2019-04-12 315 snd_sof_ipc_free(sdev); c16211d6226dbd Liam Girdwood 2019-04-12 316 ipc_err: c16211d6226dbd Liam Girdwood 2019-04-12 317 dbg_err: 11fd6d8e097b5b Guennadi Liakhovetski 2021-03-15 318 snd_sof_free_debug(sdev); 11fd6d8e097b5b Guennadi Liakhovetski 2021-03-15 319 dsp_err: c16211d6226dbd Liam Girdwood 2019-04-12 320 snd_sof_remove(sdev); 0bce512e784d13 Pierre-Louis Bossart 2019-05-24 321 410e5e55c9c1c9 Pierre-Louis Bossart 2020-01-24 322 /* all resources freed, update state to match */ 58a5c9a4aa993f Peter Ujfalusi 2021-10-06 323 sof_set_fw_state(sdev, SOF_FW_BOOT_NOT_STARTED); 410e5e55c9c1c9 Pierre-Louis Bossart 2020-01-24 324 sdev->first_boot = true; c16211d6226dbd Liam Girdwood 2019-04-12 325 c16211d6226dbd Liam Girdwood 2019-04-12 326 return ret; c16211d6226dbd Liam Girdwood 2019-04-12 327 } c16211d6226dbd Liam Girdwood 2019-04-12 328 :::::: The code at line 135 was first introduced by commit :::::: 6955d9512d0ea814f1c2761bef7ad7b3cedf4d68 ASoC: SOF: Introduce IPC SOF client support :::::: TO: Peter Ujfalusi <peter.ujfalusi@xxxxxxxxxxxxxxx> :::::: CC: Mark Brown <broonie@xxxxxxxxxx> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx