0

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?

red0ct
  • 4,840
  • 3
  • 17
  • 44
rajeshsam
  • 169
  • 1
  • 6

1 Answers1

2

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.

Kaz
  • 55,781
  • 9
  • 100
  • 149
  • So, flag has information about only whether interrupt processing is enabled or not? – rajeshsam Jun 06 '19 at 16:54
  • Yes; any CPU flags or whatever that has to be saved and restored in relation to interrupt processing. – Kaz Jun 06 '19 at 17:01