aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/coretemp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/coretemp.c')
-rw-r--r--drivers/hwmon/coretemp.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index a00245eb3fa0..9577c432e77f 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -506,7 +506,13 @@ static int create_core_data(struct platform_data *pdata,
506 if (attr_no > MAX_CORE_DATA - 1) 506 if (attr_no > MAX_CORE_DATA - 1)
507 return -ERANGE; 507 return -ERANGE;
508 508
509 /* Skip if it is a HT core, Not an error */ 509 /*
510 * Provide a single set of attributes for all HT siblings of a core
511 * to avoid duplicate sensors (the processor ID and core ID of all
512 * HT siblings of a core is the same).
513 * Skip if a HT sibling of this core is already online.
514 * This is not an error.
515 */
510 if (pdata->core_data[attr_no] != NULL) 516 if (pdata->core_data[attr_no] != NULL)
511 return 0; 517 return 0;
512 518
@@ -763,10 +769,20 @@ static void __cpuinit put_core_offline(unsigned int cpu)
763 if (pdata->core_data[indx] && pdata->core_data[indx]->cpu == cpu) 769 if (pdata->core_data[indx] && pdata->core_data[indx]->cpu == cpu)
764 coretemp_remove_core(pdata, &pdev->dev, indx); 770 coretemp_remove_core(pdata, &pdev->dev, indx);
765 771
766 /* Online the HT version of this core, if any */ 772 /*
773 * If a core is taken offline, but a HT sibling of the same core is
774 * still online, register the alternate sibling. This ensures that
775 * exactly one set of attributes is provided as long as at least one
776 * HT sibling of a core is online.
777 */
767 for_each_sibling(i, cpu) { 778 for_each_sibling(i, cpu) {
768 if (i != cpu) { 779 if (i != cpu) {
769 get_core_online(i); 780 get_core_online(i);
781 /*
782 * Display temperature sensor data for one HT sibling
783 * per core only, so abort the loop after one such
784 * sibling has been found.
785 */
770 break; 786 break;
771 } 787 }
772 } 788 }