Commit 427c70d
platform/x86: thinkpad_acpi: Only update profile if successfully converted
Randomly a Lenovo Z13 will trigger a kernel warning traceback from this
condition:
```
if (WARN_ON((profile < 0) || (profile >= ARRAY_SIZE(profile_names))))
```
This happens because thinkpad-acpi always assumes that
convert_dytc_to_profile() successfully updated the profile. On the
contrary a condition can occur that when dytc_profile_refresh() is called
the profile doesn't get updated as there is a -EOPNOTSUPP branch.
Catch this situation and avoid updating the profile. Also log this into
dynamic debugging in case any other modes should be added in the future.
Fixes: c3bfcd4 ("platform/x86: thinkpad_acpi: Add platform profile support")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20240217022311.113879-1-mario.limonciello@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>1 parent 84c16d0 commit 427c70d
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10308 | 10308 | | |
10309 | 10309 | | |
10310 | 10310 | | |
| 10311 | + | |
10311 | 10312 | | |
10312 | 10313 | | |
10313 | 10314 | | |
| |||
10493 | 10494 | | |
10494 | 10495 | | |
10495 | 10496 | | |
10496 | | - | |
10497 | | - | |
| 10497 | + | |
| 10498 | + | |
10498 | 10499 | | |
10499 | 10500 | | |
10500 | 10501 | | |
| |||
0 commit comments