Commit 1af89de
committed
thermal: core: Do not fail cdev registration because of invalid initial state
It is reported that commit 31a0fa0 ("thermal/debugfs: Pass cooling
device state to thermal_debug_cdev_add()") causes the ACPI fan driver
to fail probing on some systems which turns out to be due to the _FST
control method returning an invalid value until _FSL is first evaluated
for the given fan. If this happens, the .get_cur_state() cooling device
callback returns an error and __thermal_cooling_device_register() fails
as uses that callback after commit 31a0fa0.
Arguably, _FST should not return an invalid value even if it is
evaluated before _FSL, so this may be regarded as a platform firmware
issue, but at the same time it is not a good enough reason for failing
the cooling device registration where the initial cooling device state
is only needed to initialize a thermal debug facility.
Accordingly, modify __thermal_cooling_device_register() to avoid
calling thermal_debug_cdev_add() instead of returning an error if the
initial .get_cur_state() callback invocation fails.
Fixes: 31a0fa0 ("thermal/debugfs: Pass cooling device state to thermal_debug_cdev_add()")
Closes: https://lore.kernel.org/linux-acpi/[email protected]
Reported-by: Laura Nao <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Acked-by: Daniel Lezcano <[email protected]>
Tested-by: Laura Nao <[email protected]>1 parent ae2170d commit 1af89de
1 file changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
999 | 999 | | |
1000 | 1000 | | |
1001 | 1001 | | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
1002 | 1010 | | |
1003 | 1011 | | |
1004 | | - | |
| 1012 | + | |
1005 | 1013 | | |
1006 | 1014 | | |
1007 | 1015 | | |
| |||
1016 | 1024 | | |
1017 | 1025 | | |
1018 | 1026 | | |
1019 | | - | |
| 1027 | + | |
| 1028 | + | |
1020 | 1029 | | |
1021 | 1030 | | |
1022 | 1031 | | |
| |||
0 commit comments