2007-01-21 19:17:55

by Andrei Popa

[permalink] [raw]
Subject: [BUG] eth0 appers many times in /proc/interrupts after resume

Hello,

It's the 10th resume and in /proc/interrupts eth0 appers 10 times.

ierdnac ~ # cat /proc/interrupts
CPU0 CPU1
0: 19690962 21390 IO-APIC-edge timer
1: 34666 0 IO-APIC-edge i8042
8: 12 0 IO-APIC-edge rtc
9: 189109 0 IO-APIC-fasteoi acpi
12: 2467502 62285 IO-APIC-edge i8042
14: 40 0 IO-APIC-edge ide0
17: 1156971 14168 IO-APIC-fasteoi uhci_hcd:usb5,
i915@pci:0000:00:02.0
18: 0 0 IO-APIC-fasteoi uhci_hcd:usb4
19: 0 0 IO-APIC-fasteoi uhci_hcd:usb3
20: 1 26290 IO-APIC-fasteoi ehci_hcd:usb1,
uhci_hcd:usb2
21: 408192 0 IO-APIC-fasteoi HDA Intel
22: 249414 2543 IO-APIC-fasteoi ohci1394, eth0, eth0,
eth0, eth0, eth0, eth0, eth0, eth0, eth0, eth0
223: 220668 0 PCI-MSI-edge libata
NMI: 0 0
LOC: 19338002 19135738
ERR: 0
MIS: 0


ierdnac ~ # lsmod
Module Size Used by
snd_seq 47120 0
snd_seq_device 6860 1 snd_seq
snd_hda_intel 16344 4
snd_hda_codec 157568 1 snd_hda_intel
snd_pcm 68100 3 snd_hda_intel,snd_hda_codec
snd_timer 18884 3 snd_seq,snd_pcm
snd 38776 12
snd_seq,snd_seq_device,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer
snd_page_alloc 7880 2 snd_hda_intel,snd_pcm
usb_storage 33156 0
ohci1394 32176 0
ieee1394 82964 1 ohci1394
e100 31368 0
uhci_hcd 21516 0
ehci_hcd 27596 0
usbcore 100948 3 usb_storage,uhci_hcd,ehci_hcd


from dmesg:
Restarting tasks ... done.
Suspend2 debugging info:
- Suspend core : 2.2.9.1
- Kernel Version : 2.6.20-rc4
- Compiler vers. : 4.1
- Attempt number : 10
- Parameters : 0 81936 0 1 0 5
- Overall expected compression percentage: 0.
- Compressor is 'lzf'.
Compressed 525217792 bytes into 449285477 (14 percent compression).
- SwapAllocator active.
Swap available for image: 250982 pages.
- I/O speed: Write 43 MB/s, Read 44 MB/s.
- Extra pages : -99 used/500.
Enabling non-boot CPUs ...
SMP alternatives: switching to SMP code
Booting processor 1/1 eip 3000
CPU 1 irqstacks, hard=c04bd000 soft=c04b5000

suspend2 maintainer:
"That is interesting! Unfortunately, I don't touch anything in that area.
Could I get you to send the message to the Linux kernel mailing list?

Regards,

Nigel"

ierdnac ~ # uname -a
Linux ierdnac 2.6.20-rc4 #0 SMP PREEMPT Wed Jan 10 18:34:14 EET 2007 i686 Genuine Intel(R) CPU T2050 @ 1.60GHz GenuineIntel GNU/Linux





2007-01-21 21:24:41

by Frederik Deweerdt

[permalink] [raw]
Subject: Re: [BUG] eth0 appers many times in /proc/interrupts after resume

On Sun, Jan 21, 2007 at 09:17:41PM +0200, Andrei Popa wrote:
> It's the 10th resume and in /proc/interrupts eth0 appers 10 times.
>
Hi,

The e100_resume() function should be calling netif_device_detach and
free_irq. Could you try the following (compile tested) patch?

Regards,
Frederik

Signed-off-by: Frederik Deweerdt <[email protected]>

diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 2fe0445..0c376e4 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2671,6 +2671,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
del_timer_sync(&nic->watchdog);
netif_carrier_off(nic->netdev);

+ netif_device_detach(netdev);
pci_save_state(pdev);

if ((nic->flags & wol_magic) | e100_asf(nic)) {
@@ -2682,6 +2683,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
}

pci_disable_device(pdev);
+ free_irq(pdev->irq, netdev);
pci_set_power_state(pdev, PCI_D3hot);

return 0;

2007-01-21 21:45:35

by Kok, Auke

[permalink] [raw]
Subject: Re: [BUG] e100: eth0 appers many times in /proc/interrupts after resume

Frederik Deweerdt wrote:
> On Sun, Jan 21, 2007 at 09:17:41PM +0200, Andrei Popa wrote:
>> It's the 10th resume and in /proc/interrupts eth0 appers 10 times.
>
> The e100_resume() function should be calling netif_device_detach and
> free_irq. Could you try the following (compile tested) patch?

I just fixed suspend/shutdown for e100 in 2.6.19, not sure why the problem still
shows up. Since it's a driver/net issue, you should CC netdev on it tho,
otherwise it might go unnoticed.

I'll open up the can-o-worms on this issue and see what's up with it.

I'm not so sure that this patch is OK, and I wonder why it stopped working,
because I spent quite some time fixing it only a few months ago. Did swsup
change again? sigh...

Auke

>
> Signed-off-by: Frederik Deweerdt <[email protected]>
>
> diff --git a/drivers/net/e100.c b/drivers/net/e100.c
> index 2fe0445..0c376e4 100644
> --- a/drivers/net/e100.c
> +++ b/drivers/net/e100.c
> @@ -2671,6 +2671,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
> del_timer_sync(&nic->watchdog);
> netif_carrier_off(nic->netdev);
>
> + netif_device_detach(netdev);
> pci_save_state(pdev);
>
> if ((nic->flags & wol_magic) | e100_asf(nic)) {
> @@ -2682,6 +2683,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
> }
>
> pci_disable_device(pdev);
> + free_irq(pdev->irq, netdev);
> pci_set_power_state(pdev, PCI_D3hot);
>
> return 0;
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2007-01-21 22:07:29

by Frederik Deweerdt

[permalink] [raw]
Subject: Re: [BUG] e100: eth0 appers many times in /proc/interrupts after resume

On Sun, Jan 21, 2007 at 01:45:27PM -0800, Auke Kok wrote:
> Frederik Deweerdt wrote:
> >On Sun, Jan 21, 2007 at 09:17:41PM +0200, Andrei Popa wrote:
> >>It's the 10th resume and in /proc/interrupts eth0 appers 10 times.
> >The e100_resume() function should be calling netif_device_detach and
> >free_irq. Could you try the following (compile tested) patch?
>
> I just fixed suspend/shutdown for e100 in 2.6.19, not sure why the problem still shows up. Since it's a driver/net issue, you
> should CC netdev on it tho, otherwise it might go unnoticed.
Thanks for adding the CC
>
> I'll open up the can-o-worms on this issue and see what's up with it.
>
> I'm not so sure that this patch is OK, and I wonder why it stopped working, because I spent quite some time fixing it only a
> few months ago. Did swsup change again? sigh...

I may well be wrong (It appears that most of the time I am :)), but the
unbalanced netif_device_attach (in resume) looks suspicious. resume()
also calls request_irq, so calling free_irq on suspend seemed logical.

Regards,
Frederik

>
> Auke
>
> >Signed-off-by: Frederik Deweerdt <[email protected]>
> >diff --git a/drivers/net/e100.c b/drivers/net/e100.c
> >index 2fe0445..0c376e4 100644
> >--- a/drivers/net/e100.c
> >+++ b/drivers/net/e100.c
> >@@ -2671,6 +2671,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
> > del_timer_sync(&nic->watchdog);
> > netif_carrier_off(nic->netdev);
> > + netif_device_detach(netdev);
> > pci_save_state(pdev);
> > if ((nic->flags & wol_magic) | e100_asf(nic)) {
> >@@ -2682,6 +2683,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
> > }
> > pci_disable_device(pdev);
> >+ free_irq(pdev->irq, netdev);
> > pci_set_power_state(pdev, PCI_D3hot);
> > return 0;
> >-
> >To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> >the body of a message to [email protected]
> >More majordomo info at http://vger.kernel.org/majordomo-info.html
> >Please read the FAQ at http://www.tux.org/lkml/
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2007-01-23 00:15:58

by Kok, Auke

[permalink] [raw]
Subject: Re: [BUG] e100: eth0 appers many times in /proc/interrupts after resume

Frederik Deweerdt wrote:
> On Sun, Jan 21, 2007 at 01:45:27PM -0800, Auke Kok wrote:
>> Frederik Deweerdt wrote:
>>> On Sun, Jan 21, 2007 at 09:17:41PM +0200, Andrei Popa wrote:
>>>> It's the 10th resume and in /proc/interrupts eth0 appers 10 times.
>>> The e100_resume() function should be calling netif_device_detach and
>>> free_irq. Could you try the following (compile tested) patch?
>> I just fixed suspend/shutdown for e100 in 2.6.19, not sure why the problem still shows up. Since it's a driver/net issue, you
>> should CC netdev on it tho, otherwise it might go unnoticed.
> Thanks for adding the CC
>> I'll open up the can-o-worms on this issue and see what's up with it.
>>
>> I'm not so sure that this patch is OK, and I wonder why it stopped working, because I spent quite some time fixing it only a
>> few months ago. Did swsup change again? sigh...
>
> I may well be wrong (It appears that most of the time I am :)), but the
> unbalanced netif_device_attach (in resume) looks suspicious. resume()
> also calls request_irq, so calling free_irq on suspend seemed logical.

I just tested the patch and looked it over again. The patch works good and
indeed fixes the problem, and netconsole works great. It even shows much of the
suspend/resume over the wire, something which I can't remember seeing before
with netconsole. reboot -f also works OK.

I'll push the patch upstream, thanks!

Auke

2007-01-23 09:13:14

by Andrei Popa

[permalink] [raw]
Subject: Re: [BUG] eth0 appers many times in /proc/interrupts after resume


It's ok, after 4 suspend/resume cycles, eth0 only appers one time.

On Sun, 2007-01-21 at 21:22 +0000, Frederik Deweerdt wrote:
> On Sun, Jan 21, 2007 at 09:17:41PM +0200, Andrei Popa wrote:
> > It's the 10th resume and in /proc/interrupts eth0 appers 10 times.
> >
> Hi,
>
> The e100_resume() function should be calling netif_device_detach and
> free_irq. Could you try the following (compile tested) patch?
>
> Regards,
> Frederik
>
> Signed-off-by: Frederik Deweerdt <[email protected]>
>
> diff --git a/drivers/net/e100.c b/drivers/net/e100.c
> index 2fe0445..0c376e4 100644
> --- a/drivers/net/e100.c
> +++ b/drivers/net/e100.c
> @@ -2671,6 +2671,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
> del_timer_sync(&nic->watchdog);
> netif_carrier_off(nic->netdev);
>
> + netif_device_detach(netdev);
> pci_save_state(pdev);
>
> if ((nic->flags & wol_magic) | e100_asf(nic)) {
> @@ -2682,6 +2683,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
> }
>
> pci_disable_device(pdev);
> + free_irq(pdev->irq, netdev);
> pci_set_power_state(pdev, PCI_D3hot);
>
> return 0;