netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: mchan@broadcom.com
Cc: joachim.deguara@amd.com, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, michal.k.k.piotrowski@gmail.com,
	netdev@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [REGRESSION] tg3 dead after s2ram
Date: Thu, 02 Aug 2007 15:06:36 -0700 (PDT)	[thread overview]
Message-ID: <20070802.150636.77057800.davem@davemloft.net> (raw)
In-Reply-To: <1186081829.18322.20.camel@dell>

From: "Michael Chan" <mchan@broadcom.com>
Date: Thu, 02 Aug 2007 12:10:29 -0700

> On Thu, 2007-08-02 at 02:23 -0700, David Miller wrote:
> > From: "Joachim Deguara" <joachim.deguara@amd.com>
> > Date: Thu, 2 Aug 2007 11:15:05 +0200
> > 
> > > Seams like even if powersave shuts down the network that the device should 
> > > still work after a suspend to ram, so who is at fault here?
> > 
> > It's a good question.
> > 
> > The pci_enable() is done on the PCI device at probe time, at least in
> > the tg3 driver, and with such a model restoring and saving of PCI
> > config space should not be dependant upon whether the netdev is
> > running or not.
> > 
> 
> Alternatively, we can also fix it by calling pci_enable_device() again
> in tg3_open().  But I think it is better to just always save and restore
> in suspend/resume.  bnx2.c will also require the same fix.

We could do it that way.  But don't you think it's more reliable to
save and restore around the event we know will be what clobbers the
PCI config space on us? :-)

Other things might happen between ->resume() and ->open() that could
modify PCI config space, and we could overwrite such changes if we do
the PCI restore in ->open().

One thing that's interesting to me is that, essentially, every PCI
driver with very few if any exceptions needs to do this sequence on
suspend and resume.  It would be nice if there was a way to get this
to happen transparently by default, with some reasonable override
mechanism, for PCI device drivers.

Anyways, once your patch is tested feel free to send me the bnx2
one too.

Thanks!

  reply	other threads:[~2007-08-02 22:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200707311128.32528.joachim.deguara@amd.com>
2007-08-01  0:45 ` [REGRESSION] tg3 dead after s2ram Andrew Morton
2007-08-01  7:53   ` Michael Chan
2007-08-01  8:01     ` Joachim Deguara
2007-08-01 17:47       ` Michael Chan
2007-08-01 21:00         ` Michael Chan
2007-08-02  8:05           ` Joachim Deguara
2007-08-02  9:15             ` Joachim Deguara
2007-08-02  9:23               ` David Miller
2007-08-02 19:10                 ` Michael Chan
2007-08-02 22:06                   ` David Miller [this message]
2007-08-02 23:38                     ` Michael Chan
2007-08-03  9:47                   ` Joachim Deguara
2007-08-04  3:57                   ` 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=20070802.150636.77057800.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@linux-foundation.org \
    --cc=joachim.deguara@amd.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=michal.k.k.piotrowski@gmail.com \
    --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).