rajeshsam
rajeshsam

Reputation: 179

What information does flag argument in spin_lock_irqsave save?

I know irqsave version of spinlock notes down the interrupt state while taking lock and restore interrupt state while releasing the lock.

My doubt is, say if there are 10 interrupt vectors in total and 2 of them are in disabled state (assume a device driver has disabled these two interrupt vectors) while taking lock using irqsave variant. Does the flag argument of spin_lock_irqsave() note down interrupt states and enables only the 8 interrupt during restore? What if those 2 disabled interrupts are enabled from other CPUs after the state is saved in flag argument?

Upvotes: 0

Views: 756

Answers (1)

Kaz
Kaz

Reputation: 58550

The spin_lock_irqsave function does not mask and unmask specific interrupt sources; it disables the processing of all maskable interrupts on the calling processor. Interrupt spinlocks create critical regions of code that are uninterruptible.

Upvotes: 2

Related Questions