mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-06 13:55:22 +02:00
scsi: mpt3sas: Send a diag reset if target reset fails
[ Upstream commit 5612d6d51ed2634a033c95de2edec7449409cbb9 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
06abee685c
commit
f38a1b35c8
|
@ -679,6 +679,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
||||||
size_t data_in_sz = 0;
|
size_t data_in_sz = 0;
|
||||||
long ret;
|
long ret;
|
||||||
u16 device_handle = MPT3SAS_INVALID_DEVICE_HANDLE;
|
u16 device_handle = MPT3SAS_INVALID_DEVICE_HANDLE;
|
||||||
|
int tm_ret;
|
||||||
|
|
||||||
issue_reset = 0;
|
issue_reset = 0;
|
||||||
|
|
||||||
|
@ -1120,18 +1121,25 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
||||||
if (pcie_device && (!ioc->tm_custom_handling) &&
|
if (pcie_device && (!ioc->tm_custom_handling) &&
|
||||||
(!(mpt3sas_scsih_is_pcie_scsi_device(
|
(!(mpt3sas_scsih_is_pcie_scsi_device(
|
||||||
pcie_device->device_info))))
|
pcie_device->device_info))))
|
||||||
mpt3sas_scsih_issue_locked_tm(ioc,
|
tm_ret = mpt3sas_scsih_issue_locked_tm(ioc,
|
||||||
le16_to_cpu(mpi_request->FunctionDependent1),
|
le16_to_cpu(mpi_request->FunctionDependent1),
|
||||||
0, 0, 0,
|
0, 0, 0,
|
||||||
MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0,
|
MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0,
|
||||||
0, pcie_device->reset_timeout,
|
0, pcie_device->reset_timeout,
|
||||||
MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE);
|
MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE);
|
||||||
else
|
else
|
||||||
mpt3sas_scsih_issue_locked_tm(ioc,
|
tm_ret = mpt3sas_scsih_issue_locked_tm(ioc,
|
||||||
le16_to_cpu(mpi_request->FunctionDependent1),
|
le16_to_cpu(mpi_request->FunctionDependent1),
|
||||||
0, 0, 0,
|
0, 0, 0,
|
||||||
MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0,
|
MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0,
|
||||||
0, 30, MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET);
|
0, 30, MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET);
|
||||||
|
|
||||||
|
if (tm_ret != SUCCESS) {
|
||||||
|
ioc_info(ioc,
|
||||||
|
"target reset failed, issue hard reset: handle (0x%04x)\n",
|
||||||
|
le16_to_cpu(mpi_request->FunctionDependent1));
|
||||||
|
mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER);
|
mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user