summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-04-18 08:37:05 +1000
committerDavid S. Miller <davem@davemloft.net>2017-04-18 14:11:09 -0400
commitccaf725a1fd7904ed3e771ed178c2aa1ccb21509 (patch)
tree8f202223c260b201710312cd3c42411463638a3d
parent33de693248b45640c0d894c2454a9909f2e81ffd (diff)
downloadop-kernel-dev-ccaf725a1fd7904ed3e771ed178c2aa1ccb21509.zip
op-kernel-dev-ccaf725a1fd7904ed3e771ed178c2aa1ccb21509.tar.gz
ftgmac100: Fix potential ordering issue in NAPI poll
We need to ensure the loads from the descriptor are done after the MMIO store clearing the interrupts has completed, otherwise we might still miss work. A read back from the MMIO register will "push" the posted store and ioread32 has a barrier on weakly aordered architectures that will order subsequent accesses. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/faraday/ftgmac100.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 45b8267..95bf5e8 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1349,6 +1349,13 @@ static int ftgmac100_poll(struct napi_struct *napi, int budget)
*/
iowrite32(FTGMAC100_INT_RXTX,
priv->base + FTGMAC100_OFFSET_ISR);
+
+ /* Push the above (and provides a barrier vs. subsequent
+ * reads of the descriptor).
+ */
+ ioread32(priv->base + FTGMAC100_OFFSET_ISR);
+
+ /* Check RX and TX descriptors for more work to do */
if (ftgmac100_check_rx(priv) ||
ftgmac100_tx_buf_cleanable(priv))
return budget;
OpenPOWER on IntegriCloud