linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tmscsim: spin_unlock_irq in interrupt handler fix
@ 2012-07-21  6:48 Denis Efremov
  2012-07-31  8:21 ` Guennadi Liakhovetski
  2012-07-31 11:53 ` [PATCH v2] " Denis Efremov
  0 siblings, 2 replies; 4+ messages in thread
From: Denis Efremov @ 2012-07-21  6:48 UTC (permalink / raw)
  To: Kurt Garloff
  Cc: Denis Efremov, Guennadi Liakhovetski, James E.J. Bottomley,
	linux-scsi, linux-kernel

The replacement of spin_lock_irq/spin_unlock_irq pair in interrupt
handler by spin_lock_irqsave/spin_lock_irqrestore pair.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <yefremov.denis@gmail.com>
---
 drivers/scsi/tmscsim.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c
index a1baccc..0b9d68a 100644
--- a/drivers/scsi/tmscsim.c
+++ b/drivers/scsi/tmscsim.c
@@ -654,6 +654,7 @@ DC390_Interrupt(void *dev_id)
     u8  phase;
     void   (*stateV)( struct dc390_acb*, struct dc390_srb*, u8 *);
     u8  istate, istatus;
+    unsigned long flags;
 
     sstatus = DC390_read8 (Scsi_Status);
     if( !(sstatus & INTERRUPT) )
@@ -665,7 +666,7 @@ DC390_Interrupt(void *dev_id)
     //dstatus = DC390_read8 (DMA_Status);
     //DC390_write32 (DMA_ScsiBusCtrl, EN_INT_ON_PCI_ABORT);
 
-    spin_lock_irq(pACB->pScsiHost->host_lock);
+    spin_lock_irqsave(pACB->pScsiHost->host_lock, flags);
 
     istate = DC390_read8 (Intern_State);
     istatus = DC390_read8 (INT_Status); /* This clears Scsi_Status, Intern_State and INT_Status ! */
@@ -736,7 +737,7 @@ DC390_Interrupt(void *dev_id)
     }
 
  unlock:
-    spin_unlock_irq(pACB->pScsiHost->host_lock);
+    spin_unlock_irqrestore(pACB->pScsiHost->host_lock, flags);
     return IRQ_HANDLED;
 }
 
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-03 23:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-21  6:48 [PATCH] tmscsim: spin_unlock_irq in interrupt handler fix Denis Efremov
2012-07-31  8:21 ` Guennadi Liakhovetski
2012-07-31 11:53 ` [PATCH v2] " Denis Efremov
2012-08-03 23:23   ` Guennadi Liakhovetski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).