mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: linas@austin.ibm.com (Linas Vepstas)
To: Paul Mackerras <paulus@samba.org>, Adam Belay <ambx1@neo.rr.com>
Cc: Andrew Morton <akpm@osdl.org>, Ryan Lortie <desrt@desrt.ca>,
	linux-kernel@vger.kernel.org, mjg59@srcf.ucam.org,
	bcollins@ubuntu.com, Greg KH <greg@kroah.com>
Subject: Re: [ambx1@neo.rr.com: Re: pci_restore_state]
Date: Mon, 12 Jun 2006 14:54:04 -0500	[thread overview]
Message-ID: <20060612195404.GC7583@austin.ibm.com> (raw)
In-Reply-To: <17545.21437.203619.798273@cargo.ozlabs.ibm.com>

On Fri, Jun 09, 2006 at 08:55:57PM +1000, Paul Mackerras wrote:
> Any comments on Adam's patch, particularly as it relates to EEH?  Do
> we use dev->saved_config_space to restore the device after an EEH
> reset?

Thanks, I was out sick.

On PowerPC, we don't use this struct; we save to a private area 
hanging off the device nocde. The goal for PCI error recovery was to 
save PCI state as it was shortly after boot, before the device driver
has mucked with it. That way, when the device driver starts up, 
it finds the state to be more-or-less the same as it would be on 
discovery after a cold boot.

> Any comments on this patch as an alternative solution?
> 
> http://marc.theaimsgroup.com/?l=linux-kernel&m=114949711413176&w=2

One question/remark. The patch says:

+	command = conf->command & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
+				    PCI_COMMAND_MASTER);
+
+	pci_write_config_word(dev, PCI_COMMAND, command);
+	pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, conf->cacheline_size);
+	pci_write_config_byte(dev, PCI_LATENCY_TIMER, conf->latency_timer);
+	pci_write_config_byte(dev, PCI_INTERRUPT_PIN, conf->interrupt_pin);
+	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, conf->interrupt_line);
+
+	pci_restore_bars(dev);
 
-	for (i = 0; i < 16; i++)
-		pci_write_config_dword(dev,i * 4, dev->saved_config_space[i]);
 	pci_restore_msi_state(dev);
 	pci_restore_msix_state(dev);


First thing it does is disable bus mastering (which is probably good, 
you don't want the device going wild doing dma's till you're ready).
However, at some point, bus mastering needs to be re-enabled; does
some other power management code do this? Is the device driver 
supposed to notice something is amiss after a PM resume, and supposed
to set these?

--linas

           reply	other threads:[~2006-06-12 19:54 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <17545.21437.203619.798273@cargo.ozlabs.ibm.com>]

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=20060612195404.GC7583@austin.ibm.com \
    --to=linas@austin.ibm.com \
    --cc=akpm@osdl.org \
    --cc=ambx1@neo.rr.com \
    --cc=bcollins@ubuntu.com \
    --cc=desrt@desrt.ca \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=paulus@samba.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

all inboxes | Powered by JetHome®