Re: [linux-pm] [PATCH v2] Add suspend/resume for HPET

From: Alan Stern
Date: Mon Apr 02 2007 - 16:05:05 EST


On Mon, 2 Apr 2007, David Brownell wrote:

> What the driver model does now is problematic. Even if the clockevent
> stuff gets different fixes, those driver model issues still exist: the
> existence of dependencies that are not part of the device tree.

> No, it's a "just happened to work" because the only ordering promise
> that was explicitly made is that the parent/child relationships will
> be obeyed. Any additional ordering dependency is out-of-scope of the
> current driver model -- and that's a proble that eventually needs to
> be fixed.
>
> This is the kind of thing that the pm_parent relationship was (AFAICT)
> originally supposed to handle. Of course, it doesn't/can't, given the
> current implementation ... that relationship is never used.

Just so. In fact, there almost certainly are other dependencies that
nobody is aware of, simply because they have never had a chance to bite.

Such things can be rather difficult to pin down when they occur. I would
be happy enough to leave matters as they are, with a strict LIFO approach.
If someone ever tries to parallelize suspend/resume in multiple threads,
they will have their work cut out for them -- even probing ran into
trouble when attempts were made to parallelize it, and it's a lot simpler.


> It's not that simple though, especially with HPET. The BIOS may expect
> the PIT to work, but Linux currently (and problematically!) uses HPET in
> "legacy replacement mode". And ISTR the problems are coming up when the
> system is already in a low-functionality state: IRQs off everywhere,
> even timer ticks have stopped.

I know nothing about the workings of the HPET and other clock code. My
point was this: Suspend passes through various intermediate stages in
which some devices are available and others aren't. So long as those
stages are exact duplicates (in reverse order) of the stages that occurred
during startup, it should be possible to make them all work.

Alan Stern

-
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/