scsi: qla2xxx: Handle incorrect entry_type entries
authorDaniel Wagner <dwagner@suse.de>
Tue, 8 Sep 2020 08:15:16 +0000 (10:15 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 10 Sep 2020 02:01:44 +0000 (22:01 -0400)
commit31a3271ff11badc50d6dc0efb4da393e4c3bf388
treea61cbc57d995e3ebf68cd5dfa5463b08a2f5b5d6
parent7d88d5dff95f929e94b9d6425f699eba22e47444
scsi: qla2xxx: Handle incorrect entry_type entries

It was observed on an ISP8324 16Gb HBA with fw=8.08.203 (d0d5) in a
PowerPC64 machine that pkt->entry_type was MBX_IOCB_TYPE/0x39 with an
sp->type SRB_SCSI_CMD which is invalid and should not be possible.

Reading the entry_type from the crash dump shows the expected value of
STATUS_TYPE/0x03 but the call trace shows that qla24xx_mbx_iocb_entry() is
used.

Add a check to verify for consistency and reset the HBA if an invalid state
is reached. Obviously, this is only a workaround until the real problem is
solved.

Link: https://lore.kernel.org/r/20200908081516.8561-5-dwagner@suse.de
Reviewed-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_isr.c