bnxt_en: Eliminate duplicate barriers on weakly-ordered archs
authorSinan Kaya <okaya@codeaurora.org>
Sun, 25 Mar 2018 14:39:20 +0000 (10:39 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Mar 2018 16:47:56 +0000 (12:47 -0400)
commitfd141fa47c03018aa1f77c335b0f444493e145d5
tree5415abb0dde7f4757078fe748387d992c2ab5203
parente42d8cee343a545ac2d9557a3b28708bbca2bd31
bnxt_en: Eliminate duplicate barriers on weakly-ordered archs

Code includes wmb() followed by writel(). writel() already has a barrier on
some architectures like arm64.

This ends up CPU observing two barriers back to back before executing the
register write.

Create a new wrapper function with relaxed write operator. Use the new
wrapper when a write is following a wmb().

Since code already has an explicit barrier call, changing writel() to
writel_relaxed().

Also add mmiowb() so that write code doesn't move outside of scope.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h