]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (dell-smm) Cache fan_type() calls and change fan detection
authorPali Rohár <pali.rohar@gmail.com>
Fri, 17 Jun 2016 22:54:47 +0000 (00:54 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 23 Jun 2016 13:24:23 +0000 (06:24 -0700)
commit5c6ba9eff9576a37c1c51cd71fbaf277fcc6558f
tree530ecea5c7afff14877edd8641ccecaf82d1b28a
parent91037fe587a5980d1e7120f502f25678f2facb0e
hwmon: (dell-smm) Cache fan_type() calls and change fan detection

On more Dell machines (e.g. Dell Precision M3800) fan_type() call is too
expensive (CPU is too long in SMM mode) and cause kernel to hang. This is
bug in Dell SMM or BIOS.

This patch caches type for each fan (as it should not change) and changes
the way how fan presense is detected. First it try function fan_status()
as was before commit 6b414201b553 ("i8k: Add support for fan labels"). And
if that fails fallback to fan_type(). *_status() functions can fail in case
fan is not currently accessible (e.g. present on GPU which is currently
turned off).

Reported-by: Tolga Cakir <cevelnet@gmail.com>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=112021
Cc: stable@vger.kernel.org # v4.0+, will need backport
Tested-by: Tolga Cakir <cevelnet@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/dell-smm-hwmon.c