netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] igb: fix kexec with igb
@ 2009-03-07  4:33 Yinghai Lu
  2009-03-07  7:18 ` Jesse Brandeburg
  0 siblings, 1 reply; 36+ messages in thread
From: Yinghai Lu @ 2009-03-07  4:33 UTC (permalink / raw)
  To: David Miller, Rafael J. Wysocki, Ingo Molnar, Andrew Morton
  Cc: linux-kernel@vger.kernel.org, NetDev


Impact: could probe igb

Found one system with 82575EB, in the kernel that is kexeced, probe igb
failed with -2.

it looks like the same behavior happened on forcedeth.

try to check system_state to make sure if put it on D3

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 drivers/net/igb/igb_main.c |   19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

Index: linux-2.6/drivers/net/igb/igb_main.c
===================================================================
--- linux-2.6.orig/drivers/net/igb/igb_main.c
+++ linux-2.6/drivers/net/igb/igb_main.c
@@ -4358,14 +4358,22 @@ static int igb_suspend(struct pci_dev *p
 		wr32(E1000_WUFC, 0);
 	}
 
+	/*
+	 * Apparently it is not possible to reinitialise from D3 hot,
+	 * only put the device into D3 if we really go for poweroff.
+	 */
 	/* make sure adapter isn't asleep if manageability/wol is enabled */
 	if (wufc || adapter->en_mng_pt) {
-		pci_enable_wake(pdev, PCI_D3hot, 1);
-		pci_enable_wake(pdev, PCI_D3cold, 1);
+		if (system_state == SYSTEM_POWER_OFF) {
+			pci_enable_wake(pdev, PCI_D3hot, 1);
+			pci_enable_wake(pdev, PCI_D3cold, 1);
+		}
 	} else {
 		igb_shutdown_fiber_serdes_link_82575(hw);
-		pci_enable_wake(pdev, PCI_D3hot, 0);
-		pci_enable_wake(pdev, PCI_D3cold, 0);
+		if (system_state == SYSTEM_POWER_OFF) {
+			pci_enable_wake(pdev, PCI_D3hot, 0);
+			pci_enable_wake(pdev, PCI_D3cold, 0);
+		}
 	}
 
 	/* Release control of h/w to f/w.  If f/w is AMT enabled, this
@@ -4374,7 +4382,8 @@ static int igb_suspend(struct pci_dev *p
 
 	pci_disable_device(pdev);
 
-	pci_set_power_state(pdev, pci_choose_state(pdev, state));
+	if (system_state == SYSTEM_POWER_OFF)
+		pci_set_power_state(pdev, pci_choose_state(pdev, state));
 
 	return 0;
 }

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2009-03-31 20:27 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-07  4:33 [PATCH] igb: fix kexec with igb Yinghai Lu
2009-03-07  7:18 ` Jesse Brandeburg
2009-03-07  7:31   ` Yinghai Lu
2009-03-07 18:20     ` Eric W. Biederman
2009-03-07 18:50       ` Yinghai Lu
2009-03-08 10:45         ` Rafael J. Wysocki
2009-03-08 10:57     ` Rafael J. Wysocki
2009-03-08 18:03       ` Yinghai Lu
2009-03-08 18:10       ` Yinghai Lu
2009-03-08 21:08         ` Rafael J. Wysocki
2009-03-08 21:18           ` Yinghai Lu
2009-03-08 21:40             ` Rafael J. Wysocki
2009-03-08 21:32           ` Rafael J. Wysocki
2009-03-08 22:35             ` Yinghai Lu
2009-03-08 22:57               ` Rafael J. Wysocki
2009-03-08 23:04                 ` Yinghai Lu
2009-03-08 23:57                   ` Rafael J. Wysocki
2009-03-11 23:37             ` Yinghai Lu
2009-03-21 22:04               ` [Updated patch] " Rafael J. Wysocki
2009-03-24 22:35                 ` Yinghai Lu
2009-03-28 21:27                   ` Rafael J. Wysocki
2009-03-29  2:30                     ` Jeff Kirsher
2009-03-29 11:19                       ` Rafael J. Wysocki
2009-03-30 21:36                         ` Jeff Kirsher
2009-03-30 21:39                           ` Rafael J. Wysocki
2009-03-31 19:14                             ` Tantilov, Emil S
2009-03-31 19:51                               ` Jeff Kirsher
2009-03-31 20:27                                 ` Rafael J. Wysocki
2009-03-08  8:09   ` [PATCH] pci: fix kexec with power state D3 Yinghai Lu
2009-03-08 10:08     ` Rafael J. Wysocki
2009-03-08 10:15       ` Ingo Molnar
2009-03-08 10:28         ` Rafael J. Wysocki
2009-03-08 10:33           ` Rafael J. Wysocki
2009-03-08 11:08             ` Ingo Molnar
2009-03-20  1:49               ` Jesse Barnes
2009-03-20 11:29                 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).