• Johannes Weiner's avatar
    cpufreq: Initialise default governor before use · 6915719b
    Johannes Weiner authored
    When the cpufreq driver starts up at boot time, it calls into the default
    governor which might not be initialised yet.  This hurts when the
    governor's worker function relies on memory that is not yet set up by its
    init function.
    
    This migrates all governors from module_init() to fs_initcall() when being
    the default, as was already done in cpufreq_performance when it was the
    only possible choice.  The performance governor is always initialized early
    because it might be used as fallback even when not being the default.
    
    Fixes at least one actual oops where ondemand is the default governor and
    cpufreq_governor_dbs() uses the uninitialised kondemand_wq work-queue
    during boot-time.
    Signed-off-by: default avatarJohannes Weiner <hannes@saeurebad.de>
    Cc: Dave Jones <davej@codemonkey.org.uk>
    Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
    Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
    Acked-by: default avatarIngo Molnar <mingo@elte.hu>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    6915719b
cpufreq_conservative.c 15.9 KB