e100: do suspend/shutdown like e1000
Subsystems (2)
PATCH 1/3 e100: do suspend/shutdown like e1000
From: "Kok, Auke" <[email protected]>
This fixes a "trying to free already free IRQ" message and simplifies the shutdown/suspend code by re-using already existing code when going to suspend. The code is now symmetric with e100_resume.
---
drivers/net/e100.c | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-)
drivers/net/e100.c renamed from drivers/net/e100.c~e100-do-suspend-shutdown-like-e1000 +3 -26
@@ -2782,16 +2782,13 @@ static void __devexit e100_remove(struct } } -#ifdef CONFIG_PM static int e100_suspend (struct pci_dev *pdev,pm_message_t state) {struct net_device *netdev =pci_get_drvdata (pdev);struct nic *nic =netdev_priv (netdev);if (netif_running (netdev)) -napi_disable (&nic->napi); -del_timer_sync (&nic->watchdog); -netif_carrier_off (nic->netdev); +e100_down (nic);netif_device_detach (netdev);pci_save_state (pdev);
@@ -2804,14 +2801,13 @@ static int e100_suspend(struct pci_dev *pci_enable_wake (pdev, PCI_D3cold,0 ); } -free_irq (pdev->irq, netdev); -pci_disable_device (pdev);pci_set_power_state (pdev, PCI_D3hot);return 0 ; } +#ifdef CONFIG_PM static int e100_resume (struct pci_dev *pdev) {struct net_device *netdev =pci_get_drvdata (pdev);
@@ -2832,26 +2828,7 @@ static int e100_resume(struct pci_dev *pstatic void e100_shutdown (struct pci_dev *pdev) { -struct net_device *netdev =pci_get_drvdata (pdev); -struct nic *nic =netdev_priv (netdev); - -if (netif_running (netdev)) -napi_disable (&nic->napi); -del_timer_sync (&nic->watchdog); -netif_carrier_off (nic->netdev); - -if ((nic->flags & wol_magic) |e100_asf (nic)) { -pci_enable_wake (pdev, PCI_D3hot,1 ); -pci_enable_wake (pdev, PCI_D3cold,1 ); - }else { -pci_enable_wake (pdev, PCI_D3hot,0 ); -pci_enable_wake (pdev, PCI_D3cold,0 ); - } - -free_irq (pdev->irq, netdev); - -pci_disable_device (pdev); -pci_set_power_state (pdev, PCI_D3hot); +e100_suspend (pdev,PMSG_SUSPEND ); }/* ------------------ PCI Error Recovery infrastructure -------------- */
_
Quoted 9 lines · [email protected] wrote:
From: "Kok, Auke" <[email protected]>
This fixes a "trying to free already free IRQ" message and simplifies the shutdown/suspend code by re-using already existing code when going to suspend. The code is now symmetric with
e100_resume.Signed-off-by Auke Kok <[email protected]>Tested-by Andrey Borzenkov <[email protected]>Signed-off-by Andrew Morton <[email protected]>
This should already be in jeff's inbox ...
Auke
Quoted 71 lines
---
drivers/net/e100.c | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-)diff -puN
drivers/net/e100.c~e100-do-suspend-shutdown-like-e1000drivers/net/e100.cdrivers/net/e100.c renamed from drivers/net/e100.c~e100-do-suspend-shutdown-like-e1000 +3
-26@@ -2782,16 +2782,13 @@ static void __devexit e100_remove(struct } } -#ifdef CONFIG_PM static int e100_suspend (struct pci_dev *pdev,pm_message_t state) {struct net_device *netdev =pci_get_drvdata (pdev);struct nic *nic =netdev_priv (netdev);if (netif_running (netdev)) -napi_disable (&nic->napi); -del_timer_sync (&nic->watchdog); -netif_carrier_off (nic->netdev); +e100_down (nic);netif_device_detach (netdev);pci_save_state (pdev);@@ -2804,14 +2801,13 @@ static int e100_suspend(struct pci_dev *pci_enable_wake (pdev, PCI_D3cold,0 ); } -free_irq (pdev->irq, netdev); -pci_disable_device (pdev);pci_set_power_state (pdev, PCI_D3hot);return 0 ; } +#ifdef CONFIG_PM static int e100_resume (struct pci_dev *pdev) {struct net_device *netdev =pci_get_drvdata (pdev);@@ -2832,26 +2828,7 @@ static int e100_resume(struct pci_dev *pstatic void e100_shutdown (struct pci_dev *pdev) { -struct net_device *netdev =pci_get_drvdata (pdev); -struct nic *nic =netdev_priv (netdev); - -if (netif_running (netdev)) -napi_disable (&nic->napi); -del_timer_sync (&nic->watchdog); -netif_carrier_off (nic->netdev); - -if ((nic->flags & wol_magic) |e100_asf (nic)) { -pci_enable_wake (pdev, PCI_D3hot,1 ); -pci_enable_wake (pdev, PCI_D3cold,1 ); - }else { -pci_enable_wake (pdev, PCI_D3hot,0 ); -pci_enable_wake (pdev, PCI_D3cold,0 ); - } - -free_irq (pdev->irq, netdev); - -pci_disable_device (pdev); -pci_set_power_state (pdev, PCI_D3hot); +e100_suspend (pdev,PMSG_SUSPEND ); }/* ------------------ PCI Error Recovery infrastructure -------------- */ _
Quoted 7 lines · Auke
Quoted 6 lines · [email protected] wrote:
From: "Kok, Auke" <[email protected]>
This fixes a "trying to free already free IRQ" message and simplifies the shutdown/suspend code by re-using already existing code when going to suspend. The code is now symmetric with
e100_resume.
Quoted 7 lines
Quoted 3 lines
Signed-off-by Auke Kok <[email protected]>Tested-by Andrey Borzenkov <[email protected]>Signed-off-by Andrew Morton <[email protected]>This should already be in jeff's inbox ...
It's been two weeks nearly - Jeff's inbox might have sprunk a leak ;)
There are lots of leaky inboxes - I have just finished spraying nearly 200 dribbles at various maintainers.
Quoted 14 lines · Andrew Morton
Quoted 11 lines · Auke
Quoted 9 lines · [email protected] wrote:
From: "Kok, Auke" <[email protected]>
This fixes a "trying to free already free IRQ" message and simplifies the shutdown/suspend code by re-using already existing code when going to suspend. The code is now symmetric with
e100_resume.Signed-off-by Auke Kok <[email protected]>Tested-by Andrey Borzenkov <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Quoted 7 lines
Quoted 2 lines
This should already be in jeff's inbox ...
It's been two weeks nearly - Jeff's inbox might have sprunk a leak ;)
There are lots of leaky inboxes - I have just finished spraying nearly 200 dribbles at various maintainers.
lol, I actually did not send this to jeff until yesterday myself, so you can blame my inbox for being slow, not Jeff in this case ;)
Auke