public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Adam Belay <abelay@novell.com>
Cc: Linux-pm mailing list <linux-pm@lists.osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH 6/6] PCI PM: pci_save/restore_state improvements
Date: Wed, 16 Nov 2005 10:06:55 -0800	[thread overview]
Message-ID: <20051116180655.GC6908@suse.de> (raw)
In-Reply-To: <1132125965.3656.15.camel@localhost.localdomain>

On Wed, Nov 16, 2005 at 02:26:04AM -0500, Adam Belay wrote:
> On Tue, 2005-11-15 at 22:31 -0800, Greg KH wrote:
> > On Tue, Nov 15, 2005 at 10:31:42PM -0500, Adam Belay wrote:
> > > This patch makes some improvements to pci_save_state and
> > > pci_restore_state.  Instead of saving and restoring all standard
> > > registers (even read-only ones), it only restores necessary registers.
> > > Also, the command register is handled more carefully.  Let me know if
> > > I'm missing anything important.
> > > 
> > > 
> > > --- a/drivers/pci/pm.c	2005-11-13 20:32:24.000000000 -0500
> > > +++ b/drivers/pci/pm.c	2005-11-13 20:29:32.000000000 -0500
> > > @@ -53,10 +53,13 @@
> > >   */
> > >  int pci_save_state(struct pci_dev *dev)
> > >  {
> > > -	int i;
> > > -	/* XXX: 100% dword access ok here? */
> > > -	for (i = 0; i < 16; i++)
> > > -		pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]);
> > > +	struct pci_dev_config * conf = &dev->saved_config;
> > > +
> > > +	pci_read_config_word(dev, PCI_COMMAND, &conf->command);
> > > +	pci_read_config_byte(dev, PCI_CACHE_LINE_SIZE, &conf->cacheline_size);
> > > +	pci_read_config_byte(dev, PCI_LATENCY_TIMER, &conf->latency_timer);
> > > +	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &conf->interrupt_line);
> > 
> > Why are we saving and restoring smaller ammounts of config space now?
> 
> After looking at the spec, it seems that most of the registers we were
> restoring were read-only and couldn't possibly need to be restored.
> Also, the PCI PM spec suggests that only a subset of the registers
> should be restored.  Finally, things like BIST should probably never be
> touched.

Ok, but be aware that this _might_ cause problems for some cards/drivers
that were relying on the old way...  As long as you don't mind me
assigning those bugs to you, I don't have a problem with this :)

thanks,

greg k-h

  reply	other threads:[~2005-11-16 18:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-16  3:31 [RFC][PATCH 6/6] PCI PM: pci_save/restore_state improvements Adam Belay
2005-11-16  6:31 ` Greg KH
2005-11-16  7:26   ` Adam Belay
2005-11-16 18:06     ` Greg KH [this message]
2005-11-17 16:55       ` [linux-pm] " Patrick Mochel
2005-11-17 23:50       ` Adam Belay
2005-11-17 23:39         ` [linux-pm] " Greg KH

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=20051116180655.GC6908@suse.de \
    --to=gregkh@suse.de \
    --cc=abelay@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.osdl.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