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

Commit 8fa728a2 authored by Jeff Garzik 's avatar Jeff Garzik
Browse files

[SCSI] allow sleeping in ->eh_abort_handler()

parent 3471c288
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -936,8 +936,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
 *
+0 −5
Original line number Diff line number Diff line
@@ -1707,7 +1707,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
	MPT_FRAME_HDR	*mf;
	u32		 ctx2abort;
	int		 scpnt_idx;
	spinlock_t	*host_lock = SCpnt->device->host->host_lock;

	/* If we can't locate our host adapter structure, return FAILED status.
	 */
@@ -1755,7 +1754,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)

	hd->abortSCpnt = SCpnt;

	spin_unlock_irq(host_lock);
	if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK,
		SCpnt->device->channel, SCpnt->device->id, SCpnt->device->lun,
		ctx2abort, 2 /* 2 second timeout */)
@@ -1772,8 +1770,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
		hd->tmPending = 0;
		hd->tmState = TM_STATE_NONE;

		spin_lock_irq(host_lock);

		/* Unmap the DMA buffers, if any. */
		if (SCpnt->use_sg) {
			pci_unmap_sg(ioc->pcidev, (struct scatterlist *) SCpnt->request_buffer,
@@ -1789,7 +1785,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
		mpt_free_msg_frame(ioc, mf);
		return FAILED;
	}
	spin_lock_irq(host_lock);
	return SUCCESS;
}

+12 −1
Original line number Diff line number Diff line
@@ -433,7 +433,7 @@ zfcp_port_lookup(struct zfcp_adapter *adapter, int channel, scsi_id_t id)
 *		FAILED	- otherwise
 */
int
zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
__zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
{
	int retval = SUCCESS;
	struct zfcp_fsf_req *new_fsf_req, *old_fsf_req;
@@ -611,6 +611,17 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
	return retval;
}

int
zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
{
	int rc;
	struct Scsi_Host *scsi_host = scpnt->device->host;
	spin_lock_irq(scsi_host->host_lock);
	rc = __zfcp_scsi_eh_abort_handler(scpnt);
	spin_unlock_irq(scsi_host->host_lock);
	return rc;
}

/*
 * function:	zfcp_scsi_eh_device_reset_handler
 *
+4 −4
Original line number Diff line number Diff line
@@ -941,7 +941,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
	 */
	cmd->scsi_done = scsi_done;

	ahd_midlayer_entrypoint_lock(ahd, &flags);
	ahd_lock(ahd, &flags);

	/*
	 * Close the race of a command that was in the process of
@@ -955,7 +955,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
		ahd_cmd_set_transaction_status(cmd, CAM_REQUEUE_REQ);
		ahd_linux_queue_cmd_complete(ahd, cmd);
		ahd_schedule_completeq(ahd);
		ahd_midlayer_entrypoint_unlock(ahd, &flags);
		ahd_unlock(ahd, &flags);
		return (0);
	}
	dev = ahd_linux_get_device(ahd, cmd->device->channel,
@@ -965,7 +965,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
		ahd_cmd_set_transaction_status(cmd, CAM_RESRC_UNAVAIL);
		ahd_linux_queue_cmd_complete(ahd, cmd);
		ahd_schedule_completeq(ahd);
		ahd_midlayer_entrypoint_unlock(ahd, &flags);
		ahd_unlock(ahd, &flags);
		printf("%s: aic79xx_linux_queue - Unable to allocate device!\n",
		       ahd_name(ahd));
		return (0);
@@ -979,7 +979,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
		dev->flags |= AHD_DEV_ON_RUN_LIST;
		ahd_linux_run_device_queues(ahd);
	}
	ahd_midlayer_entrypoint_unlock(ahd, &flags);
	ahd_unlock(ahd, &flags);
	return (0);
}

+4 −0
Original line number Diff line number Diff line
@@ -2249,6 +2249,8 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
		printf(" 0x%x", cmd->cmnd[cdb_byte]);
	printf("\n");

	spin_lock_irq(&ahc->platform_data->spin_lock);

	/*
	 * First determine if we currently own this command.
	 * Start by searching the device queue.  If not found
@@ -2503,6 +2505,8 @@ done:
		}
		spin_lock_irq(&ahc->platform_data->spin_lock);
	}

	spin_unlock_irq(&ahc->platform_data->spin_lock);
	return (retval);
}

Loading