diff options
Diffstat (limited to 'drivers/net/sfc/siena.c')
-rw-r--r-- | drivers/net/sfc/siena.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c index 1619fb5a64f5..e0c46f59d1f8 100644 --- a/drivers/net/sfc/siena.c +++ b/drivers/net/sfc/siena.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/delay.h> | 12 | #include <linux/delay.h> |
13 | #include <linux/pci.h> | 13 | #include <linux/pci.h> |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/slab.h> | ||
15 | #include "net_driver.h" | 16 | #include "net_driver.h" |
16 | #include "bitfield.h" | 17 | #include "bitfield.h" |
17 | #include "efx.h" | 18 | #include "efx.h" |
@@ -455,8 +456,17 @@ static int siena_try_update_nic_stats(struct efx_nic *efx) | |||
455 | 456 | ||
456 | static void siena_update_nic_stats(struct efx_nic *efx) | 457 | static void siena_update_nic_stats(struct efx_nic *efx) |
457 | { | 458 | { |
458 | while (siena_try_update_nic_stats(efx) == -EAGAIN) | 459 | int retry; |
459 | cpu_relax(); | 460 | |
461 | /* If we're unlucky enough to read statistics wduring the DMA, wait | ||
462 | * up to 10ms for it to finish (typically takes <500us) */ | ||
463 | for (retry = 0; retry < 100; ++retry) { | ||
464 | if (siena_try_update_nic_stats(efx) == 0) | ||
465 | return; | ||
466 | udelay(100); | ||
467 | } | ||
468 | |||
469 | /* Use the old values instead */ | ||
460 | } | 470 | } |
461 | 471 | ||
462 | static void siena_start_nic_stats(struct efx_nic *efx) | 472 | static void siena_start_nic_stats(struct efx_nic *efx) |