From: James Bottomley Date: Sat, 23 Feb 2008 20:55:14 +0000 (+0000) Subject: SCSI gdth: don't call pci_free_consistent under spinlock X-Git-Tag: v2.6.24.4~51 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=461bab342d2601c5e032f85b27e66beafef66ff8;p=karo-tx-linux.git SCSI gdth: don't call pci_free_consistent under spinlock commit: ff83efacf2b77a1fe8942db6613825a4b80ee5e2 The spinlock is held over too large a region: pscratch is a permanent address (it's allocated at boot time and never changes). All you need the smp lock for is mediating the scratch in use flag, so fix this by moving the spinlock into the case where we set the pscratch_busy flag to false. Signed-off-by: James Bottomley Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c index de5773443c62..ce0228e26aec 100644 --- a/drivers/scsi/gdth_proc.c +++ b/drivers/scsi/gdth_proc.c @@ -694,15 +694,13 @@ static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, ulong64 paddr) { ulong flags; - spin_lock_irqsave(&ha->smp_lock, flags); - if (buf == ha->pscratch) { + spin_lock_irqsave(&ha->smp_lock, flags); ha->scratch_busy = FALSE; + spin_unlock_irqrestore(&ha->smp_lock, flags); } else { pci_free_consistent(ha->pdev, size, buf, paddr); } - - spin_unlock_irqrestore(&ha->smp_lock, flags); } #ifdef GDTH_IOCTL_PROC