Skip to content

Commit

Permalink
scsi: smartpqi: Improve handling of multipath failover
Browse files Browse the repository at this point in the history
Improve multipath failovers by mapping firmware errors into I/O errors.

In some rare instances, firmware does not return the proper error code for
I/O errors caused by a multipath path failure.

Map I/O errors returned by firmware into errors that help the multipath
layer to detect the failure of a path.

Reviewed-by: Gerry Morong <gerry.morong@microchip.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Link: https://lore.kernel.org/r/20240711194704.982400-5-don.brace@microchip.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Kevin Barnett authored and Martin K. Petersen committed Aug 3, 2024
1 parent f1393d5 commit 57abab7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion drivers/scsi/smartpqi/smartpqi_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3247,6 +3247,20 @@ static void pqi_process_raid_io_error(struct pqi_io_request *io_request)
sense_data_length);
}

if (pqi_cmd_priv(scmd)->this_residual &&
!pqi_is_logical_device(scmd->device->hostdata) &&
scsi_status == SAM_STAT_CHECK_CONDITION &&
host_byte == DID_OK &&
sense_data_length &&
scsi_normalize_sense(error_info->data, sense_data_length, &sshdr) &&
sshdr.sense_key == ILLEGAL_REQUEST &&
sshdr.asc == 0x26 &&
sshdr.ascq == 0x0) {
host_byte = DID_NO_CONNECT;
pqi_take_device_offline(scmd->device, "AIO");
scsi_build_sense_buffer(0, scmd->sense_buffer, HARDWARE_ERROR, 0x3e, 0x1);
}

scmd->result = scsi_status;
set_host_byte(scmd, host_byte);
}
Expand Down Expand Up @@ -6021,7 +6035,7 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scm

ctrl_info = shost_to_hba(shost);

if (pqi_ctrl_offline(ctrl_info) || pqi_device_in_remove(device)) {
if (pqi_ctrl_offline(ctrl_info) || pqi_device_offline(device) || pqi_device_in_remove(device)) {
set_host_byte(scmd, DID_NO_CONNECT);
pqi_scsi_done(scmd);
return 0;
Expand Down

0 comments on commit 57abab7

Please sign in to comment.