@@ -4174,38 +4172,34 @@ static int mpi3mr_eh_dev_reset(struct scsi_cmnd *scmd)
stgt_priv_data = sdev_priv_data->tgt_priv_data;
dev_handle = stgt_priv_data->dev_handle;
if (stgt_priv_data->dev_removed) {
- struct scmd_priv *cmd_priv = scsi_cmd_priv(scmd);
- sdev_printk(KERN_INFO, scmd->device,
+ sdev_printk(KERN_INFO, sdev,
"%s: device(handle = 0x%04x) is removed, device(LUN) reset is not issued\n",
mrioc->name, dev_handle);
- if (!cmd_priv->in_lld_scope || cmd_priv->host_tag == MPI3MR_HOSTTAG_INVALID)
- retval = SUCCESS;
- else
- retval = FAILED;
+ retval = FAILED;
goto out;
}
- sdev_printk(KERN_INFO, scmd->device,
+ sdev_printk(KERN_INFO, sdev,
"Device(lun) Reset is issued to handle(0x%04x)\n", dev_handle);
ret = mpi3mr_issue_tm(mrioc,
MPI3_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET, dev_handle,
sdev_priv_data->lun_id, MPI3MR_HOSTTAG_BLK_TMS,
- MPI3MR_RESETTM_TIMEOUT, &mrioc->host_tm_cmds, &resp_code, scmd);
+ MPI3MR_RESETTM_TIMEOUT, &mrioc->host_tm_cmds, &resp_code, NULL);
if (ret)
goto out;
if (sdev_priv_data->pend_count) {
- sdev_printk(KERN_INFO, scmd->device,
+ sdev_printk(KERN_INFO, sdev,
"%s: device has %d pending commands, device(LUN) reset is failed\n",
mrioc->name, sdev_priv_data->pend_count);
goto out;
}
retval = SUCCESS;
out:
- sdev_printk(KERN_INFO, scmd->device,
- "%s: device(LUN) reset is %s for scmd(%p)\n", mrioc->name,
- ((retval == SUCCESS) ? "SUCCESS" : "FAILED"), scmd);
+ sdev_printk(KERN_INFO, sdev,
+ "%s: device(LUN) reset is %s\n", mrioc->name,
+ ((retval == SUCCESS) ? "SUCCESS" : "FAILED"));
return retval;
}
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index c6dd00b034f4..530a043e40d2 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -3365,9 +3365,9 @@ scsih_abort(struct scsi_cmnd *scmd)
* Return: SUCCESS if command aborted else FAILED
*/
static int
-scsih_dev_reset(struct scsi_cmnd *scmd)
+scsih_dev_reset(struct scsi_device *sdev)
{
- struct MPT3SAS_ADAPTER *ioc = shost_priv(scmd->device->host);
+ struct MPT3SAS_ADAPTER *ioc = shost_priv(sdev->host);
struct MPT3SAS_DEVICE *sas_device_priv_data;
struct _sas_device *sas_device = NULL;
struct _pcie_device *pcie_device = NULL;
@@ -3376,20 +3376,17 @@ scsih_dev_reset(struct scsi_cmnd *scmd)
u8 tr_timeout = 30;
int r;
- struct scsi_target *starget = scmd->device->sdev_target;
+ struct scsi_target *starget = sdev->sdev_target;
struct MPT3SAS_TARGET *target_priv_data = starget->hostdata;
- sdev_printk(KERN_INFO, scmd->device,
- "attempting device reset! scmd(0x%p)\n", scmd);
- _scsih_tm_display_info(ioc, scmd);
+ sdev_printk(KERN_INFO, sdev,
+ "attempting device reset!\n");
- sas_device_priv_data = scmd->device->hostdata;
+ sas_device_priv_data = sdev->hostdata;
if (!sas_device_priv_data || !sas_device_priv_data->sas_target ||
ioc->remove_host) {
- sdev_printk(KERN_INFO, scmd->device,
- "device been deleted! scmd(0x%p)\n", scmd);
- scmd->result = DID_NO_CONNECT << 16;
- scsi_done(scmd);
+ sdev_printk(KERN_INFO, sdev,
+ "device been deleted!\n");
r = SUCCESS;
goto out;
}
@@ -3406,7 +3403,6 @@ scsih_dev_reset(struct scsi_cmnd *scmd)
handle = sas_device_priv_data->sas_target->handle;
if (!handle) {
- scmd->result = DID_RESET << 16;
r = FAILED;
goto out;
}
@@ -3420,16 +3416,16 @@ scsih_dev_reset(struct scsi_cmnd *scmd)
} else
tr_method = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET;
- r = mpt3sas_scsih_issue_locked_tm(ioc, handle, scmd->device->channel,
- scmd->device->id, scmd->device->lun,
+ r = mpt3sas_scsih_issue_locked_tm(ioc, handle, sdev->channel,
+ sdev->id, sdev->lun,
MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET, 0, 0,
tr_timeout, tr_method);
/* Check for busy commands after reset */
- if (r == SUCCESS && scsi_device_busy(scmd->device))
+ if (r == SUCCESS && scsi_device_busy(sdev))
r = FAILED;
out:
- sdev_printk(KERN_INFO, scmd->device, "device reset: %s scmd(0x%p)\n",
- ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd);
+ sdev_printk(KERN_INFO, sdev, "device reset: %s\n",
+ ((r == SUCCESS) ? "SUCCESS" : "FAILED"));
if (sas_device)
sas_device_put(sas_device);
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h
index 8636f0053c02..c2b522a194fc 100644
--- a/drivers/scsi/pcmcia/nsp_cs.h
+++ b/drivers/scsi/pcmcia/nsp_cs.h
@@ -297,8 +297,6 @@ static int nsp_show_info (struct seq_file *m,
static int nsp_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *SCpnt);
/* Error handler */
-/*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/
-/*static int nsp_eh_device_reset(struct scsi_cmnd *SCpnt);*/
static int nsp_eh_bus_reset (struct Scsi_Host *host, int channel);
static int nsp_eh_host_reset (struct Scsi_Host *host);
static int nsp_bus_reset (nsp_hw_data *data);
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index d806576edb87..92ed0b86ad80 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -3014,11 +3014,11 @@ static int pmcraid_eh_abort_handler(struct scsi_cmnd *scsi_cmd)
* Return value
* SUCCESS or FAILED
*/
-static int pmcraid_eh_device_reset_handler(struct scsi_cmnd *scmd)
+static int pmcraid_eh_device_reset_handler(struct scsi_device *sdev)
{
- scmd_printk(KERN_INFO, scmd,
+ sdev_printk(KERN_INFO, sdev,
"resetting device due to an I/O command timeout.\n");
- return pmcraid_reset_device(scmd->device,
+ return pmcraid_reset_device(sdev,
PMCRAID_INTERNAL_TIMEOUT,
RESET_DEVICE_LUN);
}
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index f6876307c304..bf169950834c 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -864,12 +864,12 @@ static int qedf_eh_target_reset(struct scsi_target *starget)
return qedf_initiate_tmf(rport, 0, FCP_TMF_TGT_RESET);
}
-static int qedf_eh_device_reset(struct scsi_cmnd *sc_cmd)
+static int qedf_eh_device_reset(struct scsi_device *sdev)
{
- struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
+ struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
QEDF_ERR(NULL, "LUN RESET Issued...\n");
- return qedf_initiate_tmf(rport, sc_cmd->device->lun, FCP_TMF_LUN_RESET);
+ return qedf_initiate_tmf(rport, sdev->lun, FCP_TMF_LUN_RESET);
}
bool qedf_wait_for_upload(struct qedf_ctx *qedf)
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 1df3deb618e4..cb010aa271ce 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -963,13 +963,24 @@ qla1280_eh_abort(struct scsi_cmnd * cmd)
* Reset the specified SCSI device
**************************************************************************/
static int
-qla1280_eh_device_reset(struct scsi_cmnd *cmd)
+qla1280_eh_device_reset(struct scsi_device *sdev)
{
- int rc;
+ struct Scsi_Host *shost = sdev->host;
+ struct scsi_qla_host *ha = (struct scsi_qla_host *)shost->hostdata;
+ int rc = FAILED;
- spin_lock_irq(cmd->device->host->host_lock);
- rc = qla1280_error_action(cmd, DEVICE_RESET);
- spin_unlock_irq(cmd->device->host->host_lock);
+ spin_lock_irq(shost->host_lock);
+ if (qla1280_verbose)
+ printk(KERN_INFO
+ "scsi(%ld:%d:%d:%llu): Queueing device reset "
+ "command.\n", ha->host_no, sdev->channel,
+ sdev->id, sdev->lun);
+ if (qla1280_device_reset(ha, sdev->channel, sdev->id) == 0) {
+ /* issued device reset, set wait conditions */
+ rc = qla1280_wait_for_pending_commands(ha,
+ sdev->channel, sdev->id);
+ }