]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
scsi: qla2xxx: Zero undefined mailbox IN registers
authorBikash Hazarika <bhazarika@marvell.com>
Wed, 13 Jul 2022 05:20:38 +0000 (22:20 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Aug 2022 13:15:24 +0000 (15:15 +0200)
commit 6c96a3c7d49593ef15805f5e497601c87695abc9 upstream.

While requesting a new mailbox command, driver does not write any data to
unused registers.  Initialize the unused register value to zero while
requesting a new mailbox command to prevent stale entry access by firmware.

Link: https://lore.kernel.org/r/20220713052045.10683-4-njavali@marvell.com
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bikash Hazarika <bhazarika@marvell.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_mbx.c

index bbb57edc1f66290b72495b3dcabf7652385aef2f..fe702ac5ce41d2caebfb8afbce00fd171ebe9bbc 100644 (file)
@@ -233,6 +233,8 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
                        ql_dbg(ql_dbg_mbx, vha, 0x1112,
                            "mbox[%d]<-0x%04x\n", cnt, *iptr);
                        wrt_reg_word(optr, *iptr);
+               } else {
+                       wrt_reg_word(optr, 0);
                }
 
                mboxes >>= 1;