diff options
Diffstat (limited to 'drivers/fc4/fc.c')
-rw-r--r-- | drivers/fc4/fc.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c index 1fbb219aa9ba..fbd9ff79b7b8 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 { @@ -987,7 +983,10 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt) fc->rst_pkt->request->rq_status = RQ_SCSI_BUSY; fc->rst_pkt->done = fcp_scsi_reset_done; + + spin_lock_irqsave(SCpnt->device->host->host_lock, flags); fcp_scsi_queue_it(fc, fc->rst_pkt, fcmd, 0); + spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags); down(&sem); @@ -1006,13 +1005,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt) return SUCCESS; } -int fcp_scsi_bus_reset(Scsi_Cmnd *SCpnt) -{ - printk ("FC: bus reset!\n"); - return FAILED; -} - -int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt) +static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt) { fc_channel *fc = FC_SCMND(SCpnt); fcp_cmnd *fcmd = FCP_CMND(SCpnt); @@ -1033,6 +1026,17 @@ int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt) else return FAILED; } +int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt) +{ + int rc; + + spin_lock_irqsave(SCpnt->device->host->host_lock, flags); + rc = __fcp_scsi_host_reset(SCpnt); + spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags); + + return rc; +} + static int fcp_els_queue_it(fc_channel *fc, fcp_cmnd *fcmd) { long i; |