[PATCH 27/42] wd33c93: translate message byte to host byte

Hannes Reinecke
2021-04-21T17:50:28Z

Instead of setting the message byte translate it to the appropriate
host byte. As error recovery would return DID_ERROR for any non-zero
message byte the translation doesn't change the error handling.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/scsi/wd33c93.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
index 0a5bb238f001..e886e17fbf45 100644
--- a/drivers/scsi/wd33c93.c
+++ b/drivers/scsi/wd33c93.c
@@ -1168,7 +1168,6 @@ wd33c93_intr(struct Scsi_Host *instance)
write_wd33c93(regs, WD_SOURCE_ID, SRCID_ER);
if (phs == 0x60) {
DB(DB_INTR, printk("SX-DONE"))
- cmd->SCp.Message = COMMAND_COMPLETE;
lun = read_wd33c93(regs, WD_TARGET_LUN);
DB(DB_INTR, printk(":%d.%d", cmd->SCp.Status, lun))
hostdata->connected = NULL;
@@ -1180,8 +1179,8 @@ wd33c93_intr(struct Scsi_Host *instance)
&& cmd->SCp.Status != SAM_STAT_GOOD)
set_host_byte(cmd, DID_ERROR);
else {
+ set_host_byte(cmd, DID_OK);
set_status_byte(cmd, cmd->SCp.Status);
- set_msg_byte(cmd, cmd->SCp.Message);
}
cmd->scsi_done(cmd);

@@ -1266,8 +1265,9 @@ wd33c93_intr(struct Scsi_Host *instance)
cmd->SCp.Status != SAM_STAT_GOOD)
set_host_byte(cmd, DID_ERROR);
else {
+ set_host_byte(cmd, DID_OK);
+ translate_msg_byte(cmd, cmd->SCp.Message);
set_status_byte(cmd, cmd->SCp.Status);
- set_msg_byte(cmd, cmd->SCp.Message);
}
cmd->scsi_done(cmd);

@@ -1301,8 +1301,9 @@ wd33c93_intr(struct Scsi_Host *instance)
&& cmd->SCp.Status != SAM_STAT_GOOD)
set_host_byte(cmd, DID_ERROR);
else {
+ set_host_byte(cmd, DID_OK);
+ translate_msg_byte(cmd, cmd->SCp.Message);
set_status_byte(cmd, cmd->SCp.Status);
- set_msg_byte(cmd, cmd->SCp.Message);
}
cmd->scsi_done(cmd);
break;
--
2.29.2