netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: netdev@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>,
	Jeff Garzik <jeff@garzik.org>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	LKML <linux-kernel@vger.kernel.org>,
	pm list <linux-pm@lists.linux-foundation.org>,
	"Brandeburg, Jesse" <jesse.brandeburg@intel.com>,
	Stephen Hemminger <stephen.hemminger@vyatta.com>
Subject: Re: [PATCH 2/3] Adapt the sky2 driver to the reworked PCI PM
Date: Fri, 15 Aug 2008 15:01:57 +0200	[thread overview]
Message-ID: <200808151501.58315.rjw@sisk.pl> (raw)
In-Reply-To: <20080814152318.625f8609@extreme>

On Friday, 15 of August 2008, Stephen Hemminger wrote:
> On Thu, 14 Aug 2008 23:38:17 +0200
> "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> 
> > Adapt the sky2 driver to the reworked PCI PM
> > 
> > * Use device_set_wakeup_enable() and friends as needed
> > * Remove an open-coded reference to the standard PCI PM registers
> > * Use pci_prepare_to_sleep() and pci_back_from_sleep() in the
> >   ->suspend() and ->resume() callbacks
> > * Use the observation that it is sufficient to call pci_enable_wake()
> >   once, unless it fails
> > 
> > Tested on Asus M3A32-MVP (Yukon-2 EC Ultra rev 3).
> > 
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> > ---
> >  drivers/net/sky2.c |   34 ++++++++++------------------------
> >  1 file changed, 10 insertions(+), 24 deletions(-)
> > 
> > Index: linux-2.6/drivers/net/sky2.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/net/sky2.c
> > +++ linux-2.6/drivers/net/sky2.c
> > @@ -3035,7 +3035,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;
> >  
> 
> There was a regression in earlier releases caused because some BIOS's
> are wrong, and device can wakeup.

device_can_wakeup() returns 'true' if the device is capable of generating PME#
from at least one low power state (this is determined on the basis of the
contents of the device's PCI PM registers - please have a look at
drivers/pci/pci_pm_init() for details) or if ACPI tells us it can wake up.
IOW, the BIOSes opinion doesn't matter if we find that the device is capable of
generating PME#, so the regression must have been related to something else.
I'm very interested in the details, if available.

Of course, since we rely on the ability of the device to generate PME# and
device_can_wakeup() returning 'false' means that the device cannot generate
PME# from any state, it's reasonable to check it IMO.

Thanks,
Rafael

  reply	other threads:[~2008-08-15 12:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-14 21:35 [PATCH 0/3] Adapt three network drivers to the reworked PCI PM Rafael J. Wysocki
2008-08-14 21:37 ` [PATCH 1/3] Adapt the skge driver " Rafael J. Wysocki
2008-08-14 21:38 ` [PATCH 2/3] Adapt the sky2 " Rafael J. Wysocki
2008-08-14 22:23   ` Stephen Hemminger
2008-08-15 13:01     ` Rafael J. Wysocki [this message]
2008-08-15 13:07       ` Rafael J. Wysocki
2008-08-15 13:32       ` Rafael J. Wysocki
2008-08-15 16:15         ` Stephen Hemminger
2008-08-14 21:40 ` [PATCH 3/3] Adapt the e100 " Rafael J. Wysocki
2008-08-14 23:56   ` Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200808151501.58315.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=jeff@garzik.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=stephen.hemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).