Patchwork [2/2] r8169: WoL fixes

login
register
mail settings
Submitter Bruno Prémont
Date Oct. 4, 2008, 4:08 p.m.
Message ID <20081004180834.71c1bdf2@neptune.home>
Download mbox | patch
Permalink /patch/2700/
State Accepted
Delegated to: Jeff Garzik
Headers show

Comments

Bruno Prémont - Oct. 4, 2008, 4:08 p.m.
Since recent kernel (2.6.26 or 2.6.27) the PCI wakeup functions are
influenced by generic device ability and configuration when enabling
PCI-device triggered wake-up.

This patch causes WoL setting to enable/disable device's wish to
be permitted to wake-up the host when changing WoL options and
also during device probing.

Without this patch one has write 'enabled' to
  /sys/bus/pci/devices/0000:02:08.0/power/wakeup

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
---
--
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
Rafael J. Wysocki - Oct. 4, 2008, 6:10 p.m.
On Saturday, 4 of October 2008, Bruno Prémont wrote:
> Since recent kernel (2.6.26 or 2.6.27) the PCI wakeup functions are
> influenced by generic device ability and configuration when enabling
> PCI-device triggered wake-up.
> 
> This patch causes WoL setting to enable/disable device's wish to
> be permitted to wake-up the host when changing WoL options and
> also during device probing.
> 
> Without this patch one has write 'enabled' to
>   /sys/bus/pci/devices/0000:02:08.0/power/wakeup
> 
> Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>

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

> ---
> --- linux-2.6.27-rc8-git6.orig/drivers/net/r8169.c	2008-10-04 12:31:48.000000000 +0200
> +++ linux-2.6.27-rc8-git6/drivers/net/r8169.c	2008-10-04 16:51:48.000000000 +0200
> @@ -619,6 +619,7 @@ static int rtl8169_set_wol(struct net_de
>  		tp->features |= RTL_FEATURE_WOL;
>  	else
>  		tp->features &= ~RTL_FEATURE_WOL;
> +	device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
>  
>  	spin_unlock_irq(&tp->lock);
>  
> @@ -1796,6 +1797,7 @@ rtl8169_init_one(struct pci_dev *pdev, c
>  	}
>  
>  	rtl8169_init_phy(dev, tp);
> +	device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
>  
>  out:
>  	return rc;
> 
> 


--
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

Patch

--- linux-2.6.27-rc8-git6.orig/drivers/net/r8169.c	2008-10-04 12:31:48.000000000 +0200
+++ linux-2.6.27-rc8-git6/drivers/net/r8169.c	2008-10-04 16:51:48.000000000 +0200
@@ -619,6 +619,7 @@  static int rtl8169_set_wol(struct net_de
 		tp->features |= RTL_FEATURE_WOL;
 	else
 		tp->features &= ~RTL_FEATURE_WOL;
+	device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
 
 	spin_unlock_irq(&tp->lock);
 
@@ -1796,6 +1797,7 @@  rtl8169_init_one(struct pci_dev *pdev, c
 	}
 
 	rtl8169_init_phy(dev, tp);
+	device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
 
 out:
 	return rc;