Skip to content

Commit 81a5603

Browse files
arawaaajwrdegoede
authored andcommitted
platform/x86: ideapad-laptop: Fix interrupt storm on fn-lock toggle on some Yoga laptops
Commit 3ae86d2 ("platform/x86: ideapad-laptop: Fix Legion 5 Fn lock LED") uses the WMI event-id for the fn-lock event on some Legion 5 laptops to manually toggle the fn-lock LED because the EC does not do it itself. However, the same WMI ID is also sent on some Yoga laptops. Here, setting the fn-lock state is not valid behavior, and causes the EC to spam interrupts until the laptop is rebooted. Add a set_fn_lock_led_list[] DMI-id list and only enable the workaround to manually set the LED on models on this list. Link: https://bugzilla.kernel.org/show_bug.cgi?id=212671 Cc: Meng Dong <[email protected]> Signed-off-by: Arnav Rawat <[email protected]> Link: https://lore.kernel.org/r/12093851.O9o76ZdvQC@fedora [[email protected]: Check DMI-id list only once and store the result] Signed-off-by: Hans de Goede <[email protected]>
1 parent 8b9b6a0 commit 81a5603

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/platform/x86/ideapad-laptop.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ struct ideapad_private {
136136
bool dytc : 1;
137137
bool fan_mode : 1;
138138
bool fn_lock : 1;
139+
bool set_fn_lock_led : 1;
139140
bool hw_rfkill_switch : 1;
140141
bool kbd_bl : 1;
141142
bool touchpad_ctrl_via_ec : 1;
@@ -1501,6 +1502,9 @@ static void ideapad_wmi_notify(u32 value, void *context)
15011502
ideapad_input_report(priv, value);
15021503
break;
15031504
case 208:
1505+
if (!priv->features.set_fn_lock_led)
1506+
break;
1507+
15041508
if (!eval_hals(priv->adev->handle, &result)) {
15051509
bool state = test_bit(HALS_FNLOCK_STATE_BIT, &result);
15061510

@@ -1514,6 +1518,18 @@ static void ideapad_wmi_notify(u32 value, void *context)
15141518
}
15151519
#endif
15161520

1521+
/* On some models we need to call exec_sals(SALS_FNLOCK_ON/OFF) to set the LED */
1522+
static const struct dmi_system_id set_fn_lock_led_list[] = {
1523+
{
1524+
/* https://bugzilla.kernel.org/show_bug.cgi?id=212671 */
1525+
.matches = {
1526+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1527+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion R7000P2020H"),
1528+
}
1529+
},
1530+
{}
1531+
};
1532+
15171533
/*
15181534
* Some ideapads have a hardware rfkill switch, but most do not have one.
15191535
* Reading VPCCMD_R_RF always results in 0 on models without a hardware rfkill,
@@ -1556,6 +1572,7 @@ static void ideapad_check_features(struct ideapad_private *priv)
15561572
acpi_handle handle = priv->adev->handle;
15571573
unsigned long val;
15581574

1575+
priv->features.set_fn_lock_led = dmi_check_system(set_fn_lock_led_list);
15591576
priv->features.hw_rfkill_switch = dmi_check_system(hw_rfkill_list);
15601577

15611578
/* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */

0 commit comments

Comments
 (0)