From: Jeff Garzik Date: Sat, 28 May 2005 11:47:39 +0000 (-0400) Subject: [SCSI] Remove unnecessary locking around completion function calls X-Git-Tag: v2.6.13-rc1~90^2~583^2~62^2^2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3df715501be3329986e5d9dfa9a477f49e7996b;p=linux-2.6 [SCSI] Remove unnecessary locking around completion function calls The SCSI ->done() hook should not be called from inside a spinlock. Drivers that do this are mostly cut-n-paste from 2.2.x-era. Signed-off-by: James Bottomley --- diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c index 1fbb219aa9..d9e11b5366 100644 --- a/drivers/fc4/fc.c +++ b/drivers/fc4/fc.c @@ -767,10 +767,8 @@ static void fcp_scsi_done (Scsi_Cmnd *SCpnt) { unsigned long flags; - spin_lock_irqsave(SCpnt->device->host->host_lock, flags); if (FCP_CMND(SCpnt)->done) FCP_CMND(SCpnt)->done(SCpnt); - spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags); } static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, int prepare) @@ -912,9 +910,7 @@ int fcp_scsi_abort(Scsi_Cmnd *SCpnt) unsigned long flags; SCpnt->result = DID_ABORT; - spin_lock_irqsave(SCpnt->device->host->host_lock, flags); fcmd->done(SCpnt); - spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags); printk("FC: soft abort\n"); return SUCCESS; } else { diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index aa94102507..de552486b1 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c @@ -2453,8 +2453,6 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id, u32 scsi_status, struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { - unsigned long flags; - SBP2_DEBUG("sbp2scsi_complete_command"); /* @@ -2553,11 +2551,7 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id, /* * Tell scsi stack that we're done with this command */ - spin_lock_irqsave(scsi_id->scsi_host->host_lock,flags); done (SCpnt); - spin_unlock_irqrestore(scsi_id->scsi_host->host_lock,flags); - - return; } diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index 97f4d9112b..2c17470a22 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c @@ -954,9 +954,7 @@ static int ultrastor_abort(Scsi_Cmnd *SCpnt) SCpnt->result = DID_ABORT << 16; /* Take the host lock to guard against scsi layer re-entry */ - spin_lock_irqsave(host->host_lock, flags); done(SCpnt); - spin_unlock_irqrestore(host->host_lock, flags); /* Need to set a timeout here in case command never completes. */ return SUCCESS;