summary refs log tree commit diff
path: root/drivers/scsi/arm
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-04-27 10:30:38 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2021-05-31 22:48:24 -0400
commit7f33f56b02ca49d23d3b3014d693a16b0cf6324a (patch)
tree37ff0e62ab7e5b848ab7cf05452d105a55bcd4b6 /drivers/scsi/arm
parentac87ee0ac120119f52cfc8e5fce696d8fc84dbb4 (diff)
downloadlinux-7f33f56b02ca49d23d3b3014d693a16b0cf6324a.tar.gz
scsi: fas216: Translate message to host byte status
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.

[mkp: zeroday bug report: s/SCpnt->result/SCpnt/]

Link: https://lore.kernel.org/r/20210427083046.31620-33-hare@suse.de
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/arm')
-rw-r--r--drivers/scsi/arm/fas216.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 9402cdce7cc5..7e0e465399c3 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -2042,8 +2042,10 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result)
 {
 	info->stats.fins += 1;
 
-	SCpnt->result = result << 16 | info->scsi.SCp.Message << 8 |
-			info->scsi.SCp.Status;
+	set_host_byte(SCpnt, result);
+	if (result == DID_OK)
+		scsi_msg_to_host_byte(SCpnt, info->scsi.SCp.Message);
+	set_status_byte(SCpnt, info->scsi.SCp.Status);
 
 	fas216_log_command(info, LOG_CONNECT, SCpnt,
 		"command complete, result=0x%08x", SCpnt->result);
@@ -2051,8 +2053,7 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result)
 	/*
 	 * If the driver detected an error, we're all done.
 	 */
-	if (host_byte(SCpnt->result) != DID_OK ||
-	    msg_byte(SCpnt->result) != COMMAND_COMPLETE)
+	if (get_host_byte(SCpnt) != DID_OK)
 		goto done;
 
 	/*