Bug 9538

Summary: m526x link failed after resuming from sleep mode
Product: Drivers Reporter: Alexander Goomenyuk (emerg.reanimator)
Component: NetworkAssignee: Jeff Garzik (jgarzik)
Status: RESOLVED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: bunk, htejun, rjwysocki
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.22-gentoo-r9 Subsystem:
Regression: --- Bisected commit-id:
Bug Depends on:    
Bug Blocks: 7216    
Attachments: m526x debug printouts

Description Alexander Goomenyuk 2007-12-10 19:32:57 UTC
Most recent kernel where this bug did not occur: NA
Distribution: Gentoo
Hardware Environment: 939Dual-SATA2 (m526x + rtl8201cl)
Software Environment: Linux localhost 2.6.22-gentoo-r9 #18 SMP Tue Dec 11 03:59:33 EET 2007 x86_64 AMD Athlon(tm) 64 FX-60 Dual Core Processor AuthenticAMD GNU/Linux, m526x v0.9.3 (latest)
Problem Description: After resuming from sleep mode link may not be established. 

Steps to reproduce:
1) echo -n standby > /sys/power/state
2) Resmue the PC


I will attach the debug printouts from m526x driver. I see that the DCR8 register is not zero after resume. And driver decide to restart the controller because of that. I assume DCR8 is some kind of Tx timeout. I have not found and DS for that chip :(

It seems to me that restart of PHY should be sufficient to alive the link. For me it looks more like a HW problem.
Comment 1 Alexander Goomenyuk 2007-12-10 19:35:32 UTC
Created attachment 13963 [details]
m526x debug printouts
Comment 2 Rafael J. Wysocki 2007-12-12 15:57:21 UTC
The fix adding the suspend/resume handling for this driver went in after 2.6.23.

The patch is available here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b6aec32a7774a398c4a194ad6b6392528b5a7a5b;hp=917270c6ed7a99d4300ce57508246813ea8613b0#patch1
but I'm not sure if it will apply to your kernel.

Anyway, I have the same mainboard as you do and I can't reproduce the problem with   a recent kernel (2.6.24-rc4-190-g94545ba to be exact).
Comment 3 Alexander Goomenyuk 2007-12-15 11:28:47 UTC
I tried "Linux localhost 2.6.24-rc4-git6 #7 SMP Sat Dec 15 18:55:32 EET 2007 x86_64 AMD Athlon(tm) 64 FX-60 Dual Core Processor AuthenticAMD GNU/Linux"

and it works fine for me

Here is the log:
Dec 15 21:16:55 localhost uli526x 0000:00:11.0: LATE suspend
Dec 15 21:16:55 localhost uli526x 0000:00:11.0: EARLY resume
Dec 15 21:16:55 localhost uli526x 0000:00:11.0: resuming
Dec 15 21:16:55 localhost uli526x: uli526x_resume 0
Dec 15 21:16:55 localhost uli526x: uli526x_init() 0
Dec 15 21:16:55 localhost uli526x: uli526x_descriptor_init() 0
Dec 15 21:16:55 localhost uli526x: send_filter_frame() 0
Dec 15 21:16:55 localhost uli526x: Link Failed 0
Dec 15 21:16:55 localhost uli526x: eth1 NIC Link is Down
Dec 15 21:16:55 localhost uli526x: uli526x_get_stats 0
Dec 15 21:16:55 localhost uli526x: Link link OK 3
Dec 15 21:16:55 localhost uli526x: Link Failed : 7849
Dec 15 21:16:55 localhost uli526x: Link link OK 3
Dec 15 21:16:55 localhost uli526x: eth1 NIC Link is Up 100 Mbps Full duplex
Dec 15 21:16:55 localhost uli526x: uli526x_get_stats 0
Dec 15 21:16:55 localhost Restarting tasks ... <3>uli526x: uli526x_start_xmit 0
Dec 15 21:16:55 localhost uli526x: uli526x_start_xmit 0
Dec 15 21:16:55 localhost uli526x: uli526x_start_xmit 0
Dec 15 21:16:55 localhost uli526x: uli526x_start_xmit 0
Dec 15 21:16:55 localhost uli526x: uli526x_start_xmit 0