aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-09-01 12:50:08 +0100
committerJeff Garzik <jgarzik@redhat.com>2008-09-24 18:54:40 -0400
commit1d0680fd6235e0aa5baf14a8f1ff85eff9dc1fb3 (patch)
treeb113a5c2ca999c4bb33db657e4e5cf81f222ebf3
parenta620e134e989b7ce683574039fc7cb956aa58970 (diff)
downloadkernel_samsung_crespo-1d0680fd6235e0aa5baf14a8f1ff85eff9dc1fb3.zip
kernel_samsung_crespo-1d0680fd6235e0aa5baf14a8f1ff85eff9dc1fb3.tar.gz
kernel_samsung_crespo-1d0680fd6235e0aa5baf14a8f1ff85eff9dc1fb3.tar.bz2
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>
-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 70c681e..3a5289f 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);
}