scsi: mpt3sas: Fix trace buffer registration failed

The ExtendedType field was set to 1 in the diag buffer register command and
hence MPT Endpoint firmware is failing the request with Invalid Field
IOCStatus.

memset the request frame to zero before framing the diag buffer register
command.

Link: https://lore.kernel.org/r/20220825075457.16422-3-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Sreekanth Reddy 2022-08-25 13:24:55 +05:30 committed by Martin K. Petersen
parent 9df650963b
commit 463e683bfd
1 changed files with 4 additions and 0 deletions

View File

@ -1694,6 +1694,7 @@ _ctl_diag_register_2(struct MPT3SAS_ADAPTER *ioc,
ioc->ctl_cmds.status = MPT3_CMD_PENDING; ioc->ctl_cmds.status = MPT3_CMD_PENDING;
memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz);
mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
memset(mpi_request, 0, ioc->request_sz);
ioc->ctl_cmds.smid = smid; ioc->ctl_cmds.smid = smid;
request_data = ioc->diag_buffer[buffer_type]; request_data = ioc->diag_buffer[buffer_type];
@ -1795,6 +1796,7 @@ _ctl_diag_register_2(struct MPT3SAS_ADAPTER *ioc,
if (rc && request_data) { if (rc && request_data) {
dma_free_coherent(&ioc->pdev->dev, request_data_sz, dma_free_coherent(&ioc->pdev->dev, request_data_sz,
request_data, request_data_dma); request_data, request_data_dma);
ioc->diag_buffer[buffer_type] = NULL;
ioc->diag_buffer_status[buffer_type] &= ioc->diag_buffer_status[buffer_type] &=
~MPT3_DIAG_BUFFER_IS_DRIVER_ALLOCATED; ~MPT3_DIAG_BUFFER_IS_DRIVER_ALLOCATED;
} }
@ -2171,6 +2173,7 @@ mpt3sas_send_diag_release(struct MPT3SAS_ADAPTER *ioc, u8 buffer_type,
ioc->ctl_cmds.status = MPT3_CMD_PENDING; ioc->ctl_cmds.status = MPT3_CMD_PENDING;
memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz);
mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
memset(mpi_request, 0, ioc->request_sz);
ioc->ctl_cmds.smid = smid; ioc->ctl_cmds.smid = smid;
mpi_request->Function = MPI2_FUNCTION_DIAG_RELEASE; mpi_request->Function = MPI2_FUNCTION_DIAG_RELEASE;
@ -2425,6 +2428,7 @@ _ctl_diag_read_buffer(struct MPT3SAS_ADAPTER *ioc, void __user *arg)
ioc->ctl_cmds.status = MPT3_CMD_PENDING; ioc->ctl_cmds.status = MPT3_CMD_PENDING;
memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz);
mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
memset(mpi_request, 0, ioc->request_sz);
ioc->ctl_cmds.smid = smid; ioc->ctl_cmds.smid = smid;
mpi_request->Function = MPI2_FUNCTION_DIAG_BUFFER_POST; mpi_request->Function = MPI2_FUNCTION_DIAG_BUFFER_POST;