summaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-09-01 13:50:08 +0200
committerJeff Garzik <jgarzik@redhat.com>2008-09-25 00:54:40 +0200
commit1d0680fd6235e0aa5baf14a8f1ff85eff9dc1fb3 (patch)
treeb113a5c2ca999c4bb33db657e4e5cf81f222ebf3 /drivers/net/sfc
parentsfc: Stop generating bogus events in tenxpress_check_hw() (diff)
downloadlinux-1d0680fd6235e0aa5baf14a8f1ff85eff9dc1fb3.tar.xz
linux-1d0680fd6235e0aa5baf14a8f1ff85eff9dc1fb3.zip
sfc: Insert read memory barrier after checking MAC statistics flag
This prevents speculative reading of the statistics before the completion flag. From: Neil Turton <nturton@solarflare.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/falcon.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 70c681ecdabe..3a5289fe8d1d 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -1953,8 +1953,10 @@ int falcon_dma_stats(struct efx_nic *efx, unsigned int done_offset)
/* Wait for transfer to complete */
for (i = 0; i < 400; i++) {
- if (*(volatile u32 *)dma_done == FALCON_STATS_DONE)
+ if (*(volatile u32 *)dma_done == FALCON_STATS_DONE) {
+ rmb(); /* Ensure the stats are valid. */
return 0;
+ }
udelay(10);
}