Hi Ricardo,
I love your patch! Yet something to improve:
[auto build test ERROR on 4312098baf37ee17a8350725e6e0d0e8590252d4]
url: https://github.com/intel-lab-lkp/linux/commits/Ricardo-Ribalda/ALSA-core-Fix... base: 4312098baf37ee17a8350725e6e0d0e8590252d4 patch link: https://lore.kernel.org/r/20221127-snd-freeze-v1-0-57461a366ec2%40chromium.o... patch subject: [PATCH] ALSA: core: Fix deadlock when shutdown a frozen userspace config: openrisc-randconfig-r003-20221128 compiler: or1k-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/1db83cb7b8d5d82de1492f028c45f4... git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Ricardo-Ribalda/ALSA-core-Fix-deadlock-when-shutdown-a-frozen-userspace/20221128-063051 git checkout 1db83cb7b8d5d82de1492f028c45f47a83cd2b67 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=openrisc SHELL=/bin/bash sound/core/
If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot lkp@intel.com
All errors (new ones prefixed by >>):
sound/core/init.c: In function 'snd_card_disconnect_sync':
sound/core/init.c:577:13: error: 'pm_freezing' undeclared (first use in this function); did you mean 'freezing'?
577 | if (pm_freezing) { | ^~~~~~~~~~~ | freezing sound/core/init.c:577:13: note: each undeclared identifier is reported only once for each function it appears in sound/core/init.c: In function 'snd_card_free': sound/core/init.c:671:13: error: 'pm_freezing' undeclared (first use in this function); did you mean 'freezing'? 671 | if (pm_freezing) | ^~~~~~~~~~~ | freezing
vim +577 sound/core/init.c
555 556 /** 557 * snd_card_disconnect_sync - disconnect card and wait until files get closed 558 * @card: card object to disconnect 559 * 560 * This calls snd_card_disconnect() for disconnecting all belonging components 561 * and waits until all pending files get closed. 562 * It assures that all accesses from user-space finished so that the driver 563 * can release its resources gracefully. 564 */ 565 void snd_card_disconnect_sync(struct snd_card *card) 566 { 567 int err; 568 569 err = snd_card_disconnect(card); 570 if (err < 0) { 571 dev_err(card->dev, 572 "snd_card_disconnect error (%d), skipping sync\n", 573 err); 574 return; 575 } 576
577 if (pm_freezing) {
578 dev_err(card->dev, "Userspace is frozen, skipping sync\n"); 579 return; 580 } 581 582 spin_lock_irq(&card->files_lock); 583 wait_event_lock_irq(card->remove_sleep, 584 list_empty(&card->files_list), 585 card->files_lock); 586 spin_unlock_irq(&card->files_lock); 587 } 588 EXPORT_SYMBOL_GPL(snd_card_disconnect_sync); 589