From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753605Ab0IOMk4 (ORCPT ); Wed, 15 Sep 2010 08:40:56 -0400 Received: from sm-d311v.smileserver.ne.jp ([203.211.202.206]:25242 "EHLO sm-d311v.smileserver.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753402Ab0IOMky (ORCPT ); Wed, 15 Sep 2010 08:40:54 -0400 Message-ID: <001901cb54d3$3c49c010$66f8800a@maildom.okisemi.com> From: "Masayuki Ohtake" To: "Rafael J. Wysocki" , "Jiri Slaby" Cc: "David S. Miller" , "Randy Dunlap" , "John Linn" , "Ralf Baechle" , "Kristoffer Glembo" , "Maxime Bizon" , "Greg Rose" , "ML netdev" , "LKML" , "MeeGo" , "Stephen Hemminger" , "FUJITA Tomonori" , "Wang, Qi" , "Wang, Yong Y" , "Andrew" , "Intel OTC" , "Foster, Margie" , "Arjan" , "Toshiharu Okada" , "Takahiro Shimizu" , "Tomoya Morinaga" References: <4C89C23A.6090707@dsn.okisemi.com> <4C89EA12.3000409@suse.cz> <201009130019.27356.rjw@sisk.pl> Subject: Re: [PATCH v3] Gigabit Ethernet driver of Topcliff PCH Date: Wed, 15 Sep 2010 21:26:08 +0900 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1983 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1983 X-Hosting-Pf: 0 X-NAI-Spam-Score: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rafael Thank you for your comment. I will confirm pci.txt and r8169.c. Thanks Ohtake. ----- Date: Mon, 13 Sep 2010 00:19:26 +0200 From: "Rafael J. Wysocki" > > > > +#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 >