Skip to content

Commit

Permalink
sfc: Insert read memory barrier after checking MAC statistics flag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Hutchings authored and Jeff Garzik committed Sep 24, 2008
1 parent a620e13 commit 1d0680f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/sfc/falcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 1d0680f

Please sign in to comment.