Commit e56b2234 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

scsi: qla2xxx: Open-code qla2xxx_eh_target_reset()

Device reset and target reset will be using different calling sequences, so
open-code __qla2xxx_eh_generic_reset() in qla2xxx_eh_target_reset().  No
functional changes.

Link: https://lore.kernel.org/r/20210819091913.94436-3-hare@suse.de
Cc: Nilesh Javali <njavali@marvell.com>
Reviewed-by: default avatarNilesh Javali <njavali@marvell.com>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c74ce061
......@@ -1467,8 +1467,12 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
static int
qla2xxx_eh_target_reset(struct scsi_cmnd *cmd)
{
scsi_qla_host_t *vha = shost_priv(cmd->device->host);
struct scsi_device *sdev = cmd->device;
struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
scsi_qla_host_t *vha = shost_priv(rport_to_shost(rport));
struct qla_hw_data *ha = vha->hw;
fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
int err;
if (qla2x00_isp_reg_stat(ha)) {
ql_log(ql_log_info, vha, 0x803f,
......@@ -1477,8 +1481,54 @@ qla2xxx_eh_target_reset(struct scsi_cmnd *cmd)
return FAILED;
}
return __qla2xxx_eh_generic_reset("TARGET", WAIT_TARGET, cmd,
ha->isp_ops->target_reset);
if (!fcport) {
return FAILED;
}
err = fc_block_rport(rport);
if (err != 0)
return err;
if (fcport->deleted)
return SUCCESS;
ql_log(ql_log_info, vha, 0x8009,
"TARGET RESET ISSUED nexus=%ld:%d cmd=%p.\n", vha->host_no,
sdev->id, cmd);
err = 0;
if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) {
ql_log(ql_log_warn, vha, 0x800a,
"Wait for hba online failed for cmd=%p.\n", cmd);
goto eh_reset_failed;
}
err = 2;
if (ha->isp_ops->target_reset(fcport, 0, 0) != QLA_SUCCESS) {
ql_log(ql_log_warn, vha, 0x800c,
"target_reset failed for cmd=%p.\n", cmd);
goto eh_reset_failed;
}
err = 3;
if (qla2x00_eh_wait_for_pending_commands(vha, sdev->id,
0, WAIT_TARGET) != QLA_SUCCESS) {
ql_log(ql_log_warn, vha, 0x800d,
"wait for pending cmds failed for cmd=%p.\n", cmd);
goto eh_reset_failed;
}
ql_log(ql_log_info, vha, 0x800e,
"TARGET RESET SUCCEEDED nexus:%ld:%d cmd=%p.\n",
vha->host_no, sdev->id, cmd);
return SUCCESS;
eh_reset_failed:
ql_log(ql_log_info, vha, 0x800f,
"TARGET RESET FAILED: %s nexus=%ld:%d:%llu cmd=%p.\n",
reset_errors[err], vha->host_no, cmd->device->id, cmd->device->lun,
cmd);
vha->reset_cmd_err_cnt++;
return FAILED;
}
/**************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment