]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Need memory barrier when processing the completion ring.
authorMichael Chan <michael.chan@broadcom.com>
Wed, 4 May 2016 20:56:43 +0000 (16:56 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 May 2016 21:11:37 +0000 (17:11 -0400)
commit7b7342c7838a3f96438257519cc74634a11acce0
treeba7439fac778de34a693ee7a3b0d446f70c5a8ba
parentf3d0ea2759463606796c8de49696f49ef8327329
bnxt_en: Need memory barrier when processing the completion ring.

The code determines if the next ring entry is valid before proceeding
further to read the rest of the entry.  The CPU can re-order and read
the rest of the entry first, possibly reading a stale entry, if DMA
of a new entry happens right after reading it.  This issue can be
readily seen on a ppc64 system, causing it to crash.

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