bnxt_en: discard out of sequence HWRM responses
authorEdwin Peer <edwin.peer@broadcom.com>
Sun, 29 Aug 2021 07:35:00 +0000 (03:35 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Aug 2021 08:35:04 +0000 (09:35 +0100)
commit02b9aa1068682319508f9a1678e993ad958a8a4f
tree2ae4109956e2c44b382dbc21199166e550e234e5
parentf9ff578251dc2f1cf5b9b007e050033d8414829d
bnxt_en: discard out of sequence HWRM responses

During firmware crash recovery, it is possible for firmware to respond
to stale HWRM commands that have already timed out. Because response
buffers may be reused, any out of sequence responses need to be ignored
and only the matching seq_id should be accepted.

Also, READ_ONCE should be used for the reads from the DMA buffer to
ensure that the necessary loads are scheduled.

Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c