Skip to content

Commit 7428369

Browse files
Chandrakanth Patilroot
authored andcommitted
scsi: mpt3sas: Send a diag reset if target reset fails
JIRA: https://issues.redhat.com/browse/RHEL-81907 When an IOCTL times out and driver issues a target reset, if firmware fails the task management elevate the recovery by issuing a diag reset to controller. Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Link: https://lore.kernel.org/r/1739410016-27503-5-git-send-email-shivasharan.srikanteshwara@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit 5612d6d) Signed-off-by: Chandrakanth Patil <chanpati@redhat.com>
1 parent 37cbe32 commit 7428369

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/scsi/mpt3sas/mpt3sas_ctl.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
716716
size_t data_in_sz = 0;
717717
long ret;
718718
u16 device_handle = MPT3SAS_INVALID_DEVICE_HANDLE;
719+
int tm_ret;
719720

720721
issue_reset = 0;
721722

@@ -1174,18 +1175,25 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
11741175
if (pcie_device && (!ioc->tm_custom_handling) &&
11751176
(!(mpt3sas_scsih_is_pcie_scsi_device(
11761177
pcie_device->device_info))))
1177-
mpt3sas_scsih_issue_locked_tm(ioc,
1178+
tm_ret = mpt3sas_scsih_issue_locked_tm(ioc,
11781179
le16_to_cpu(mpi_request->FunctionDependent1),
11791180
0, 0, 0,
11801181
MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0,
11811182
0, pcie_device->reset_timeout,
11821183
MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE);
11831184
else
1184-
mpt3sas_scsih_issue_locked_tm(ioc,
1185+
tm_ret = mpt3sas_scsih_issue_locked_tm(ioc,
11851186
le16_to_cpu(mpi_request->FunctionDependent1),
11861187
0, 0, 0,
11871188
MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0,
11881189
0, 30, MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET);
1190+
1191+
if (tm_ret != SUCCESS) {
1192+
ioc_info(ioc,
1193+
"target reset failed, issue hard reset: handle (0x%04x)\n",
1194+
le16_to_cpu(mpi_request->FunctionDependent1));
1195+
mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER);
1196+
}
11891197
} else
11901198
mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER);
11911199
}

0 commit comments

Comments
 (0)