IB/qib: Fix potential deadlock with link down interrupt
authorRam Vepa <ram.vepa@qlogic.com>
Fri, 27 May 2011 13:41:55 +0000 (13:41 +0000)
committerRoland Dreier <roland@purestorage.com>
Mon, 18 Jul 2011 19:09:23 +0000 (12:09 -0700)
commit4356d0b64b9be53c507f66c572c1e275b4529239
tree58c15fe0987ae06873f2fe8a1b188db73fbaf796
parent2df4f7579d212e8e0df7c8a24f57bf90f23fd516
IB/qib: Fix potential deadlock with link down interrupt

There is a possibility of a deadlock due to the way locks are
acquired and released in qib_set_uevent_bits(). The function
qib_set_uevent_bits() is called in process context and it uses
spin_lock() and spin_unlock().  This same lock is acquired/released
in interrupt context which can lead to a deadlock when running on
the same cpu.

The fix is to replace spin_lock() and spin_unlock() with
spin_lock_irqsave() and spin_unlock_irqrestore() respectively in
qib_set_uevent_bits().

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/qib/qib_file_ops.c