Re: [PATCH 1/4] hwmon: (coretemp) adding package thermal info support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 18 Jul 2010, Guenter Roeck wrote:
> All correct. I have a second concern after looking through the IA-32 
> documentation. 
> 
> The package sensor is not supported for all chips, and there is only 
> one sensor per package (not per core). Yet, the code as written adds the 
> new sensor unconditionally. I think this needs to change to only create
> the sysfs file if the sensor is supported by the CPU, and only once per core.

It is a really good idea to never expose through sysfs something that
isn't there.  Alternatively, you can return errors like ENXIO, but you
should only do that when you have no other choice (because, e.g. you
cannot know beforehand whether a sensor will be available or not).

If one can detect when processor packages and cores come and go, and one
can ask the package and cores about the sensors that are really
available, one can expose to sysfs just the sensors that are
operational, and remove or add sensors when needed.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux