Subject: Re: tg3: PCI error recovery

From: [email-masked] (Linas Vepstas)
Date: Thu, 27 Sep 2007 12:56:59 -0500

During a private conversation about how to save and restore 
device state after a pci error is detected, and the device is reset,
the following came up:

On Wed, Sep 26, 2007 at 04:48:38PM -0700, Michael Chan wrote:
> > 
> > > 1b) If so, is it safe to call pci_save_state() in
> > > tg3_io_error_detected(), or are we to assume they've been corrupted?
> > 
> > My conservative approach is to assume that anything and everything has
> > been corrupted. (e.g. temporary undervoltage on the bus might scramble
> > multiple registers)
> 
> In that case, we should call pci_restore_msi_state() to restore the MSI
> state, but this call is only defined if CONFIG_PM is defined.

There seem to be two choices:
1) enable CONFIG_PM in those arches that care about recovering from PCI
   errors. (Yuck)

2) remove the ifdef CONFIG_PM from around pci_restore_msi_state() in 
   rivers/pci/msi.c

I'd go for choice 2, but I thought I'd ask first ...

--linas