Bug 7969

Summary: tg3 driver: S3 problem in MSI mode
Product: Drivers Reporter: Zhang Rui (rui.zhang)
Component: NetworkAssignee: Rafael J. Wysocki (rjwysocki)
Status: CLOSED CODE_FIX    
Severity: normal CC: mchan
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.19 Subsystem:
Regression: --- Bisected commit-id:
Bug Depends on:    
Bug Blocks: 7216, 56331    
Attachments: /proc/interrupts w/ and w/o "pci=nomsi"
save pci state in suspend method and don't call tg3_halt
bug fix patch

Description Zhang Rui 2007-02-08 17:00:23 UTC
Software Environment: 2.6.19 with MSI enabled
Problem Description:
After a S3 resume, I got "irq 20 nobody cared...",
and then IRQ 20 is disabled.
I tried different workarounds and finally found the two below make sense to me:
1. boot option "pci=nomsi". At this time, eth0 interrupt is routed to irq #20 
rather than PCI-MSI-edge 219.
2. rmmod tg3 driver before suspend and modprobe it after resume.
So, I think it's a tg3 driver S3 problem.
IMO, after resume from S3, tg3 driver forgets the whole "PCI-MSI" thing and 
routes the net card interrupt to irq #20, while leaves the actual interrupt 
handler waiting for PCI-MSI-edge *219.
This explains why kernel can not find a handler for irq #20 and the eth0 
interrupts from /proc/interrupts stop growing after resume.
steps to reproduce:
Build kernel with CONFIG_PCI_MSI enabled.
echo mem >/sys/power/state
press the power button
Comment 1 Zhang Rui 2007-02-08 17:03:31 UTC
Created attachment 10359 [details]
/proc/interrupts w/ and w/o "pci=nomsi"
Comment 2 Zhang Rui 2007-02-08 17:15:29 UTC
Created attachment 10360 [details]
save pci state in suspend method and don't call tg3_halt

Hi,
I knew nothing about the tg3 hardware, so this patch may be totally wrong.
But at least it can help network works well after S3 resume on my laptop.
So I think this may be useful for you to find the problem.
Comment 3 Michael Chan 2007-02-09 14:25:26 UTC
Created attachment 10371 [details]
bug fix patch

Thanks for reporting this problem and providing the initial patch.  I've
attached a better patch which preserves the reset during suspend.  We'll push
out the patch after more testing.
Comment 4 Zhang Rui 2007-02-27 23:11:38 UTC
Sorry for the delay. :)
I tested the patch on my laptop and it works well.
I think we can close this bug.
Thanks.
Comment 5 Rafael J. Wysocki 2007-05-30 10:38:09 UTC
Closing. :-)