diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-09-01 13:50:08 +0200 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-25 00:54:40 +0200 |
commit | 1d0680fd6235e0aa5baf14a8f1ff85eff9dc1fb3 (patch) | |
tree | b113a5c2ca999c4bb33db657e4e5cf81f222ebf3 /drivers/net/sfc/falcon.c | |
parent | sfc: Stop generating bogus events in tenxpress_check_hw() (diff) | |
download | linux-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/falcon.c')
-rw-r--r-- | drivers/net/sfc/falcon.c | 4 |
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); } |