]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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:07 +0000 (08:35 -0400)
commita5607b1d8e34961e10de9cd1f83b7f9d0890aec3
tree34fe25bef3b263039324fb595600d90a35fc3902
parent020761f49efb63edd0530630d2cbde8c61454bdd
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