netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sky2: Fix recent WOL regression
@ 2008-10-02 21:39 Rafael J. Wysocki
  2008-10-03  7:02 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2008-10-02 21:39 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Andrew Morton, David Miller, LKML, pm list, Tino Keitel,
	Stephen Hemminger, netdev, Jesse Barnes

From: Rafael J. Wysocki <rjw@sisk.pl>

sky2: Fix recent 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() (this fixes a regression from 2.6.26 on the Tino's
machine).

Remove an open-coded reference to the standard PCI PM registers that
is not used any more.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-by: Tino Keitel <tino.keitel@gmx.de>
---

 drivers/net/sky2.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: linux-2.6/drivers/net/sky2.c
===================================================================
--- linux-2.6.orig/drivers/net/sky2.c
+++ linux-2.6/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;
@@ -4166,18 +4169,6 @@ static int __devinit sky2_test_msi(struc
 	return err;
 }
 
-static int __devinit pci_wake_enabled(struct pci_dev *dev)
-{
-	int pm  = pci_find_capability(dev, PCI_CAP_ID_PM);
-	u16 value;
-
-	if (!pm)
-		return 0;
-	if (pci_read_config_word(dev, pm + PCI_PM_CTRL, &value))
-		return 0;
-	return value & PCI_PM_CTRL_PME_ENABLE;
-}
-
 /* This driver supports yukon2 chipset only */
 static const char *sky2_name(u8 chipid, char *buf, int sz)
 {
@@ -4238,7 +4241,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);

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

* Re: [PATCH] sky2: Fix recent WOL regression
  2008-10-02 21:39 [PATCH] sky2: Fix recent WOL regression Rafael J. Wysocki
@ 2008-10-03  7:02 ` Stephen Hemminger
  2008-10-08 22:55   ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2008-10-03  7:02 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Jeff Garzik, Andrew Morton, David Miller, LKML, pm list,
	Tino Keitel, netdev, Jesse Barnes

On Thu, 2 Oct 2008 23:39:33 +0200
"Rafael J. Wysocki" <rjw@sisk.pl> wrote:

> From: Rafael J. Wysocki <rjw@sisk.pl>
> 
> sky2: Fix recent 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() (this fixes a regression from 2.6.26 on the Tino's
> machine).
> 
> Remove an open-coded reference to the standard PCI PM registers that
> is not used any more.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> Reported-by: Tino Keitel <tino.keitel@gmx.de>
> ---

Acked-by: Stephen Hemminger <shemminger@vyatta.com>

Thanks for fixing this.

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

* Re: [PATCH] sky2: Fix recent WOL regression
  2008-10-03  7:02 ` Stephen Hemminger
@ 2008-10-08 22:55   ` Rafael J. Wysocki
  2008-10-08 23:12     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2008-10-08 22:55 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Jeff Garzik, Andrew Morton, David Miller, LKML, pm list,
	Tino Keitel, netdev, Jesse Barnes

On Friday, 3 of October 2008, Stephen Hemminger wrote:
> On Thu, 2 Oct 2008 23:39:33 +0200
> "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> 
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > sky2: Fix recent 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() (this fixes a regression from 2.6.26 on the Tino's
> > machine).
> > 
> > Remove an open-coded reference to the standard PCI PM registers that
> > is not used any more.
> > 
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> > Reported-by: Tino Keitel <tino.keitel@gmx.de>
> > ---
> 
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> Thanks for fixing this.

Can you please include this patch into your next push for Jeff?

It seems to have been overlooked.

Thanks,
Rafael

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

* Re: [PATCH] sky2: Fix recent WOL regression
  2008-10-08 22:55   ` Rafael J. Wysocki
@ 2008-10-08 23:12     ` David Miller
  2008-10-09 21:01       ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2008-10-08 23:12 UTC (permalink / raw)
  To: rjw
  Cc: shemminger, jeff, akpm, linux-kernel, linux-pm, tino.keitel,
	netdev, jbarnes

From: "Rafael J. Wysocki" <rjw@sisk.pl>
Date: Thu, 9 Oct 2008 00:55:55 +0200

> On Friday, 3 of October 2008, Stephen Hemminger wrote:
> > On Thu, 2 Oct 2008 23:39:33 +0200
> > "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> > 
> > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > > 
> > > sky2: Fix recent 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() (this fixes a regression from 2.6.26 on the Tino's
> > > machine).
> > > 
> > > Remove an open-coded reference to the standard PCI PM registers that
> > > is not used any more.
> > > 
> > > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> > > Reported-by: Tino Keitel <tino.keitel@gmx.de>
> > > ---
> > 
> > Acked-by: Stephen Hemminger <shemminger@vyatta.com>
> > 
> > Thanks for fixing this.
> 
> Can you please include this patch into your next push for Jeff?
> 
> It seems to have been overlooked.

I missed this ACK but I did add the patch to my tree as you
can see from another email of mine.

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

* Re: [PATCH] sky2: Fix recent WOL regression
  2008-10-08 23:12     ` David Miller
@ 2008-10-09 21:01       ` Rafael J. Wysocki
  0 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2008-10-09 21:01 UTC (permalink / raw)
  To: David Miller
  Cc: shemminger, jeff, akpm, linux-kernel, linux-pm, tino.keitel,
	netdev, jbarnes

On Thursday, 9 of October 2008, David Miller wrote:
> From: "Rafael J. Wysocki" <rjw@sisk.pl>
> Date: Thu, 9 Oct 2008 00:55:55 +0200
> 
> > On Friday, 3 of October 2008, Stephen Hemminger wrote:
> > > On Thu, 2 Oct 2008 23:39:33 +0200
> > > "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> > > 
> > > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > > > 
> > > > sky2: Fix recent 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() (this fixes a regression from 2.6.26 on the Tino's
> > > > machine).
> > > > 
> > > > Remove an open-coded reference to the standard PCI PM registers that
> > > > is not used any more.
> > > > 
> > > > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> > > > Reported-by: Tino Keitel <tino.keitel@gmx.de>
> > > > ---
> > > 
> > > Acked-by: Stephen Hemminger <shemminger@vyatta.com>
> > > 
> > > Thanks for fixing this.
> > 
> > Can you please include this patch into your next push for Jeff?
> > 
> > It seems to have been overlooked.
> 
> I missed this ACK but I did add the patch to my tree as you
> can see from another email of mine.

I saw it, thanks!

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

end of thread, other threads:[~2008-10-09 20:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-02 21:39 [PATCH] sky2: Fix recent WOL regression Rafael J. Wysocki
2008-10-03  7:02 ` Stephen Hemminger
2008-10-08 22:55   ` Rafael J. Wysocki
2008-10-08 23:12     ` David Miller
2008-10-09 21:01       ` 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).