From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Jiri Slaby <jslaby@suse.cz>
Cc: Masayuki Ohtake <masa-korg@dsn.okisemi.com>,
"David S. Miller" <davem@davemloft.net>,
Randy Dunlap <randy.dunlap@oracle.com>,
John Linn <john.linn@xilinx.com>,
Ralf Baechle <ralf@linux-mips.org>,
Kristoffer Glembo <kristoffer@gaisler.com>,
Maxime Bizon <mbizon@freebox.fr>,
Greg Rose <gregory.v.rose@intel.com>,
ML netdev <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>, MeeGo <meego-dev@meego.com>,
Stephen Hemminger <shemminger@vyatta.com>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
"Wang, Qi" <qi.wang@intel.com>,
"Wang, Yong Y" <yong.y.wang@intel.com>,
Andrew <andrew.chih.howe.khor@intel.com>,
Intel OTC <joel.clark@intel.com>,
"Foster, Margie" <margie.foster@intel.com>,
Arjan <arjan@linux.intel.com>,
Toshiharu Okada <okada533@dsn.okisemi.com>,
Takahiro Shimizu <shimizu394@dsn.okisemi.com>,
Tomoya Morinaga <morinaga526@dsn.okisemi.com>
Subject: Re: [PATCH v3] Gigabit Ethernet driver of Topcliff PCH
Date: Mon, 13 Sep 2010 00:19:26 +0200 [thread overview]
Message-ID: <201009130019.27356.rjw@sisk.pl> (raw)
In-Reply-To: 4C89EA12.3000409@suse.cz
On Friday, September 10, 2010, Rafael J. Wysocki wrote:
> On Friday, September 10, 2010, Jiri Slaby wrote:
> > Ccing Rafael (please find pch_gbe_resume here)
Thanks.
...
> >
> > > +#ifdef CONFIG_PM
> > > +static int pch_gbe_resume(struct pci_dev *pdev)
> > > +{
> > > + struct net_device *netdev = pci_get_drvdata(pdev);
> > > + struct pch_gbe_adapter *adapter = netdev_priv(netdev);
> > > + struct pch_gbe_hw *hw = &adapter->hw;
> > > + u32 err;
> > > +
> > > + pci_enable_wake(pdev, PCI_D0, 0);
> > > + pci_set_power_state(pdev, PCI_D0);
> > > + pci_restore_state(pdev);
> > > + err = pci_enable_device(pdev);
> > > + if (err) {
> > > + pr_err("Cannot enable PCI device from suspend\n");
> > > + return err;
> > > + }
> > > + pci_set_master(pdev);
> >
> > Not sure which of those you need. Rafael may tell you more. You should
> > not set power state and restore state, but I might be wrong.
You're basically right. In fact you're supposed to use struct dev_pm_ops
for defining PM callbacks and then you don't need do any PCI-specific
operations directly in the driver.
All of this is described in detail in Documentation/power/pci.txt and you
can have a look into r8169.c for a reference implementation.
Thanks,
Rafael
next prev parent reply other threads:[~2010-09-12 22:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 5:29 [PATCH v3] Gigabit Ethernet driver of Topcliff PCH Masayuki Ohtake
2010-09-10 6:32 ` Joe Perches
2010-09-15 12:19 ` Masayuki Ohtake
2010-09-10 8:19 ` Jiri Slaby
2010-09-12 22:19 ` Rafael J. Wysocki [this message]
2010-09-15 12:26 ` Masayuki Ohtake
2010-09-15 12:20 ` Masayuki Ohtake
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=201009130019.27356.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=andrew.chih.howe.khor@intel.com \
--cc=arjan@linux.intel.com \
--cc=davem@davemloft.net \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=gregory.v.rose@intel.com \
--cc=joel.clark@intel.com \
--cc=john.linn@xilinx.com \
--cc=jslaby@suse.cz \
--cc=kristoffer@gaisler.com \
--cc=linux-kernel@vger.kernel.org \
--cc=margie.foster@intel.com \
--cc=masa-korg@dsn.okisemi.com \
--cc=mbizon@freebox.fr \
--cc=meego-dev@meego.com \
--cc=morinaga526@dsn.okisemi.com \
--cc=netdev@vger.kernel.org \
--cc=okada533@dsn.okisemi.com \
--cc=qi.wang@intel.com \
--cc=ralf@linux-mips.org \
--cc=randy.dunlap@oracle.com \
--cc=shemminger@vyatta.com \
--cc=shimizu394@dsn.okisemi.com \
--cc=yong.y.wang@intel.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).