[lkml]   [2011]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[03/91] [CPUFREQ] CPU hotplug, re-create sysfs directory and symlinks
    2.6.32-longterm review patch.  If anyone has any objections, please let us know.


    From: Jacob Shin <>

    commit 27ecddc2a9f99ce4ac9a59a0acd77f7100b6d034 upstream.

    When we discover CPUs that are affected by each other's
    frequency/voltage transitions, the first CPU gets a sysfs directory
    created, and rest of the siblings get symlinks. Currently, when we
    hotplug off only the first CPU, all of the symlinks and the sysfs
    directory gets removed. Even though rest of the siblings are still
    online and functional, they are orphaned, and no longer governed by

    This patch, given the above scenario, creates a sysfs directory for
    the first sibling and symlinks for the rest of the siblings.

    Please note the recursive call, it was rather too ugly to roll it
    out. And the removal of redundant NULL setting (it is already taken
    care of near the top of the function).

    Signed-off-by: Jacob Shin <>
    Acked-by: Mark Langsdorf <>
    Reviewed-by: Thomas Renninger <>
    Signed-off-by: Dave Jones <>
    Signed-off-by: Greg Kroah-Hartman <>

    drivers/cpufreq/cpufreq.c | 20 ++++++++++++++++++--
    1 file changed, 18 insertions(+), 2 deletions(-)

    --- a/drivers/cpufreq/cpufreq.c
    +++ b/drivers/cpufreq/cpufreq.c
    @@ -1183,12 +1183,28 @@ static int __cpufreq_remove_dev(struct s


    + cpufreq_debug_enable_ratelimit();
    + /* when the CPU which is the parent of the kobj is hotplugged
    + * offline, check for siblings, and create cpufreq sysfs interface
    + * and symlinks
    + */
    + if (unlikely(cpumask_weight(data->cpus) > 1)) {
    + /* first sibling now owns the new sysfs dir */
    + cpumask_clear_cpu(cpu, data->cpus);
    + cpufreq_add_dev(get_cpu_sysdev(cpumask_first(data->cpus)));
    + /* finally remove our own symlink */
    + lock_policy_rwsem_write(cpu);
    + __cpufreq_remove_dev(sys_dev);
    + }
    - per_cpu(cpufreq_cpu_data, cpu) = NULL;

    - cpufreq_debug_enable_ratelimit();
    return 0;

     \ /
      Last update: 2011-06-16 09:33    [W:0.021 / U:9.712 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site