bnxt_en: Add missing DMA memory barriers
authorMichael Chan <michael.chan@broadcom.com>
Sun, 15 Aug 2021 20:15:37 +0000 (16:15 -0400)
committerSasha Levin <sashal@kernel.org>
Thu, 26 Aug 2021 12:35:46 +0000 (08:35 -0400)
commit8ae539a361943391021d449ea7c0c95222518a43
treed7acba8eae49b1e70fe9972a1adfa4ef5c95aa5e
parent9751aa443695ee7205f9b8ed575b911b8a3c3135
bnxt_en: Add missing DMA memory barriers

[ Upstream commit 828affc27ed43441bd1efdaf4e07e96dd43a0362 ]

Each completion ring entry has a valid bit to indicate that the entry
contains a valid completion event.  The driver's main poll loop
__bnxt_poll_work() has the proper dma_rmb() to make sure the valid
bit of the next entry has been checked before proceeding further.
But when we call bnxt_rx_pkt() to process the RX event, the RX
completion event consists of two completion entries and only the
first entry has been checked to be valid.  We need the same barrier
after checking the next completion entry.  Add missing dma_rmb()
barriers in bnxt_rx_pkt() and other similar locations.

Fixes: 67a95e2022c7 ("bnxt_en: Need memory barrier when processing the completion ring.")
Reported-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c