Re: [PATCH net v3] r8169:fix "rtl_counters_cond == 1 (loop: 1000, delay: 10)" log spam.

From: Francois Romieu
Date: Tue Feb 23 2016 - 17:44:13 EST


Chunhao Lin <hau@xxxxxxxxxxx> :
[...]
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 537974c..404be51 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
[...]
> @@ -7853,6 +7859,11 @@ static int rtl8169_runtime_suspend(struct device *device)
>
> rtl8169_net_suspend(dev);
>
> + /* Update counters before going runtime suspend */
> + if (netif_running(dev))

This test is useless (always true):

- rtl_open
[...]
pm_runtime_get_sync(&pdev->dev);
[...]
tp->TxDescArray = blah
[...]

- rtl8169_close
[...]
pm_runtime_get_sync(&pdev->dev);
[...]
tp->TxDescArray = NULL;

- rtl8169_runtime_suspend
[...]
if (!tp->TxDescArray)
return 0;

(the implicit smp barriers are mildly obvious, ok)

--
Ueimor