PATCH: apm.c - detection of brokern APM Idle call implementation

From: Borsenkow Andrej (Andrej.Borsenkow@mow.siemens.ru)
Date: Tue Dec 18 2001 - 12:54:47 EST


On ðÎÄ, 2001-12-17 at 06:34, Dave Jones wrote:
> On 16 Dec 2001, Borsenkow Andrej wrote:
>
> > I thought once about run-time detection - if BIOS reports that Idle does
> > not slow down CPU try Idle call once and compare jiffies (probably
> > repeat several times to be sure). Is it sensible?
>
> A far simpler way would be to add DMI blacklist entries for the BIOSes
> that don't do this, although this assumes the problem machine has a DMI
> compliant BIOS.
>

Well, the following three-liners (+ comments) seems to do it. It checks
if clock was advanced after return from APM Idle - if not we assume BIOS
did not halt CPU and do it ourselves. The addidional condition &&
!current->need_resched is for the case when BIOS did halt CPU and
non-clock interrupt happened that waked up somebody else. But may be I
am just plain paranoid. The code has no impact for "BIOS slows CPU"
case.

It works here for broken BIOS. I appreciate if people with good BIOS
test it.

-andrej



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



This archive was generated by hypermail 2b29 : Sun Dec 23 2001 - 21:00:16 EST