Bug 30452 - r8169: Can't detect link when runtime PM is enabled
Summary: r8169: Can't detect link when runtime PM is enabled
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Drivers
Classification: Unclassified
Component: PCI (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_pci@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks: 7216
  Show dependency tree
 
Reported: 2011-03-04 20:45 UTC by Dmitry Nezhevenko
Modified: 2011-08-17 11:48 UTC (History)
6 users (show)

See Also:
Kernel Version: 2.6.38-rc7
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg from 2.6.38-rc7 (85.93 KB, text/plain)
2011-03-05 21:34 UTC, Dmitry Nezhevenko
Details
lspci -vv as root after step 4 (26.77 KB, text/plain)
2011-03-05 21:53 UTC, Dmitry Nezhevenko
Details
dmesg 3.0.0 (57.01 KB, application/octet-stream)
2011-08-05 11:58 UTC, j.fikar
Details

Description Dmitry Nezhevenko 2011-03-04 20:45:29 UTC
I've played a bit with runtime PM and found that ethernet card can't detect link anymore just after enablink runtime PM 

05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)


Initially: Runtime PM enabled, link is down. Then plug cable in and "ifup" interface:

[158575.112239] r8169 0000:05:00.0: PME# disabled
[158575.117610] r8169 0000:05:00.0: eth0: link down
[158575.117632] r8169 0000:05:00.0: eth0: link down
[158575.117945] ADDRCONF(NETDEV_UP): eth0: link is not ready


Then disable Runtime PM in powertop for ethernet:

[158671.844410] r8169 0000:05:00.0: PME# enabled
[158731.840293] r8169 0000:05:00.0: PME# disabled
[158731.860574] r8169 0000:05:00.0: eth0: link down
[158733.773350] r8169 0000:05:00.0: eth0: link up
[158733.773699] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Comment 1 Andrew Morton 2011-03-04 21:16:48 UTC
Is this a regression?  Were earlier kernels OK?  If so, which version?

Thanks.
Comment 2 Rafael J. Wysocki 2011-03-04 21:21:45 UTC
No, it isn't a regression AFAICS.  It's a new feature (disabled by default)
not working correctly.
Comment 3 Rafael J. Wysocki 2011-03-04 21:22:53 UTC
Also I'm going to handle it.
Comment 4 Dmitry Nezhevenko 2011-03-04 21:35:36 UTC
This is first time I'm playing with runtime PM. So I don't know.
Comment 5 Dmitry Nezhevenko 2011-03-04 21:42:24 UTC
A bit detailed steps:

1. Initial state: cable unplugged, iface down, PME disabled

2. Enable PME:

[162215.444448] r8169 0000:05:00.0: PME# enabled

3. Plug cable. dmesg not changed

4. ifconfig eth0 up:

[162307.024203] r8169 0000:05:00.0: PME# disabled
[162307.029392] r8169 0000:05:00.0: eth0: link down
[162307.029403] r8169 0000:05:00.0: eth0: link down
[162307.029760] ADDRCONF(NETDEV_UP): eth0: link is not ready
[162307.128563] r8169 0000:05:00.0: PME# enabled

5. ifconfig eth0 down

[162371.500280] r8169 0000:05:00.0: PME# disabled
[162371.524675] r8169 0000:05:00.0: PME# enabled

6. ifconfig eth0 up again

[162390.316369] r8169 0000:05:00.0: PME# disabled
[162390.321586] r8169 0000:05:00.0: eth0: link down
[162390.321609] r8169 0000:05:00.0: eth0: link down
[162390.321931] ADDRCONF(NETDEV_UP): eth0: link is not ready
[162390.420463] r8169 0000:05:00.0: PME# enabled

7. disable PME:

[162484.264315] r8169 0000:05:00.0: PME# disabled
[162484.284576] r8169 0000:05:00.0: eth0: link down
[162485.987480] r8169 0000:05:00.0: eth0: link up
[162485.992177] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Comment 6 Rafael J. Wysocki 2011-03-05 21:16:44 UTC
Well, I can't reproduce the issue with my hardware (MSI Wind U100).

It seems to require some more debugging and is almost certainly related to
your hardware/firmware configuration and probably is not even related to the
r8169 driver (reassigning to Drivers->PCI).
Comment 7 Rafael J. Wysocki 2011-03-05 21:18:07 UTC
Please attach full dmesg, preferably from 2.6.38-rc7 (or -rc8 when it's out).
Comment 8 Dmitry Nezhevenko 2011-03-05 21:34:01 UTC
Created attachment 50142 [details]
dmesg from 2.6.38-rc7

Attaching dmesg from 2.6.38-rc7.
Comment 9 Rafael J. Wysocki 2011-03-05 21:45:59 UTC
Thanks.

Please also attach the output of "lspci -vv" (generated as root) after you've
done step 4 in comment #5.
Comment 10 Dmitry Nezhevenko 2011-03-05 21:53:52 UTC
Created attachment 50152 [details]
lspci -vv as root after step 4
Comment 11 Rafael J. Wysocki 2011-03-05 22:02:41 UTC
OK, your adapter appears to signal PME, but that doesn't seem to trigger
platform events.

Can you please test with the patch from:
https://patchwork.kernel.org/patch/612171/
applied?
Comment 12 Dmitry Nezhevenko 2011-03-06 15:31:37 UTC
Hi,

I've built same 2.6.38-rc7 kernel with your patch and it works!

... plug cable ...
[  211.016249] r8169 0000:05:00.0: PME# disabled
[  211.021383] r8169 0000:05:00.0: eth0: link down
[  211.021398] r8169 0000:05:00.0: eth0: link down
[  211.021765] ADDRCONF(NETDEV_UP): eth0: link is not ready
[  211.120471] r8169 0000:05:00.0: PME# enabled
[  213.428249] r8169 0000:05:00.0: PME# disabled
[  213.448510] r8169 0000:05:00.0: eth0: link down
[  215.152314] r8169 0000:05:00.0: eth0: link up
[  215.152632] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

It detects link after ~3 sec after cable plug.
Comment 13 Rafael J. Wysocki 2011-03-06 22:40:53 UTC
This means that the native PCI Express wakeup signaling works with your
network adapter, while the ACPI-based wakeup signaling doesn't.

We might debug further to figure out why the ACPI-based wakeup signaling
doesn't work for you, but https://patchwork.kernel.org/patch/612171/ has
been submitted for merging, so I don't really see the point.
Comment 14 j.fikar 2011-06-06 09:43:18 UTC
Hi,

I'm having related problem, but it seems it is not cured by your patch. It still exists at least in 2.6.38.5.

Steps to reproduce:

1. Cable all time plugged in. Start network normally.

2. Enable PME.

3. Wait some days, I suspect it happens when there is not much network traffic for some time.

4. Network is down, dmesg is filled with many instances of:

....
[1451656.134121] r8169 0000:03:00.0: PME# disabled
[1451656.134988] r8169 0000:03:00.0: eth0: link down
[1451656.143224] r8169 0000:03:00.0: eth0: link down
[1451656.234131] r8169 0000:03:00.0: PME# enabled
[1451659.990634] r8169 0000:03:00.0: eth0: link up
[1451660.002142] r8169 0000:03:00.0: PME# disabled
[1451660.003025] r8169 0000:03:00.0: eth0: link down
[1451660.010397] r8169 0000:03:00.0: eth0: link down
[1451660.103126] r8169 0000:03:00.0: PME# enabled
[1451662.825160] r8169 0000:03:00.0: PME# disabled
[1451662.834810] r8169 0000:03:00.0: PME# enabled
[1451662.926498] r8169 0000:03:00.0: PME# disabled
[1451662.928631] r8169 0000:03:00.0: eth0: link down
....

5. Without enabling PME it does not happen.

6. Manually restarting network solves the problem (i.e. /etc/init.d/net.eth0 restart)
Comment 15 Francois Romieu 2011-08-04 11:27:32 UTC
(In reply to comment #14)
[...]
> I'm having related problem, but it seems it is not cured by your patch. It
> still exists at least in 2.6.38.5.

Your chipset is identified as 8168e in bug 33782. 2.6.38.5 lacks support
for it and I doubt that adding it would be appropriate for a -stable serie.

-- 
Ueimor
Comment 16 j.fikar 2011-08-05 11:58:38 UTC
Created attachment 67632 [details]
dmesg 3.0.0
Comment 17 j.fikar 2011-08-17 11:48:31 UTC
unfortunately the bug described in #14 is still present in 3.0.0, although I had to wait for a week

should I open a new bug since this one is flagged "resolved" ?

Note You need to log in before you can comment on or make changes to this bug.