mirror-linux/drivers/platform/x86
Mario Limonciello 427c70dec7 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: c3bfcd4c67 ("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>
2024-02-20 14:35:36 +01:00
..
amd platform/x86/amd/pmf: Fix a potential race with policy binary sideload 2024-02-19 13:39:44 +01:00
dell Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
hp platform/x86: hp-bioscfg: Removed needless asm-generic 2023-12-28 10:06:44 +01:00
intel platform/x86: intel-vbtn: Stop calling "VBDL" from notify_handler 2024-02-20 14:35:35 +01:00
siemens platform/x86/siemens: simatic-ipc-batt-f7188x: Convert to platform remove callback returning void 2023-09-28 13:27:06 +03:00
x86-android-tablets platform/x86: x86-android-tablets: Fix acer_b1_750_goodix_gpios name 2024-02-20 14:35:35 +01:00
Kconfig platform-drivers-x86 for v6.7-3 2023-12-11 11:22:02 +01:00
Makefile platform/x86: Add Silicom Platform Driver 2023-12-04 13:44:05 +01:00
acer-wireless.c
acer-wmi.c platform/x86: acer-wmi: add fan speed monitoring for Predator PHN16-71 2023-12-02 12:27:25 +01:00
acerhdf.c
adv_swbutton.c
amilo-rfkill.c
apple-gmux.c apple-gmux: Hard Code max brightness for MMIO gmux 2023-10-18 15:33:24 +02:00
asus-laptop.c platform/x86: asus-laptop: remove redundant braces in if statements 2023-12-02 12:27:25 +01:00
asus-nb-wmi.c platform/x86: asus-wmi: Filter Volume key presses if also reported via atkbd 2023-11-23 14:24:19 +02:00
asus-tf103c-dock.c
asus-wireless.c platform/x86: asus-wireless: Replace open coded acpi_match_acpi_device() 2023-10-12 16:34:09 +03:00
asus-wmi.c platform-drivers-x86 for v6.7-3 2023-12-11 11:22:02 +01:00
asus-wmi.h platform/x86: asus-wmi: Change q500a_i8042_filter() into a generic i8042-filter 2023-11-23 14:24:17 +02:00
barco-p50-gpio.c
classmate-laptop.c
compal-laptop.c
dual_accel_detect.h
eeepc-laptop.c Fix nomenclature for USB and PCI wireless devices 2023-08-25 12:56:49 +03:00
eeepc-wmi.c
firmware_attributes_class.c
firmware_attributes_class.h
fujitsu-laptop.c
fujitsu-tablet.c
gigabyte-wmi.c
gpd-pocket-fan.c
hdaps.c
huawei-wmi.c
ibm_rtl.c
ideapad-laptop.c platform/x86: ideapad-laptop: Set max_brightness before using it 2023-11-15 14:30:51 +02:00
ideapad-laptop.h
inspur_platform_profile.c platform/x86: inspur-platform-profile: Add platform profile support 2023-10-27 16:14:47 +03:00
intel_ips.c platform-drivers-x86 for v6.7-6 2024-01-02 13:13:01 +01:00
intel_ips.h
intel_scu_ipc.c platform/x86: intel_scu_ipc: Fail IPC send if still busy 2023-09-18 15:15:15 +02:00
intel_scu_ipcutil.c
intel_scu_pcidrv.c
intel_scu_pltdrv.c
intel_scu_wdt.c
lenovo-ymc.c platform/x86: lenovo-ymc: Add Lenovo Yoga 7 14ACN6 to ec_trigger_quirk_dmi_table 2023-08-21 13:08:32 +02:00
lenovo-yogabook.c pwm: Rename pwm_apply_state() to pwm_apply_might_sleep() 2023-12-20 16:07:04 +01:00
lg-laptop.c
meraki-mx100.c
mlx-platform.c Merge branch 'pdx86/platform-drivers-x86-mellanox-init' into review-ilpo 2023-10-06 17:51:21 +03:00
msi-ec.c platform-drivers-x86 for v6.7-1 2023-10-31 17:53:00 -10:00
msi-ec.h platform/x86: msi-ec: rename fn_super_swap 2023-10-09 14:30:11 +03:00
msi-laptop.c
msi-wmi.c
mxm-wmi.c
nvidia-wmi-ec-backlight.c
p2sb.c platform/x86: p2sb: Use pci_resource_n() in p2sb_read_bar0() 2024-01-22 11:37:27 +01:00
panasonic-laptop.c
pcengines-apuv2.c
pmc_atom.c
samsung-laptop.c
samsung-q10.c
sel3350-platform.c platform/x86: sel3350-platform: Convert to platform remove callback returning void 2023-09-28 13:26:58 +03:00
serdev_helpers.h platform/x86: Add new get_serdev_controller() helper 2024-02-20 14:35:35 +01:00
serial-multi-instantiate.c ACPI: scan: Create platform device for CS35L56 2023-07-31 16:03:39 +02:00
silicom-platform.c platform/x86: silicom-platform: Fix spelling mistake "platfomr" -> "platform" 2023-12-18 14:58:50 +01:00
sony-laptop.c x86: convert to new timestamp accessors 2023-10-18 13:26:16 +02:00
system76_acpi.c
think-lmi.c platform/x86: think-lmi: Fix password opcode ordering for workstations 2024-02-19 12:40:47 +01:00
think-lmi.h platform/x86: think-lmi: Add bulk save feature 2023-09-21 18:29:29 +02:00
thinkpad_acpi.c platform/x86: thinkpad_acpi: Only update profile if successfully converted 2024-02-20 14:35:36 +01:00
topstar-laptop.c
toshiba-wmi.c
toshiba_acpi.c
toshiba_bluetooth.c
toshiba_haps.c
touchscreen_dmi.c platform/x86: touchscreen_dmi: Consolidate Goodix upside-down touchscreen data 2024-02-19 12:42:58 +01:00
uv_sysfs.c
winmate-fm07-keys.c
wireless-hotkey.c
wmi-bmof.c platform/x86: wmi-bmof: Simplify read_bmof() 2023-07-31 16:07:41 +02:00
wmi.c platform/x86: wmi: Fix wmi_dev_probe() 2024-01-22 11:37:27 +01:00
xiaomi-wmi.c
xo1-rfkill.c
xo15-ebook.c platform/x86: xo15-ebook: Replace open coded acpi_match_acpi_device() 2023-10-12 16:33:49 +03:00