Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763290AbYCUWsT (ORCPT ); Fri, 21 Mar 2008 18:48:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762660AbYCUWqM (ORCPT ); Fri, 21 Mar 2008 18:46:12 -0400 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:34721 "EHLO sous-sol.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762635AbYCUWqI (ORCPT ); Fri, 21 Mar 2008 18:46:08 -0400 Message-Id: <20080321224356.256629483@sous-sol.org> References: <20080321224250.144333319@sous-sol.org> User-Agent: quilt/0.46-1 Date: Fri, 21 Mar 2008 15:43:18 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org, jejb@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, James Bottomley , Greg Kroah-Hartman Subject: [patch 28/76] SCSI gdth: dont call pci_free_consistent under spinlock Content-Disposition: inline; filename=scsi-gdth-don-t-call-pci_free_consistent-under-spinlock.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1482 Lines: 45 -stable review patch. If anyone has any objections, please let us know. --------------------- From: James Bottomley 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 --- drivers/scsi/gdth_proc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/scsi/gdth_proc.c +++ b/drivers/scsi/gdth_proc.c @@ -694,15 +694,13 @@ static void gdth_ioctl_free(gdth_ha_str { 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 -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/