UIO: Fix concurrency issue
authorVitalii Demianets <vitas@nppfactor.kiev.ua>
Thu, 20 Jun 2013 13:36:00 +0000 (16:36 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Jun 2013 23:31:21 +0000 (16:31 -0700)
In a SMP case there was a race condition issue between
uio_pdrv_genirq_irqcontrol() running on one CPU and irq handler on
another CPU. Fix it by spin_locking shared resources access inside irq
handler.  Also:
  - Change disable_irq to disable_irq_nosync to avoid deadlock, because
    disable_irq waits for the completion of the irq handler;
  - Change atomic bit-manipulation routines to their non-atomic
    counterparts as we already are guarding the code by spinlock.

Signed-off-by: Vitalii Demianets <vitas@nppfactor.kiev.ua>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

No differences found