[SCSI] allow sleeping in ->eh_host_reset_handler()
[sfrench/cifs-2.6.git] / drivers / fc4 / fc.c
index cdea598d0c1b9d12a9b00293bcbd2fcf8fe547d7..fbd9ff79b7b8cb98bdfa5b788033909e84b5b399 100644 (file)
@@ -1005,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);
@@ -1032,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;