On 11/29/2014 08:30 AM, Pali Rohár wrote:
On Saturday 29 November 2014 17:24:08 Guenter Roeck wrote:
On 11/29/2014 08:04 AM, Pali Rohár wrote:
+static bool __init i8k_check_temp(int sensor)
+{
+       int err;
+
+       /*
+        * Check if temperature sensor type is valid.
+        *
+        * If it is valid then sensor should work. But some
sensors are not +        * available at any time. E.g GPU sensor
on Optimus/PowerExpress/Enduro +         * card does not work (or
return bogus value) when card is turned off. +   * So this
function should not fail in this case. +         */
+       err = i8k_get_temp_type(sensor);
+       if (err >= 0)
+               return true;
+

Are you sure this function is provided for all systems ?
I am a bit concerned that we may wrongly disable sensors this
way, especially on older systems.


I do not know if that function is provided on all systems. But
this code does not disable sensors. If function fail, then we
fallback to temperature read down. Return true means that we
enable sensor.


You are right. Guess I didn't have enough coffee this morning.

Thanks,
Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to