Bug 3801

Summary: (net 8139too) does not set PME-Enable upon setting WOL
Product: Drivers Reporter: Karol Kozimor (sziwan)
Component: NetworkAssignee: Jeff Garzik (jgarzik)
Status: REJECTED UNREPRODUCIBLE    
Severity: low CC: ossi, protasnb, romieu
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.9 Subsystem:
Regression: --- Bisected commit-id:
Attachments: a hack that fixes the problem
suspend/resume/wol

Description Karol Kozimor 2004-11-23 15:34:08 UTC
It seems that [at least on my notebook], ethtool -s eth0 wol pumbg does not 
set the PME-Enable bit in the PCI config space, thus preventing WOL from 
working. 
 
lspci -vv after ethtool -s eth0 wol pumbg: 
02:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. 
RTL-8139/8139C/8139C+ (rev 10) 
        Subsystem: Asustek Computer, Inc.: Unknown device 1045 
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- 
        Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR- 
        Latency: 32 (8000ns min, 16000ns max) 
        Interrupt: pin A routed to IRQ 11 
        Region 0: I/O ports at a800 [size=256] 
        Region 1: Memory at d6800000 (32-bit, non-prefetchable) [size=256] 
        Capabilities: [50] Power Management version 2 
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA 
PME(D0-,D1+,D2+,D3hot+,D3cold+) 
                Status: D0 PME-Enable- DSel=0 DScale=0 PME- 
 
 
lspci -vv after suspending, sending a magic packet and resuming manually: 
[...] 
                Status: D0 PME-Enable- DSel=0 DScale=0 PME+
Comment 1 Karol Kozimor 2006-01-03 03:57:54 UTC
Any updates on this one? It's been a year now and my 8139 still doesn't wake 
up... 
Comment 2 Karol Kozimor 2006-01-03 04:45:02 UTC
Created attachment 6924 [details]
a hack that fixes the problem

Apparently, the attached patch does the trick. It probably badly violates the
driver model, but it works.
Comment 3 Francois Romieu 2006-02-28 15:17:44 UTC
Created attachment 7487 [details]
suspend/resume/wol
Comment 4 Francois Romieu 2006-02-28 15:19:22 UTC
Karol, can you give the patch above a try (no warranty) ?
It is diffed against 2.6.16-rc5.

-- 
Ueimor
Comment 5 Natalie Protasevich 2007-09-19 21:46:51 UTC
Karol, did you get chance to test the patch from #3? Does the card work with recent kernel?
Thanks.
Comment 6 Natalie Protasevich 2008-03-04 19:22:44 UTC
Closing the bug for no recent activity. Please reopen if confirmed with newest kernel.
Comment 7 Oswald Buddenhagen 2010-01-01 11:50:57 UTC
i've been reading some driver code ... it seems that the WoL hardware setup is intentionally delayed until some power-down state is entered, which kinda makes sense, assuming the hardware would never enter sleep without letting the kernel know about it. though the driver i looked at (b44) seems to "forget" to do it in certain situations ... investigating ...