Subject: Re: device tree traversal
To: Jachym Holecek <freza@dspfpga.com>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: tech-kern
Date: 07/03/2006 14:20:36
freza@dspfpga.com said:
> This will be needed for proper powerhooks
In the PCI case, I don't think traversing the (logical)
device list is the right thing to to. What we need is
to traverse the physical list. And this can only be done
by the bus drivers theirselfes.
Some reasons:
-On a shared bus, all devices need to support a certain
low-power state before the bus can be stopped, powered
down or so. _All_ devices, not just these we have drivers
attached for. The bus driver might also find out a
common denominator at the beginning and handle individual
devices later.
-In PCI PM, most things can be done centrally. All the
wakeup stuff and config register saving which is now
in powerhooks shouldn't be there. So a call to the PCI
device driver should be only done if the driver requests
this. (There is a bit in the PCI PM capability which tells
whether special driver assistance is needed. If this is
set and the driver didn't register a hook, this would be
an error.
-The namespace for PCI device power states is different
from the PCI bus one, and that of ACPI. For sanity, I
wouldn't try to hide this behind global names. The bus driver
can well translate bus power states into device power
states. (And as said, this is not just translation but
rather negotiation.)
best regards
Matthias