Re: PCI PM & compatibility

From: Russell King
Date: Sat Aug 23 2003 - 13:15:51 EST


On Sat, Aug 23, 2003 at 07:28:25PM +0200, Benjamin Herrenschmidt wrote:
> On Sat, 2003-08-23 at 19:08, Russell King wrote:
> > On Sat, Aug 23, 2003 at 04:39:57PM +0200, Benjamin Herrenschmidt wrote:
> > > What about this patch to stay compatible with existing drivers
> > > implementing everything in save_state ?
> >
> > And why are we now suspending device parents before their siblings???
>
> I didn't notice that on the laptop here (because it's actually harmless
> on this specific machine), but if this is the case, then we are badly
> wrong indeed...

I think the problem is fairly fundamental to the way that we add
devices to the power lists.

When a device "A" is registered with the driver model, we call
device_add(). This adds the device to the bus, which calls any
registered driver methods. Once the device has been added to the
bus, we add the device to the tail of the device power list.

In the case where a device driver for device "A" registers further
devices, which are siblings of device "A", two things can happen:

- If a driver is already registered for the device, we call its
probe method before we have added device "A" to the power lists.
Therefore, the siblings will be added to the tail of the device
power list _before_ the device "A" has been added.

- If the driver registers after the device, the device "A" will be
added to the power list _before_ the siblings.

So in one case, we have PARENT SIBLING SIBLING SIBLING and in the
other case we have SIBLING SIBLING SIBLING PARENT.

Now, we do have this pm_users thing which seems to imply that it
describes the relationship between two devices. However, its non-
functional. It operates on a per-device variable called "pm_users"
which is only ever _written_ !

So, it looks like the new power model is currently half a solution...

Therefore, we need to do one of two things. Either revert Pat's
changes and return to a power model which for the most part works,
or the new power management model needs a serious work-over.

I stand by my earlier comments that it is too late to be doing this
type of development while we're supposed to be stabilising the kernel.

--
Russell King (rmk@xxxxxxxxxxxxxxxx) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/