scsi: qla2xxx: Fix incorrect reporting of task management failure
authorQuinn Tran <qutran@marvell.com>
Thu, 10 Mar 2022 09:25:52 +0000 (01:25 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:06:40 +0000 (09:06 +0200)
commit 58ca5999e0367d131de82a75257fbfd5aed0195d upstream.

User experienced no task management error while target device is responding
with error. The RSP_CODE field in the status IOCB is in little endian.
Driver assumes it's big endian and it picked up erroneous data.

Convert the data back to big endian as is on the wire.

Link: https://lore.kernel.org/r/20220310092604.22950-2-njavali@marvell.com
Fixes: faef62d13463 ("[SCSI] qla2xxx: Fix Task Management command asynchronous handling")
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/qla2xxx/qla_isr.c

index 17b1525d492bf698808add278c568cf330a45527..c41491472d445c1e7e664705a4a1397b575904e5 100644 (file)
@@ -1618,6 +1618,7 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)
                iocb->u.tmf.data = QLA_FUNCTION_FAILED;
        } else if ((le16_to_cpu(sts->scsi_status) &
            SS_RESPONSE_INFO_LEN_VALID)) {
+               host_to_fcp_swap(sts->data, sizeof(sts->data));
                if (le32_to_cpu(sts->rsp_data_len) < 4) {
                        ql_log(ql_log_warn, fcport->vha, 0x503b,
                            "Async-%s error - hdl=%x not enough response(%d).\n",