Re: [PATCH 03/11] ALSA: hda: Add lock around codec->registered flag manipulations

From: kernel test robot

Date: Fri Oct 09 2026 - 07:03:24 EST


Hi Takashi,

kernel test robot noticed the following build errors:

[auto build test ERROR on tiwai-sound/for-next]
[also build test ERROR on next-20261008]
[cannot apply to tiwai-sound/for-linus broonie-sound/for-next linus/master v7.3-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Takashi-Iwai/ALSA-hda-intel-Cancel-delayed-work-at-shutdown-too/20261008-212541
base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
patch link: https://lore.kernel.org/r/20261008192553.300025-4-tiwai%40suse.de
patch subject: [PATCH 03/11] ALSA: hda: Add lock around codec->registered flag manipulations
config: i386-defconfig (https://download.01.org/0day-ci/archive/20261009/202610092046.7N0li03i-lkp@xxxxxxxxx/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261009/202610092046.7N0li03i-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610092046.7N0li03i-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> sound/hda/common/codec.c:764:18: error: use of undeclared identifier 'bus'
764 | spin_lock_irq(&bus->reg_lock);
| ^~~
sound/hda/common/codec.c:766:20: error: use of undeclared identifier 'bus'
766 | spin_unlock_irq(&bus->reg_lock);
| ^~~
sound/hda/common/codec.c:820:18: error: use of undeclared identifier 'bus'
820 | spin_lock_irq(&bus->reg_lock);
| ^~~
sound/hda/common/codec.c:822:20: error: use of undeclared identifier 'bus'
822 | spin_unlock_irq(&bus->reg_lock);
| ^~~
4 errors generated.


vim +/bus +764 sound/hda/common/codec.c

753
754 /**
755 * snd_hda_codec_cleanup_for_unbind - Prepare codec for removal
756 * @codec: codec device to cleanup
757 */
758 void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec)
759 {
760 if (codec->core.registered) {
761 /* pm_runtime_put() is called in snd_hdac_device_exit() */
762 pm_runtime_get_noresume(hda_codec_dev(codec));
763 pm_runtime_disable(hda_codec_dev(codec));
> 764 spin_lock_irq(&bus->reg_lock);
765 codec->core.registered = false;
766 spin_unlock_irq(&bus->reg_lock);
767 }
768
769 snd_hda_codec_disconnect_pcms(codec);
770 cancel_delayed_work_sync(&codec->jackpoll_work);
771 if (!codec->in_freeing)
772 snd_hda_ctls_clear(codec);
773 codec_release_pcms(codec);
774 snd_hda_detach_beep_device(codec);
775 snd_hda_jack_tbl_clear(codec);
776 codec->proc_widget_hook = NULL;
777 codec->spec = NULL;
778
779 /* free only driver_pins so that init_pins + user_pins are restored */
780 snd_array_free(&codec->driver_pins);
781 snd_array_free(&codec->cvt_setups);
782 snd_array_free(&codec->spdif_out);
783 snd_array_free(&codec->verbs);
784 codec->follower_dig_outs = NULL;
785 codec->spdif_status_reset = 0;
786 snd_array_free(&codec->mixers);
787 snd_array_free(&codec->nids);
788 remove_conn_list(codec);
789 snd_hdac_regmap_exit(&codec->core);
790 codec->configured = 0;
791 snd_refcount_init(&codec->pcm_ref); /* reset refcount */
792 }
793 EXPORT_SYMBOL_GPL(snd_hda_codec_cleanup_for_unbind);
794

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki