From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: [PATCH] qla2xxx: spin_unlock_irq in IRQ context Date: Tue, 9 Jan 2007 05:29:23 -0700 Message-ID: <20070109122923.GA9819@parisc-linux.org> References: <6.0.0.20.2.20070109140514.02ea25e0@172.19.0.2> <1168327639.2824.46.camel@mulgrave.il.steeleye.com> <6.0.0.20.2.20070109162928.02ea3500@172.19.0.2> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from palinux.external.hp.com ([192.25.206.14]:42701 "EHLO mail.parisc-linux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751371AbXAIM3Z (ORCPT ); Tue, 9 Jan 2007 07:29:25 -0500 Content-Disposition: inline In-Reply-To: <6.0.0.20.2.20070109162928.02ea3500@172.19.0.2> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: Hisashi Hifumi Cc: James Bottomley , andrew.vasquez@qlogic.com, linux-scsi@vger.kernel.org On Tue, Jan 09, 2007 at 04:46:34PM +0900, Hisashi Hifumi wrote: > Hi > > >If the function can be called with interrupts disabled as well as > >enabled, then the spin_lock_irq needs to become a spin_lock_irqsave() > >which is the correct API for this case. > > I know that spin_lock_irqsave()/spin_unlock_irqrestore() is correct . > But in this case, many places need to be modified to use > spin_lock_irqsave()/spin_unlock_irqrestore().Because > spin_lock_irqsave()/spin_unlock_irqrestore() is not in the same function, > and it is needed to pass eflags. > > So I use in_irq() to distinguish between IRQ and process context and > minimize modifications. Why do we need to re-enable interrupts here? Can't we just spin_unlock() / spin_lock()? Actually, I don't see why we need to drop the lock here ... starget_for_each_device can be called under a spinlock. qla2x00_adjust_sdev_qdepth_up() only calls scsi_adjust_queue_depth(). Is there an AB-BA issue with hardware_lock and request_queue->queue_lock?