scsi: megaraid_sas: Block zero-length ATA VPD inquiry
commit aad9945623ab4029ae7789609fb6166c97976c62 upstream. A firmware bug was observed where ATA VPD inquiry commands with a zero-length data payload were not handled and failed with a non-standard status code of 0xf0. Avoid sending ATA VPD inquiry commands without data payload by setting the device no_vpd_size flag to 1. In addition, if the firmware returns a status code of 0xf0, set scsi_cmnd->result to CHECK_CONDITION to facilitate proper error handling. Suggested-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20250402193735.5098-1-chandrakanth.patil@broadcom.com Tested-by: Ryan Lahfa <ryan@lahfa.xyz> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bbb6b149c3
commit
92d8a4e621
@@ -2101,6 +2101,9 @@ static int megasas_slave_configure(struct scsi_device *sdev)
|
||||
/* This sdev property may change post OCR */
|
||||
megasas_set_dynamic_target_properties(sdev, is_target_prop);
|
||||
|
||||
if (!MEGASAS_IS_LOGICAL(sdev))
|
||||
sdev->no_vpd_size = 1;
|
||||
|
||||
mutex_unlock(&instance->reset_mutex);
|
||||
|
||||
return 0;
|
||||
@@ -3660,8 +3663,10 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
|
||||
|
||||
case MFI_STAT_SCSI_IO_FAILED:
|
||||
case MFI_STAT_LD_INIT_IN_PROGRESS:
|
||||
cmd->scmd->result =
|
||||
(DID_ERROR << 16) | hdr->scsi_status;
|
||||
if (hdr->scsi_status == 0xf0)
|
||||
cmd->scmd->result = (DID_ERROR << 16) | SAM_STAT_CHECK_CONDITION;
|
||||
else
|
||||
cmd->scmd->result = (DID_ERROR << 16) | hdr->scsi_status;
|
||||
break;
|
||||
|
||||
case MFI_STAT_SCSI_DONE_WITH_ERROR:
|
||||
|
@@ -2043,7 +2043,10 @@ map_cmd_status(struct fusion_context *fusion,
|
||||
|
||||
case MFI_STAT_SCSI_IO_FAILED:
|
||||
case MFI_STAT_LD_INIT_IN_PROGRESS:
|
||||
scmd->result = (DID_ERROR << 16) | ext_status;
|
||||
if (ext_status == 0xf0)
|
||||
scmd->result = (DID_ERROR << 16) | SAM_STAT_CHECK_CONDITION;
|
||||
else
|
||||
scmd->result = (DID_ERROR << 16) | ext_status;
|
||||
break;
|
||||
|
||||
case MFI_STAT_SCSI_DONE_WITH_ERROR:
|
||||
|
Reference in New Issue
Block a user