Messages in this thread | | | From | David Brownell <> | Subject | Re: [linux-pm] [PATCH v2] Add suspend/resume for HPET | Date | Sat, 31 Mar 2007 10:55:42 -0700 |
| |
On Saturday 31 March 2007 9:53 am, Linus Torvalds wrote: > > On Sat, 31 Mar 2007, Thomas Gleixner wrote: > > > > Right, but clock - sources/events need to be extremly late suspended and > > early resumed. How can we ensure this ? > > Make them be at the top of the device tree by adding them early. That's > the whole point of the device tree after all - we have an ordering that is > enforced by its topology, and that we sort by when things were added.
Right, but "when things get added" doesn't correlate well to "when they should get suspended/resumed". It's also in basic conflict with runtime PM models, where devices may be suspended at essentially any time. And sysdevs are even stranger.
One way out: rather than constructing that list as devices get enumerated, it could be constructed by a (linear-time, non-recursive) walk of the device tree(s) before they get suspended.
(Or equivalently: construct lists at enumeration time, but just adding them *right after their parent* rather than at the end of the list.)
Would that solve the problem here? Potentially ... if the tree is structured to meet Thomas' rules:
> > The required resume order is: > > > > clocksources > > timekeeping > > clockevents > > tick management
> So the only thing that needs to be done is to make sure that we add the > timer devices early during bootup - something we have to do *anyway*. If a > device is added early in bootup, that automatically means that it will be > suspended late, and resumed early - because we maintain that order all the > way through..
> -- "clocksource" -- +-- HPET > | > +-- TSC > | > +-- i8259 > | > +-- lapic timer > | > .. whatever else
If each of those were a device node, with "clocksource" suspend/resume methods handling Thomas' "timekeeping" item, and simlarly for "clockevent" devices ... I could see that all working neatly.
- Dave
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |