From: "Nicholas A. Bellinger" Subject: [PATCH 07/11] fnic: Convert to host_lock less w/ interrupts disabled externally Date: Wed, 17 Nov 2010 14:19:18 -0800 Message-ID: <1290032358-4979-1-git-send-email-nab@linux-iscsi.org> Return-path: Received: from nm8-vm0.bullet.mail.ac4.yahoo.com ([98.139.52.230]:21752 "HELO nm8-vm0.bullet.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S933707Ab0KQWTZ (ORCPT ); Wed, 17 Nov 2010 17:19:25 -0500 Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: linux-scsi , Jeff Garzik , James Bottomley , Christoph Hellwig Cc: Mike Christie , Ravi Anand , Andrew Vasquez , Joe Eykholt , James Smart , Vasu Dev , Tim Chen , Andi Kleen , Tejun Heo , Mike Anderson , MPTFusionLinux , Nicholas Bellinger From: Nicholas Bellinger This patch converts fnic to run in host_lock less mode with the new IRQ_DISABLE_SCSI_QCMD() that disables interrupts while calling ->queuecommand() dispatch. It also drops the legacy host_lock unlock optimization. Signed-off-by: Nicholas A. Bellinger --- drivers/scsi/fnic/fnic_scsi.c | 14 +++----------- 1 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 22d0240..9f51beb 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -349,7 +349,8 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic, * Routine to send a scsi cdb * Called with host_lock held and interrupts disabled. */ -static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) +static int fnic_queuecommand_irq_disable(struct scsi_cmnd *sc, + void (*done)(struct scsi_cmnd *)) { struct fc_lport *lp; struct fc_rport *rport; @@ -373,13 +374,6 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ if (lp->state != LPORT_ST_READY || !(lp->link_up)) return SCSI_MLQUEUE_HOST_BUSY; - /* - * Release host lock, use driver resource specific locks from here. - * Don't re-enable interrupts in case they were disabled prior to the - * caller disabling them. - */ - spin_unlock(lp->host->host_lock); - /* Get a new io_req for this SCSI IO */ fnic = lport_priv(lp); @@ -452,12 +446,10 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ } } out: - /* acquire host lock before returning to SCSI */ - spin_lock(lp->host->host_lock); return ret; } -DEF_SCSI_QCMD(fnic_queuecommand) +IRQ_DISABLE_SCSI_QCMD(fnic_queuecommand) /* * fnic_fcpio_fw_reset_cmpl_handler -- 1.7.2.3