Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68b3aa7c authored by Jeff Garzik 's avatar Jeff Garzik
Browse files

[SCSI] allow sleeping in ->eh_bus_reset_handler()

parent 94d0e7b8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -954,8 +954,7 @@ Details:
 *
 *      Returns SUCCESS if command aborted else FAILED
 *
 *      Locks: struct Scsi_Host::host_lock held (with irqsave) on entry 
 *      and assumed to be held on return.
 *      Locks: None held
 *
 *      Calling context: kernel thread
 *
+3 −0
Original line number Diff line number Diff line
@@ -983,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);

+1 −2
Original line number Diff line number Diff line
@@ -1865,7 +1865,6 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
		hd->timeouts++;

	/* We are now ready to execute the task management request. */
	spin_unlock_irq(host_lock);
	if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS,
		SCpnt->device->channel, 0, 0, 0, 5 /* 5 second timeout */)
	    < 0){
@@ -1881,7 +1880,7 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
		spin_lock_irq(host_lock);
		return FAILED;
	}
	spin_lock_irq(host_lock);

	return SUCCESS;
}

+0 −3
Original line number Diff line number Diff line
@@ -731,8 +731,6 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt)
	struct zfcp_unit *unit;
	struct Scsi_Host *scsi_host = scpnt->device->host;

	spin_unlock_irq(scsi_host->host_lock);

	unit = (struct zfcp_unit *) scpnt->device->hostdata;
	ZFCP_LOG_NORMAL("bus reset because of problems with "
			"unit 0x%016Lx\n", unit->fcp_lun);
@@ -740,7 +738,6 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt)
	zfcp_erp_wait(unit->port->adapter);
	retval = SUCCESS;

	spin_lock_irq(scsi_host->host_lock);
	return retval;
}

+8 −1
Original line number Diff line number Diff line
@@ -1957,23 +1957,30 @@ NCR_700_bus_reset(struct scsi_cmnd * SCp)
	printk(KERN_INFO "scsi%d (%d:%d) New error handler wants BUS reset, cmd %p\n\t",
	       SCp->device->host->host_no, SCp->device->id, SCp->device->lun, SCp);
	scsi_print_command(SCp);

	/* In theory, eh_complete should always be null because the
	 * eh is single threaded, but just in case we're handling a
	 * reset via sg or something */
	spin_lock_irq(SCp->device->host->host_lock);
	while (hostdata->eh_complete != NULL) {
		spin_unlock_irq(SCp->device->host->host_lock);
		msleep_interruptible(100);
		spin_lock_irq(SCp->device->host->host_lock);
	}

	hostdata->eh_complete = &complete;
	NCR_700_internal_bus_reset(SCp->device->host);

	spin_unlock_irq(SCp->device->host->host_lock);
	wait_for_completion(&complete);
	spin_lock_irq(SCp->device->host->host_lock);

	hostdata->eh_complete = NULL;
	/* Revalidate the transport parameters of the failing device */
	if(hostdata->fast)
		spi_schedule_dv_device(SCp->device);

	spin_unlock_irq(SCp->device->host->host_lock);
	return SUCCESS;
}

Loading