* [PATCH] r8169: increase the delay parameter of pm_schedule_suspend
@ 2011-11-08 6:44 Hayes Wang
2011-11-08 9:07 ` Francois Romieu
0 siblings, 1 reply; 3+ messages in thread
From: Hayes Wang @ 2011-11-08 6:44 UTC (permalink / raw)
To: romieu; +Cc: netdev, linux-kernel, Hayes Wang
The link down would occur when reseting PHY. And it would take about 2 ~ 5 seconds
from link down to link up. If the delay of pm_schedule_suspend is not long enough,
the device would enter runtime_suspend before link up. After link up, the device
would wake up and reset PHY again. Then, you would find the driver keep in a loop
of runtime_suspend and rumtime_resume.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/ethernet/realtek/r8169.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 92b45f0..6f06aa1 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -1292,7 +1292,7 @@ static void __rtl8169_check_link_status(struct net_device *dev,
netif_carrier_off(dev);
netif_info(tp, ifdown, dev, "link down\n");
if (pm)
- pm_schedule_suspend(&tp->pci_dev->dev, 100);
+ pm_schedule_suspend(&tp->pci_dev->dev, 5000);
}
spin_unlock_irqrestore(&tp->lock, flags);
}
--
1.7.6.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] r8169: increase the delay parameter of pm_schedule_suspend
2011-11-08 6:44 [PATCH] r8169: increase the delay parameter of pm_schedule_suspend Hayes Wang
@ 2011-11-08 9:07 ` Francois Romieu
2011-11-08 17:37 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Francois Romieu @ 2011-11-08 9:07 UTC (permalink / raw)
To: Hayes Wang; +Cc: netdev, linux-kernel, Rafael J. Wysocki
Hayes Wang <hayeswang@realtek.com> :
> The link down would occur when reseting PHY. And it would take about 2 ~ 5 seconds
> from link down to link up. If the delay of pm_schedule_suspend is not long enough,
> the device would enter runtime_suspend before link up. After link up, the device
> would wake up and reset PHY again. Then, you would find the driver keep in a loop
> of runtime_suspend and rumtime_resume.
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
So far the worst offender here is the 8111evl (RTL_GIGA_MAC_VER_34) with a
max delay a bit below 4000 ms.
[...]
[ 4195.444121] r8169 0000:03:00.0: 8111e-vl-0: link up
[ 4195.549396] r8169 0000:03:00.0: 8111e-vl-0: link down
[ 4195.888002] r8169 0000:03:00.0: 8111e-vl-0: link up
[ 4199.444120] r8169 0000:03:00.0: 8111e-vl-0: link up
[ 4199.582073] r8169 0000:03:00.0: 8111e-vl-0: link down
[...]
[ 4171.580422] r8169 0000:03:00.0: 8111e-vl-0: link down
[ 4171.904002] r8169 0000:03:00.0: 8111e-vl-0: link up
[ 4175.444131] r8169 0000:03:00.0: 8111e-vl-0: link up
[ 4175.547453] r8169 0000:03:00.0: 8111e-vl-0: link down
The 8168d-vb-gr (RTL_GIGA_MAC_VER_26) and the 8168b (RTL_GIGA_MAC_VER_12)
worked out of the box without the patch - at least with a kernel including
Rafael's recent changes - and the old PCI 8169 always worked.
I have not tested the 8168f nor the 810x yet.
Increasing the delay over and over in the driver alone will not ensure
that the system is always stable but it should send the stuff on a far
enough orbit for some time.
--
Ueimor
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] r8169: increase the delay parameter of pm_schedule_suspend
2011-11-08 9:07 ` Francois Romieu
@ 2011-11-08 17:37 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-11-08 17:37 UTC (permalink / raw)
To: romieu; +Cc: hayeswang, netdev, linux-kernel, rjw
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Tue, 8 Nov 2011 10:07:16 +0100
> Hayes Wang <hayeswang@realtek.com> :
>> The link down would occur when reseting PHY. And it would take about 2 ~ 5 seconds
>> from link down to link up. If the delay of pm_schedule_suspend is not long enough,
>> the device would enter runtime_suspend before link up. After link up, the device
>> would wake up and reset PHY again. Then, you would find the driver keep in a loop
>> of runtime_suspend and rumtime_resume.
>
> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-08 17:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 6:44 [PATCH] r8169: increase the delay parameter of pm_schedule_suspend Hayes Wang
2011-11-08 9:07 ` Francois Romieu
2011-11-08 17:37 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox