diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-05-28 07:47:39 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-17 13:04:37 -0400 |
commit | e3df715501be3329986e5d9dfa9a477f49e7996b (patch) | |
tree | 3602c4bbca8bca9b615b93099de53717bc932591 | |
parent | 12021fff2bae7fab01c4bf283f3cd9bc6997d8c4 (diff) |
[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 <James.Bottomley@SteelEye.com>
-rw-r--r-- | drivers/fc4/fc.c | 4 | ||||
-rw-r--r-- | drivers/ieee1394/sbp2.c | 6 | ||||
-rw-r--r-- | drivers/scsi/ultrastor.c | 2 |
3 files changed, 0 insertions, 12 deletions
diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c index 1fbb219aa9ba..d9e11b536659 100644 --- a/drivers/fc4/fc.c +++ b/drivers/fc4/fc.c | |||
@@ -767,10 +767,8 @@ static void fcp_scsi_done (Scsi_Cmnd *SCpnt) | |||
767 | { | 767 | { |
768 | unsigned long flags; | 768 | unsigned long flags; |
769 | 769 | ||
770 | spin_lock_irqsave(SCpnt->device->host->host_lock, flags); | ||
771 | if (FCP_CMND(SCpnt)->done) | 770 | if (FCP_CMND(SCpnt)->done) |
772 | FCP_CMND(SCpnt)->done(SCpnt); | 771 | FCP_CMND(SCpnt)->done(SCpnt); |
773 | spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags); | ||
774 | } | 772 | } |
775 | 773 | ||
776 | static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, int prepare) | 774 | 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) | |||
912 | unsigned long flags; | 910 | unsigned long flags; |
913 | 911 | ||
914 | SCpnt->result = DID_ABORT; | 912 | SCpnt->result = DID_ABORT; |
915 | spin_lock_irqsave(SCpnt->device->host->host_lock, flags); | ||
916 | fcmd->done(SCpnt); | 913 | fcmd->done(SCpnt); |
917 | spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags); | ||
918 | printk("FC: soft abort\n"); | 914 | printk("FC: soft abort\n"); |
919 | return SUCCESS; | 915 | return SUCCESS; |
920 | } else { | 916 | } else { |
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index aa941025072e..de552486b1c9 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, | |||
2453 | u32 scsi_status, struct scsi_cmnd *SCpnt, | 2453 | u32 scsi_status, struct scsi_cmnd *SCpnt, |
2454 | void (*done)(struct scsi_cmnd *)) | 2454 | void (*done)(struct scsi_cmnd *)) |
2455 | { | 2455 | { |
2456 | unsigned long flags; | ||
2457 | |||
2458 | SBP2_DEBUG("sbp2scsi_complete_command"); | 2456 | SBP2_DEBUG("sbp2scsi_complete_command"); |
2459 | 2457 | ||
2460 | /* | 2458 | /* |
@@ -2553,11 +2551,7 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id, | |||
2553 | /* | 2551 | /* |
2554 | * Tell scsi stack that we're done with this command | 2552 | * Tell scsi stack that we're done with this command |
2555 | */ | 2553 | */ |
2556 | spin_lock_irqsave(scsi_id->scsi_host->host_lock,flags); | ||
2557 | done (SCpnt); | 2554 | done (SCpnt); |
2558 | spin_unlock_irqrestore(scsi_id->scsi_host->host_lock,flags); | ||
2559 | |||
2560 | return; | ||
2561 | } | 2555 | } |
2562 | 2556 | ||
2563 | 2557 | ||
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index 97f4d9112b48..2c17470a229d 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c | |||
@@ -954,9 +954,7 @@ static int ultrastor_abort(Scsi_Cmnd *SCpnt) | |||
954 | SCpnt->result = DID_ABORT << 16; | 954 | SCpnt->result = DID_ABORT << 16; |
955 | 955 | ||
956 | /* Take the host lock to guard against scsi layer re-entry */ | 956 | /* Take the host lock to guard against scsi layer re-entry */ |
957 | spin_lock_irqsave(host->host_lock, flags); | ||
958 | done(SCpnt); | 957 | done(SCpnt); |
959 | spin_unlock_irqrestore(host->host_lock, flags); | ||
960 | 958 | ||
961 | /* Need to set a timeout here in case command never completes. */ | 959 | /* Need to set a timeout here in case command never completes. */ |
962 | return SUCCESS; | 960 | return SUCCESS; |