lkml.org 
[lkml]   [2008]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ACPI/CPUIDLE: prevent setting pm_idle to NULL
On Mon, 28 Jul 2008, Andi Kleen wrote:

> > The problem here is that the acpi/cpuidle code can be in a state where
> > the _save/old variables _ARE_ NULL because they had not been
> > initialized with the original pm_idle before the module is removed or
> > the cst state changes. So all we have to do is to prevent pm_idle to
> > be set to NULL.
>
> It still seems wrong to me to fall back to the cpuidle idle function
> instead of the earlier idle function just because cpuidle was loaded
> in a weird way.

WTF are you talking about ?

pm_idle_save is initialized with pm_idle (the original idle function
selected by the arch code).

When CST changes or the acpi/cpuidle modules are removed we need to
restore the original pm_idle function from pm_idle_save.

When pm_idle_save was not initialized, which can happen, then we wrote
NULL to pm_idle, which is obviously wrong. We simply want to avoid
that we write NULL into pm_idle.

That's all what the patch does. Nothing else.

This problem was hidden by the magic

if (!pm_idle)
pm_idle = default_idle;

in the arch/x86 code which was removed when I refactored the pm_idle
initialization code.

Just get it. That "if (!pm_idle)" check in the arch code was just
papering over the fact that the acpi code set pm_idle to NULL under
certain conditions.

Thanks,

tglx


\
 
 \ /
  Last update: 2008-07-29 00:01    [W:0.091 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site