2.4.29, e100 and a WOL packet causes keventd going mad
Subsystems (2)
Hi,
I experience the same problems as reported by Michael Gernoth when sending a WOL-packet to computer with a e100 NIC which is already powered on.
In my case, it's running kernel 2.6.8.1 and the NIC is identified by lspci as:
0000:02:08.0 Ethernet controller: Intel Corp. 82562EZ 10/100 Ethernet Controller (rev 02) or numerically:
0000:02:08.0 0200: 8086:1050 (rev 02)
The symptoms is that kacpid starts using all the CPU time it can, a shutdown takes 5 - 10 minutes after I've done this (in contrast to 20 - 30 seconds when the machine is healthy).
Also, if I do a "shutdown -h" on the machine after sending a WOL packet when it's already powered up, it will shutdown and immediately start up again instead of powering off.
So, any suggestions on how to fix it?
Regards,
David
Please CC me on any replies.
Quoted 3 lines · David Härdeman
I experience the same problems as reported by Michael Gernoth when sending a WOL-packet to computer with a e100 NIC which is already powered on.
I didn't look at the 2.4 case, but for 2.6, it seems e100 was enabling PME wakeup during probe. PME shouldn't be enabled while the system is up. I suspect the assertion of PME while the system is up is what's causing problems. This patch moves PME wakeup enabling to either suspend or shutdown.
David, would you give this patch a try? Make sure the system still wakes from a magic packet if suspended or shut down, and doesn't cause kacpid to go crazy if system is running. If it helps for 2.6, perhaps someone can look into 2.4 to see if there is something similar going on there.
-scott
drivers/net/e100.c renamed from drivers/net/e100.c.orig +12 -3
@@ -1868,7 +1868,6 @@ static int e100_set_wol(struct net_devicelse nic->flags &= ~wol_magic; -pci_enable_wake (nic->pdev,0 , nic->flags & (wol_magic |e100_asf (nic)));e100_exec_cb (nic,NULL , e100_configure);return 0 ;
@@ -2262,8 +2261,6 @@ static int __devinit e100_probe(struct p (nic->eeprom[eeprom_id] & eeprom_id_wol)) nic->flags |= wol_magic; -pci_enable_wake (pdev,0 , nic->flags & (wol_magic |e100_asf (nic))); -strcpy (netdev->name,"eth%d" );if ((err =register_netdev (netdev))) {DPRINTK (PROBE ,ERR ,"Cannot register net device, aborting.\n" );
@@ -2344,6 +2341,15 @@ static int e100_resume(struct pci_dev *p }#endif +static void e100_shutdown (struct device *dev) +{ + struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); +struct net_device *netdev =pci_get_drvdata (pdev); +struct nic *nic =netdev_priv (netdev); + +pci_enable_wake (pdev,0 , nic->flags & (wol_magic |e100_asf (nic))); +} +static struct pci_driver e100_driver = { .name =DRV_NAME , .id_table = e100_id_table,
@@ -2353,6 +2359,9 @@ static struct pci_driver e100_driver = { .suspend = e100_suspend, .resume = e100_resume, #endif + .driver = { + .shutdown = e100_shutdown, + } };static int __init e100_init_module (void )
Hi.
Do you also disable the WOL event when resuming?
Regards,
Nigel
Quoted 72 lines · Scott Feldman
Quoted 3 lines · David Härdeman
I experience the same problems as reported by Michael Gernoth when sending a WOL-packet to computer with a e100 NIC which is already powered on.
I didn't look at the 2.4 case, but for 2.6, it seems e100 was enabling PME wakeup during probe. PME shouldn't be enabled while the system is up. I suspect the assertion of PME while the system is up is what's causing problems. This patch moves PME wakeup enabling to either suspend or shutdown.
David, would you give this patch a try? Make sure the system still wakes from a magic packet if suspended or shut down, and doesn't cause kacpid to go crazy if system is running. If it helps for 2.6, perhaps someone can look into 2.4 to see if there is something similar going on there.
(quoted diff) +0
-1-scottdrivers/net/e100.c renamed from drivers/net/e100.c.orig +12
-4@@ -1868,7 +1868,6 @@ static int e100_set_wol(struct net_devicelse nic->flags &= ~wol_magic; -pci_enable_wake (nic->pdev,0 , nic->flags & (wol_magic |e100_asf (nic)));e100_exec_cb (nic,NULL , e100_configure);return 0 ;@@ -2262,8 +2261,6 @@ static int __devinit e100_probe(struct p (nic->eeprom[eeprom_id] & eeprom_id_wol)) nic->flags |= wol_magic; -pci_enable_wake (pdev,0 , nic->flags & (wol_magic |e100_asf (nic))); -strcpy (netdev->name,"eth%d" );if ((err =register_netdev (netdev))) {DPRINTK (PROBE ,ERR ,"Cannot register net device, aborting.\n" );@@ -2344,6 +2341,15 @@ static int e100_resume(struct pci_dev *p }#endif +static void e100_shutdown (struct device *dev) +{ + struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); +struct net_device *netdev =pci_get_drvdata (pdev); +struct nic *nic =netdev_priv (netdev); + +pci_enable_wake (pdev,0 , nic->flags & (wol_magic |e100_asf (nic))); +} +static struct pci_driver e100_driver = { .name =DRV_NAME , .id_table = e100_id_table,@@ -2353,6 +2359,9 @@ static struct pci_driver e100_driver = { .suspend = e100_suspend, .resume = e100_resume, #endif + .driver = { + .shutdown = e100_shutdown, + } };static int __init e100_init_module (void ) -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/
Signature · 5 lines
Nigel Cunningham Software Engineer, Canberra, Australia http://www.cyclades.com Ph: +61 (2) 6292 8028 Mob: +61 (417) 100 574
Quoted 11 lines · Scott Feldman
Quoted 3 lines · David Härdeman
I experience the same problems as reported by Michael Gernoth when sending a WOL-packet to computer with a e100 NIC which is already powered on.
I didn't look at the 2.4 case, but for 2.6, it seems e100 was enabling PME wakeup during probe. PME shouldn't be enabled while the system is up. I suspect the assertion of PME while the system is up is what's causing problems. This patch moves PME wakeup enabling to either suspend or shutdown.
Quoted 4 lines
David, would you give this patch a try? Make sure the system still wakes from a magic packet if suspended or shut down, and doesn't cause kacpid to go crazy if system is running. If it helps for 2.6, perhaps someone can look into 2.4 to see if there is something similar going on
This issue was reported on 2.4.
Quoted 56 lines
there.
(quoted diff) +0
-1-scottdrivers/net/e100.c 2005-01-30 19:26:41.154305536 -0800 renamed from drivers/net/e100.c.orig 2005-01-30 19:13:56.850497376 -0800 +12
-4@@ -1868,7 +1868,6 @@ static int e100_set_wol(struct net_devic else nic->flags &= ~wol_magic; - pci_enable_wake(nic->pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); e100_exec_cb(nic, NULL, e100_configure); return 0;@@ -2262,8 +2261,6 @@ static int __devinit e100_probe(struct p (nic->eeprom[eeprom_id] & eeprom_id_wol)) nic->flags |= wol_magic; - pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); - strcpy(netdev->name, "eth%d"); if((err = register_netdev(netdev))) { DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n");@@ -2344,6 +2341,15 @@ static int e100_resume(struct pci_dev *p } #endif +static void e100_shutdown(struct device *dev) +{ + struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); + struct net_device *netdev = pci_get_drvdata(pdev); + struct nic *nic = netdev_priv(netdev); + + pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); +} + static struct pci_driver e100_driver = { .name = DRV_NAME, .id_table = e100_id_table,@@ -2353,6 +2359,9 @@ static struct pci_driver e100_driver = { .suspend = e100_suspend, .resume = e100_resume, #endif + .driver = { + .shutdown = e100_shutdown, + } }; static int __init e100_init_module(void) -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/
Quoted 1 line · Nigel Cunningham
Do you also disable the WOL event when resuming?
Good catch. How's this look?
drivers/net/e100.c renamed from drivers/net/e100.c.orig +15 -4
@@ -1868,7 +1868,6 @@ static int e100_set_wol(struct net_devicelse nic->flags &= ~wol_magic; -pci_enable_wake (nic->pdev,0 , nic->flags & (wol_magic |e100_asf (nic)));e100_exec_cb (nic,NULL , e100_configure);return 0 ;
@@ -2262,8 +2261,6 @@ static int __devinit e100_probe(struct p (nic->eeprom[eeprom_id] & eeprom_id_wol)) nic->flags |= wol_magic; -pci_enable_wake (pdev,0 , nic->flags & (wol_magic |e100_asf (nic))); -strcpy (netdev->name,"eth%d" );if ((err =register_netdev (netdev))) {DPRINTK (PROBE ,ERR ,"Cannot register net device, aborting.\n" );
@@ -2320,7 +2317,8 @@ static int e100_suspend(struct pci_dev *netif_device_detach (netdev);pci_save_state (pdev); -pci_enable_wake (pdev, state, nic->flags & (wol_magic |e100_asf (nic))); +pci_enable_wake (pdev,pci_choose_state (pdev, state), + nic->flags & (wol_magic |e100_asf (nic)));pci_disable_device (pdev);pci_set_power_state (pdev,pci_choose_state (pdev, state));
@@ -2333,6 +2331,7 @@ static int e100_resume(struct pci_dev *pstruct nic *nic =netdev_priv (netdev);pci_set_power_state (pdev,PCI_D0 ); +pci_enable_wake (pdev,PCI_D0 ,0 );pci_restore_state (pdev);e100_hw_init (nic);
@@ -2344,6 +2343,15 @@ static int e100_resume(struct pci_dev *p }#endif +static void e100_shutdown (struct device *dev) +{ + struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); +struct net_device *netdev =pci_get_drvdata (pdev); +struct nic *nic =netdev_priv (netdev); + +pci_enable_wake (pdev,PCI_D0 , nic->flags & (wol_magic |e100_asf (nic))); +} +static struct pci_driver e100_driver = { .name =DRV_NAME , .id_table = e100_id_table,
@@ -2353,6 +2361,9 @@ static struct pci_driver e100_driver = { .suspend = e100_suspend, .resume = e100_resume, #endif + .driver = { + .shutdown = e100_shutdown, + } };static int __init e100_init_module (void )
Hi.
Quoted 4 lines · Scott Feldman
Quoted 1 line · Nigel Cunningham
Do you also disable the WOL event when resuming?
Good catch. How's this look?
I looked at it last week because I used it for an example of device model drivers at the CELF conference. I got your intel address from the top of the .c file, but IIRC it bounced. Providence :>
[...]
drivers/net/e100.c static int e100_resume(struct pci_dev *p · line 2336
Quoted 7 lines
drivers/net/e100.c renamed from drivers/net/e100.c.orig +1
-0@@ -2333,6 +2331,7 @@ static int e100_resume(struct pci_dev *pstruct nic *nic =netdev_priv (netdev);pci_set_power_state (pdev,PCI_D0 ); +pci_enable_wake (pdev,PCI_D0 ,0 );pci_restore_state (pdev);e100_hw_init (nic);
Shouldn't this be disable_wake?
Regards,
Nigel
Signature · 5 lines
Nigel Cunningham Software Engineer, Canberra, Australia http://www.cyclades.com Ph: +61 (2) 6292 8028 Mob: +61 (417) 100 574
Hi again.
Ignore that :> I realised later that there's only one badly named routine and my assumption that there was another called disable_.. was wrong :>
Nigel
Quoted 27 lines · Nigel Cunningham
Hi.
Quoted 4 lines · Scott Feldman
Quoted 1 line · Nigel Cunningham
Do you also disable the WOL event when resuming?
Good catch. How's this look?
I looked at it last week because I used it for an example of device model drivers at the CELF conference. I got your intel address from the top of the .c file, but IIRC it bounced. Providence :>
[...]
drivers/net/e100.c static int e100_resume(struct pci_dev *p · line 2336
Quoted 7 lines
drivers/net/e100.c renamed from drivers/net/e100.c.orig +1
-0@@ -2333,6 +2331,7 @@ static int e100_resume(struct pci_dev *pstruct nic *nic =netdev_priv (netdev);pci_set_power_state (pdev,PCI_D0 ); +pci_enable_wake (pdev,PCI_D0 ,0 );pci_restore_state (pdev);e100_hw_init (nic);Shouldn't this be
disable_wake?Regards,
Nigel
Signature · 5 lines
Nigel Cunningham Software Engineer, Canberra, Australia http://www.cyclades.com Ph: +61 (2) 6292 8028 Mob: +61 (417) 100 574
Quoted 14 lines · Bukie Mabayoje
Quoted 11 lines · Scott Feldman
Quoted 3 lines · David Härdeman
I experience the same problems as reported by Michael Gernoth when sending a WOL-packet to computer with a e100 NIC which is already powered on.
I didn't look at the 2.4 case, but for 2.6, it seems e100 was enabling PME wakeup during probe. PME shouldn't be enabled while the system is up. I suspect the assertion of PME while the system is up is what's causing problems. This patch moves PME wakeup enabling to either suspend or shutdown.
Quoted 6 lines
Quoted 4 lines
David, would you give this patch a try? Make sure the system still wakes from a magic packet if suspended or shut down, and doesn't cause kacpid to go crazy if system is running. If it helps for 2.6, perhaps someone can look into 2.4 to see if there is something similar going on
This issue was reported on 2.4.
Can any of you guys test v2.6, please?
Quoted 11 lines · Marcelo Tosatti
Quoted 7 lines · Bukie Mabayoje
Quoted 4 lines · Scott Feldman
David, would you give this patch a try? Make sure the system still wakes from a magic packet if suspended or shut down, and doesn't cause kacpid to go crazy if system is running. If it helps for 2.6, perhaps someone can look into 2.4 to see if there is something similar going on
This issue was reported on 2.4.
Can any of you guys test v2.6, please?
I tried the second patch provided by Scott on a 2.6.10 kernel, I did some minor tweaks to get it to apply (changed pci_choose_state() and PCI_D0 back to the way they were in 2.6.10) and tested the results five minutes ago.
It works great, I havent tried suspending the machine cause I have no need for that functionality. I have however started the machine via WOL (works), sent WOL-packet to the machine when powered on (nothing happends - kacpid doesn't go wild, works), shutdown (works without the machine spontaneously rebooting).
So everything seems to be fixed by the patch (save for suspending which I didn't test).
Thanks alot, I hope the patch will be in the next stable 2.6 kernel.
Regards,
David
Quoted 15 lines · Marcelo Tosatti
Quoted 14 lines · Bukie Mabayoje
Quoted 11 lines · Scott Feldman
Quoted 3 lines · David Härdeman
I experience the same problems as reported by Michael Gernoth when sending a WOL-packet to computer with a e100 NIC which is already powered on.
I didn't look at the 2.4 case, but for 2.6, it seems e100 was enabling PME wakeup during probe. PME shouldn't be enabled while the system is up. I suspect the assertion of PME while the system is up is what's causing problems. This patch moves PME wakeup enabling to either suspend or shutdown.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
David, would you give this patch a try? Make sure the system still wakes from a magic packet if suspended or shut down, and doesn't cause kacpid to go crazy if system is running. If it helps for 2.6, perhaps someone can look into 2.4 to see if there is something similar going on
This issue was reported on 2.4.
Can any of you guys test v2.6, please?
I will be glad to test it now but I can't, I am currently doing some work on 2.4. If no one has tested it in the next few days I will validate it then.
By the way, do anyone have an idea how to get this functionality into 2.4 eepro100. The problem is that eepro100 code works on a non WOL cards.
Quoted 7 lines
-
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/