Skip to contentSkip to conversation

Why use spin_lock or spin_lock_irq in trigger callback (audio capture)?

DISCUSSION Yiliang Bao 2 participants 2 messages Feb 25, 2010 – Feb 26, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

I looked at some PCI audio capture driver like BT878 (sound/pci/bt87x.c) or SAA7134 (drivers/media/video/saa7134-alsa.c), I found that spin_lock instead of spin_lock_irq (or spin_lock_irqsave) is used in trigger function. Is there any reason for that?

Thanks,
Yiliang

#1 lore raw
Quoted 4 lines · Yiliang Bao

I looked at some PCI audio capture driver like BT878 (sound/pci/bt87x.c) or SAA7134 (drivers/media/video/saa7134-alsa.c), I found that spin_lock instead of spin_lock_irq (or spin_lock_irqsave) is used in trigger function. Is there any reason for that?

Yes, the trigger callback is called with interrupts already disabled.
http://www.alsa-project.org/~tiwai/writing-an-alsa-driver/ch05s08.html

Regards,
Clemens