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

Benjamin Herrenschmidt
2009-02-02T20:30:34Z

> I think you'll need to move the clock gating thing to be a sysdev
> suspend/resume event, which gets done really early along with things like
> core timekeeping etc. We kind of hit that already with the USB driver,
> where CONFIG_PPC does all kinds of wrong things:

But I want the gating to be tied to the device. IE. If the device is
ever suspended on its own, or the driver removed, I want the clocks
off. Ideally, I want USB autosuspend to be able to clock gate or that
sort of thing ..

I'd rather hook it up inside pci_set_power_state()...

> inside the hcd-pci.c driver. If that whole thing was a sysdev feature, you
> wouldn't need that kind of insane "do my own arch-specific thing in a
> generic driver" thing. AND waking it up would work too.
>
> I'm assuming this is exactly the kind of thing that is now biting you?

I don't know yet what is biting us, though I suppose so. I only saw
Andreas report before going to bed yesterday ;-)

I wouldn't need a sysdev if I was going to put the gating under arch
control, I could just do that from various arch code I already have
there doing bits and pieces. But I like it being tied to the driver, it
makes more sense in many ways to have a driver control the clocks of its
device. Maybe the best approach is to stick a hook into
pci_set_power_state() ... This should really be the very first thing to
happen, even before whacking back the BARs.

Cheers,
Ben.