]> Git Repo - linux.git/commit
thermal: core: Do not fail cdev registration because of invalid initial state
authorRafael J. Wysocki <[email protected]>
Thu, 6 Jun 2024 18:27:19 +0000 (20:27 +0200)
committerRafael J. Wysocki <[email protected]>
Fri, 7 Jun 2024 11:51:51 +0000 (13:51 +0200)
commit1af89dedc8a58006d8e385b1e0d2cd24df8a3b69
tree32eac8dba3855ebf997361e603ee77b0a41869ca
parentae2170d6ea96e652c7fb5689f1980986bf48b7b8
thermal: core: Do not fail cdev registration because of invalid initial state

It is reported that commit 31a0fa0019b0 ("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 31a0fa0019b0.

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: 31a0fa0019b0 ("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]>
drivers/thermal/thermal_core.c
This page took 0.055844 seconds and 4 git commands to generate.