]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Aug 2021 10:31:41 +0000 (11:31 +0100)
commit7837538ee7bba9c5ebeb5523b9314b1c87bea080
tree20077ce5ef32c3175f4f2d14e5bbbd061c8d08b3
parent9d40088096df8a71d707b7d986ef8fc8946357c6
bnxt_en: Add missing DMA memory barriers

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: 7b7342c7838a ("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>
drivers/net/ethernet/broadcom/bnxt/bnxt.c