mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
scsi: device_handlers: emc: Use combined sense codes
Refactor the EMC SCSI device handler driver to use the 16-bit sense_code field of struct scsi_sense_hdr and replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented. No functional change intended. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-16-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
This commit is contained in:
parent
5c0ae0bcee
commit
9f543ed64b
|
|
@ -105,10 +105,10 @@ static int trespass_endio(struct scsi_device *sdev,
|
|||
sdev_printk(KERN_ERR, sdev, "%s: Found valid sense data 0x%2x, "
|
||||
"0x%2x, 0x%2x while sending CLARiiON trespass "
|
||||
"command.\n", CLARIION_NAME, sshdr->sense_key,
|
||||
sshdr->asc, sshdr->ascq);
|
||||
scsi_sense_asc(sshdr), scsi_sense_ascq(sshdr));
|
||||
|
||||
if (sshdr->sense_key == 0x05 && sshdr->asc == 0x04 &&
|
||||
sshdr->ascq == 0x00) {
|
||||
if (sshdr->sense_key == ILLEGAL_REQUEST &&
|
||||
sshdr->sense_code == LU_NOT_READY) {
|
||||
/*
|
||||
* Array based copy in progress -- do not send
|
||||
* mode_select or copy will be aborted mid-stream.
|
||||
|
|
@ -117,18 +117,18 @@ static int trespass_endio(struct scsi_device *sdev,
|
|||
"progress while sending CLARiiON trespass "
|
||||
"command.\n", CLARIION_NAME);
|
||||
err = SCSI_DH_DEV_TEMP_BUSY;
|
||||
} else if (sshdr->sense_key == 0x02 && sshdr->asc == 0x04 &&
|
||||
sshdr->ascq == 0x03) {
|
||||
/*
|
||||
* LUN Not Ready - Manual Intervention Required
|
||||
* indicates in-progress ucode upgrade (NDU).
|
||||
*/
|
||||
} else if (sshdr->sense_key == NOT_READY &&
|
||||
sshdr->sense_code ==
|
||||
LU_NOT_READY_MANUAL_INTERVENTION_REQUIRED) {
|
||||
/* Indicates in-progress ucode upgrade (NDU). */
|
||||
sdev_printk(KERN_INFO, sdev, "%s: Detected in-progress "
|
||||
"ucode upgrade NDU operation while sending "
|
||||
"CLARiiON trespass command.\n", CLARIION_NAME);
|
||||
err = SCSI_DH_DEV_TEMP_BUSY;
|
||||
} else
|
||||
} else {
|
||||
err = SCSI_DH_DEV_FAILED;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -288,7 +288,8 @@ static enum scsi_disposition clariion_check_sense(struct scsi_device *sdev,
|
|||
{
|
||||
switch (sense_hdr->sense_key) {
|
||||
case NOT_READY:
|
||||
if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x03)
|
||||
if (sense_hdr->sense_code ==
|
||||
LU_NOT_READY_MANUAL_INTERVENTION_REQUIRED)
|
||||
/*
|
||||
* LUN Not Ready - Manual Intervention Required
|
||||
* indicates this is a passive path.
|
||||
|
|
@ -305,7 +306,7 @@ static enum scsi_disposition clariion_check_sense(struct scsi_device *sdev,
|
|||
return SUCCESS;
|
||||
break;
|
||||
case ILLEGAL_REQUEST:
|
||||
if (sense_hdr->asc == 0x25 && sense_hdr->ascq == 0x01)
|
||||
if (sense_hdr->sense_code == scsi_sense_code(0x25, 0x01))
|
||||
/*
|
||||
* An array based copy is in progress. Do not
|
||||
* fail the path, do not bypass to another PG,
|
||||
|
|
@ -319,7 +320,8 @@ static enum scsi_disposition clariion_check_sense(struct scsi_device *sdev,
|
|||
return SUCCESS;
|
||||
break;
|
||||
case UNIT_ATTENTION:
|
||||
if (sense_hdr->asc == 0x29 && sense_hdr->ascq == 0x00)
|
||||
if (sense_hdr->sense_code ==
|
||||
POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURRED)
|
||||
/*
|
||||
* Unit Attention Code. This is the first IO
|
||||
* to the new path, so just retry.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user