Message ID | 200809252238.01656.rjw@sisk.pl |
---|---|
State | Accepted, archived |
Delegated to: | Jeff Garzik |
Headers | show |
On Thu, Sep 25, 2008 at 22:38:01 +0200, Rafael J. Wysocki wrote: > On Thursday, 25 of September 2008, Tino Keitel wrote: > > Hi, > > > > I just found a method how I can enable WOL again: > > > > echo enabled > > > /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/power/wakeup > > > > This device is the NIC device, of cause. > > I guess the box didn't hang during suspend with this setting? > > If that's correct, please test the patch below. With the attached patch, WOL works as intended the hang also didn't happen. Thanks and regards, Tino -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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);