[bug report] ALSA: jack: Access input_dev under mutex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Amadeusz Sławiński,

The patch 1b6a6fc5280e: "ALSA: jack: Access input_dev under mutex"
from Apr 12, 2022, leads to the following Smatch static checker
warning:

	sound/core/jack.c:673 snd_jack_report()
	warn: sleeping in atomic context

sound/core/jack.c
    663         jack->hw_status_cache = status;
    664 
    665         list_for_each_entry(jack_kctl, &jack->kctl_list, list)
    666                 if (jack_kctl->sw_inject_enable)
    667                         mask_bits |= jack_kctl->mask_bits;
    668                 else
    669                         snd_kctl_jack_report(jack->card, jack_kctl->kctl,
    670                                              status & jack_kctl->mask_bits);
    671 
    672 #ifdef CONFIG_SND_JACK_INPUT_DEV
--> 673         mutex_lock(&jack->input_dev_lock);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

That patch adds this mutex but we can't take mutex because we're already
holding a spinlock.  The problematic call trees are:

virtsnd_event_notify_cb() <- disables preempt
virtsnd_disable_event_vq() <- disables preempt
-> virtsnd_event_dispatch()
   -> virtsnd_jack_event()
      -> snd_jack_report()

The virtsnd_event_notify_cb() and virtsnd_disable_event_vq() functions
take the spin_lock_irqsave(&queue->lock, flags);

regards,
dan carpenter



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux