I want to update a data structure atomically in both process context (in queuecommand function to be specific) and timer function. In process context, should I use spin_lock_bh
or spin_lock_irq
or just spin_lock
?
As per my understanding, we should use spin_lock_bh
in queuecommand (process context) and just spin_lock
in timer function. Am I correct?