netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: andi@lisas.de
Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Make e100 suspend handler support PCI cards lacking PM capability
Date: Sun, 14 Jun 2009 19:09:45 +0200	[thread overview]
Message-ID: <200906141909.46354.rjw@sisk.pl> (raw)
In-Reply-To: <20090614164604.GA19746@rhlx01.hs-esslingen.de>

On Sunday 14 June 2009, Andreas Mohr wrote:
> Hi,
> 
> On Sun, Jun 14, 2009 at 04:06:29PM +0200, Rafael J. Wysocki wrote:
> > On Sunday 14 June 2009, Andreas Mohr wrote:
> > > Hi,
> > > 
> > > On Sun, Jun 14, 2009 at 12:28:15AM +0200, Rafael J. Wysocki wrote:
> > > > On Saturday 13 June 2009, Andreas Mohr wrote:
> > > > > +
> > > > >  	if (wake) {
> > > > >  		return pci_prepare_to_sleep(pdev);
> > > > 
> > > > pci_prepare_to_sleep() is supposed to return 0 for your device.  I'll have a
> > > > look at it.
> > > 
> > > No, wake is false for my card, thus that's not the branch to
> > > investigate.
> > 
> > Ah.  The problem is, then, that we try to put the device into D3, which it
> > cannot do and error code is correctly returned from pci_set_power_state().
> > 
> > I would use the appended patch in that case and the patch sent previously
> > is necessary for the 'wake = true' case.
> 
> OK, as said I cannot test this right now, but I'm _damn_ sure it would
> work. Thus I'd say your equivalent patch posted a bit later can be
> committed already.
> 
> But what about the wake = true case?
> I'm not affected by this since my card doesn't have any wake capa,
> thus it's your call of whether that pci core code part really was broken
> and needed fixing.

I think it needs fixing.

> So, for the patch in your next mail:
> Acked-by: Andreas Mohr <andi@lisas.de>
> 
> 
> BTW, that patch was (pasted):
> 
>  static int __e100_power_off(struct pci_dev *pdev, bool wake)
>  {
> -       if (wake) {
> +       if (wake)
>                 return pci_prepare_to_sleep(pdev);
> -       } else {
> -               pci_wake_from_d3(pdev, false);
> -               return pci_set_power_state(pdev, PCI_D3hot);
> -       }
> +
> +       pci_wake_from_d3(pdev, false);
> +       pci_set_power_state(pdev, PCI_D3hot);
> +
> +       return 0;
>  }
> 
> 
> Couple questions still:
> - why do we call pci_wake_from_d3(...false) only!?
>   Wouldn't this break WoL after one iteration back and forth,
>   due to missing 'true' case?

The 'true' case is the 'wake = true' one.

> - why do we call netif_device_detach() _after_ doing hardware shutdown
>   of the network controller? I'd guess this can cause huge issues?
>   Someone told me he had rtnl lock issues upon S2D with e100
>   (very similar to my rtnl issues during aborted .suspend),
>   and that might possibly be the reason?

I think you're right, but I'm not a network driver expert.

Perhaps you can change the ordering and see if that fixes the rtnl issue
(since you're able to reproduce it without my patch, that should be easy to
verify).

Best,
Rafael

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects

  reply	other threads:[~2009-06-14 17:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-28  8:01 [GIT]: Networking David Miller
2008-12-29 10:25 ` Andreas Mohr
2008-12-29 17:17   ` Andrew Morton
2008-12-29 21:09     ` Johannes Berg
2008-12-30 11:05       ` Andreas Mohr
2008-12-29 23:15     ` Jeff Kirsher
2008-12-30 12:07       ` Andreas Mohr
2009-02-28 20:37         ` 2.6.29 e100.c non-MII support status? (Re: [GIT]: Networking) Andreas Mohr
2009-03-01 10:57           ` Jeff Kirsher
2009-03-01 21:24             ` Andreas Mohr
2009-06-02 21:48               ` [PATCH] Add non-MII PHY support to e100 (Re: 2.6.29 e100.c non-MII support status? (Re: [GIT]: Networking)) Andreas Mohr
2009-06-03  6:01                 ` e100 kills S2R on my box, plus network drops dead Andreas Mohr
2009-06-03  6:30                   ` Andreas Mohr
2009-06-13 19:19                     ` [PATCH] Make e100 suspend handler support PCI cards lacking PM capability Andreas Mohr
2009-06-13 22:28                       ` Rafael J. Wysocki
2009-06-13 22:45                         ` Rafael J. Wysocki
2009-06-14 12:51                         ` Andreas Mohr
2009-06-14 14:06                           ` Rafael J. Wysocki
2009-06-14 16:31                             ` Rafael J. Wysocki
2009-06-14 16:46                             ` Andreas Mohr
2009-06-14 17:09                               ` Rafael J. Wysocki [this message]
2009-06-14 17:20                                 ` Andreas Mohr
2009-06-19  8:00                                 ` Andreas Mohr
2009-06-14 19:46                               ` [PATCH] Net / e100: Fix suspend of devices that cannot be power managed Rafael J. Wysocki
2009-06-18  2:03                                 ` David Miller

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=200906141909.46354.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=andi@lisas.de \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).