From 179d4328d33ca888b5a65c35b7aa430a9c3b7a27 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Fri, 13 Nov 2009 19:09:46 +0100 Subject: [PATCH] Add a patch to fix Intel E100 wake-on-lan problems. Fixes bug #0000465 --- lfs/linux | 3 + .../linux-2.6.27.39_e100-wakeonlan-fix.patch | 73 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 src/patches/linux-2.6.27.39_e100-wakeonlan-fix.patch diff --git a/lfs/linux b/lfs/linux index 61d5e56f91..fe2d70fb76 100644 --- a/lfs/linux +++ b/lfs/linux @@ -121,6 +121,9 @@ endif # Add Alix to Led Driver cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.24-leds-alix.patch + # Patch to fix Intel e100 wake on lan + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.39_e100-wakeonlan-fix.patch + # Not report deprecated syscall 1.23 (for kudzu) cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.25.18-not_report_sysctl_1.23.patch ifeq "$(XEN)" "" diff --git a/src/patches/linux-2.6.27.39_e100-wakeonlan-fix.patch b/src/patches/linux-2.6.27.39_e100-wakeonlan-fix.patch new file mode 100644 index 0000000000..5a43f73531 --- /dev/null +++ b/src/patches/linux-2.6.27.39_e100-wakeonlan-fix.patch @@ -0,0 +1,73 @@ +From: Rafael J. Wysocki +Date: Wed, 29 Oct 2008 21:22:18 +0000 (-0700) +Subject: e100: adapt to the reworked PCI PM +X-Git-Tag: v2.6.29-rc1~581^2~935 +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=bc79fc8409b3dccbde072e8113cc1fb3fd876fc5 + +e100: adapt to the reworked PCI PM + +Adapt the e100 driver to the reworked PCI PM + +* Use the observation that it is sufficient to call pci_enable_wake() + once, unless it fails + +Signed-off-by: Rafael J. Wysocki +Tested-by: Jeff Kirsher +Acked-by: Jeff Kirsher +Cc: Jesse Barnes +Cc: Jeff Garzik +Cc: Frans Pop +Signed-off-by: Andrew Morton +Signed-off-by: Jeff Garzik +--- + +diff --git a/drivers/net/e100.c b/drivers/net/e100.c +index bb4b6e2..084127f 100644 +--- a/drivers/net/e100.c ++++ b/drivers/net/e100.c +@@ -2322,7 +2322,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) + { + struct nic *nic = netdev_priv(netdev); + +- if(wol->wolopts != WAKE_MAGIC && wol->wolopts != 0) ++ if ((wol->wolopts && wol->wolopts != WAKE_MAGIC) || ++ !device_can_wakeup(&nic->pdev->dev)) + return -EOPNOTSUPP; + + if(wol->wolopts) +@@ -2330,6 +2331,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) + else + nic->flags &= ~wol_magic; + ++ device_set_wakeup_enable(&nic->pdev->dev, wol->wolopts); ++ + e100_exec_cb(nic, NULL, e100_configure); + + return 0; +@@ -2733,8 +2736,10 @@ static int __devinit e100_probe(struct pci_dev *pdev, + + /* Wol magic packet can be enabled from eeprom */ + if((nic->mac >= mac_82558_D101_A4) && +- (nic->eeprom[eeprom_id] & eeprom_id_wol)) ++ (nic->eeprom[eeprom_id] & eeprom_id_wol)) { + nic->flags |= wol_magic; ++ device_set_wakeup_enable(&pdev->dev, true); ++ } + + /* ack any pending wake events, disable PME */ + pci_pme_active(pdev, false); +@@ -2793,11 +2798,10 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state) + pci_save_state(pdev); + + if ((nic->flags & wol_magic) | e100_asf(nic)) { +- pci_enable_wake(pdev, PCI_D3hot, 1); +- pci_enable_wake(pdev, PCI_D3cold, 1); ++ if (pci_enable_wake(pdev, PCI_D3cold, true)) ++ pci_enable_wake(pdev, PCI_D3hot, true); + } else { +- pci_enable_wake(pdev, PCI_D3hot, 0); +- pci_enable_wake(pdev, PCI_D3cold, 0); ++ pci_enable_wake(pdev, PCI_D3hot, false); + } + + pci_disable_device(pdev); -- 2.39.2