CPU hotplug, re-create sysfs directory and symlinks
authorJacob Shin <jacob.shin@amd.com>
Wed, 27 Apr 2011 18:32:11 +0000 (13:32 -0500)
committerSteve Conklin <sconklin@canonical.com>
Fri, 15 Jul 2011 17:20:46 +0000 (12:20 -0500)
commitfbc00a676a98d7757f1c1a2a707080fbe8005e9b
tree86eca7a12433f92371106747c8bdb2114f7a1699
parent8cbae273ca44e4302714d0de111926a5b4a43636
CPU hotplug, re-create sysfs directory and symlinks

BugLink: http://bugs.launchpad.net/bugs/793702

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
cpufreq.

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 <jacob.shin@amd.com>
Acked-by: Mark Langsdorf <mark.langsdorf@amd.com>
Reviewed-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/cpufreq/cpufreq.c