[SCSI] allow sleeping in ->eh_bus_reset_handler()
[safe/jmp/linux-2.6] / drivers / scsi / lpfc / lpfc_scsi.c
index 13da268..f2aff3f 100644 (file)
@@ -1054,7 +1054,7 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
  * Note: midlayer calls this function with the host_lock held
  */
 static int
-lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
+__lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
 {
        struct Scsi_Host *shost = cmnd->device->host;
        struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0];
@@ -1144,6 +1144,16 @@ out:
 }
 
 static int
+lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
+{
+       int rc;
+       spin_lock_irq(cmnd->device->host->host_lock);
+       rc = __lpfc_reset_bus_handler(cmnd);
+       spin_unlock_irq(cmnd->device->host->host_lock);
+       return rc;
+}
+
+static int
 lpfc_slave_alloc(struct scsi_device *sdev)
 {
        struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata[0];