Commit e40cc4bd authored by Jan Beulich's avatar Jan Beulich Committed by Guenter Roeck

x86/hwmon: register alternate sibling upon CPU removal

Just like pkgtemp registers another core of the same package when one
gets removed, coretemp should register another hyperthread (if
available) in that situation.

As pointed out in the patch fixing the respective code in pkgtemp, the
list protectng mutex must be dropped before calling
coretemp_device_add(), and due to the restructured loop (including an
explicit return) the "safe" variant of the list iterator isn't needed
anymore.
Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
parent f6aeccdb
...@@ -491,14 +491,22 @@ static int __cpuinit coretemp_device_add(unsigned int cpu) ...@@ -491,14 +491,22 @@ static int __cpuinit coretemp_device_add(unsigned int cpu)
static void coretemp_device_remove(unsigned int cpu) static void coretemp_device_remove(unsigned int cpu)
{ {
struct pdev_entry *p, *n; struct pdev_entry *p;
unsigned int i;
mutex_lock(&pdev_list_mutex); mutex_lock(&pdev_list_mutex);
list_for_each_entry_safe(p, n, &pdev_list, list) { list_for_each_entry(p, &pdev_list, list) {
if (p->cpu == cpu) { if (p->cpu != cpu)
platform_device_unregister(p->pdev); continue;
list_del(&p->list);
kfree(p); platform_device_unregister(p->pdev);
} list_del(&p->list);
mutex_unlock(&pdev_list_mutex);
kfree(p);
for_each_cpu(i, cpu_sibling_mask(cpu))
if (i != cpu && !coretemp_device_add(i))
break;
return;
} }
mutex_unlock(&pdev_list_mutex); mutex_unlock(&pdev_list_mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment