Re: Regression in 2.6.27-rc7: Wake On LAN with sky2 broken

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rafael J. Wysocki
Date: Thursday, September 25, 2008 - 1:38 pm

On Thursday, 25 of September 2008, Tino Keitel wrote:

I guess the box didn't hang during suspend with this setting?

If that's correct, please test the patch below.


No, you didn't.

The behavior was changed by the PCI wake-up patches that fixed a couple of
problems and I'd like to fix all of the cases when the new behavior causes
issues like this to happen.

I'll send you a patch for the EHCI case later today.

Thanks,
Rafael

---
sky2: Fix WOL regression

Since dev->power.should_wakeup bit is used by the PCI core to
decide whether the device should wake up the system from sleep
states, set/unset this bit whenever WOL is enabled/disabled using
sky2_set_wol().

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---

 drivers/net/sky2.c |   34 ++++++++++------------------------
 1 file changed, 10 insertions(+), 24 deletions(-)

diff -puN drivers/net/sky2.c~skty2-adapt-to-the-reworked-pci-pm drivers/net/sky2.c
--- a/drivers/net/sky2.c~skty2-adapt-to-the-reworked-pci-pm
+++ a/drivers/net/sky2.c
@@ -3034,7 +3034,8 @@ static int sky2_set_wol(struct net_devic
 	struct sky2_port *sky2 = netdev_priv(dev);
 	struct sky2_hw *hw = sky2->hw;
 
-	if (wol->wolopts & ~sky2_wol_supported(sky2->hw))
+	if ((wol->wolopts & ~sky2_wol_supported(sky2->hw))
+	    || !device_can_wakeup(&hw->pdev->dev))
 		return -EOPNOTSUPP;
 
 	sky2->wol = wol->wolopts;
@@ -3045,6 +3046,8 @@ static int sky2_set_wol(struct net_devic
 		sky2_write32(hw, B0_CTST, sky2->wol
 			     ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);
 
+	device_set_wakeup_enable(&hw->pdev->dev, sky2->wol);
+
 	if (!netif_running(dev))
 		sky2_wol_init(sky2);
 	return 0;
@@ -4314,7 +4305,7 @@ static int __devinit sky2_probe(struct p
 		}
 	}
 
-	wol_default = pci_wake_enabled(pdev) ? WAKE_MAGIC : 0;
+	wol_default = device_may_wakeup(&pdev->dev) ? WAKE_MAGIC : 0;
 
 	err = -ENOMEM;
 	hw = kzalloc(sizeof(*hw), GFP_KERNEL);

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Regression in 2.6.27-rc7: Wake On LAN with sky2 broken, Tino Keitel, (Wed Sep 24, 1:05 am)
Re: Regression in 2.6.27-rc7: Wake On LAN with sky2 broken, Rafael J. Wysocki, (Wed Sep 24, 12:13 pm)
Re: Regression in 2.6.27-rc7: Wake On LAN with sky2 broken, Rafael J. Wysocki, (Wed Sep 24, 2:10 pm)
Re: Regression in 2.6.27-rc7: Wake On LAN with sky2 broken, Rafael J. Wysocki, (Thu Sep 25, 1:38 pm)