Re: PCI PM: Restore standard config registers of all devices early

Benjamin Herrenschmidt
2009-02-03T00:58:55Z

> (background: pci_restore_standard_config() will have done
> pci_raw_set_power_state(PCI_D0) with the device clocks off, which wouldn't
> actualyl have _done_ anythign to the device, but then it does

Actually, we are lucky we don't even crash with a machine check when
hitting an unclocked device ...

I found a problem with radeonfb (patch sent separately) that explains
the breakage on one of my recent machines, but I wouldn't be surprised
if some other models of powerbooks/ibooks have also problem with USB
as you mentioned. IE. I have to check whether the ones doing PCI D state
can also use the Apple specific clock stuff. We might be lucky and they
are exclusive from each other.

Also, the nice thing with turning clocks off on these Apple ASICs is
that it doesn't lose the config space content. So we may just get lucky
here.

> Ben, does this trivial patch make any difference for those powermacs?

On my test setup, the problem is radeonfb and I just made a patch to fix
it. But it's using some standard PCI USB, not the older fancy Apple
stuff. I'll check on an older machine tongight when I get back home, I
don't have one here.

Cheers,
Ben.

> Linus
> ---
> drivers/pci/pci.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 17bd932..97e1c38 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1419,7 +1419,7 @@ int pci_restore_standard_config(struct pci_dev *dev)
> }
> }
>
> - dev->current_state = PCI_D0;
> + pci_update_current_state(dev, PCI_D0);
>
> return 0;
> }