Date:2010-04-28 11:00:35 (12 years 5 months ago)
Author:Ben Hutchings
Commit:aabc5649078310094cbffb430fcbf9c25b6268f9
Message:sfc: Wait at most 10ms for the MC to finish reading out MAC statistics

The original code would wait indefinitely if MAC stats DMA failed.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Cc: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Files: drivers/net/sfc/siena.c (1 diff)

Change Details

drivers/net/sfc/siena.c
456456
457457static void siena_update_nic_stats(struct efx_nic *efx)
458458{
459    while (siena_try_update_nic_stats(efx) == -EAGAIN)
460        cpu_relax();
459    int retry;
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 */
461470}
462471
463472static void siena_start_nic_stats(struct efx_nic *efx)

Archive Download the corresponding diff file



interactive