Skip to contentSkip to conversation

ACPI: EC: Add quirk for Lenovo Yoga S740-14IIL

PATCH Applied Amir Sabbaghi 2 participants 2 messages Nov 7 – Nov 10

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: EC: Add quirk for Lenovo Yoga S740-14IIL

On the Lenovo Yoga S740-14IIL (81RS, BIOS BYCN29WW), the ECDT advertises GPE 0x6E for the embedded controller, but the EC is actually wired to GPE 0x43, which is what the DSDT EC0 device's _GPE method returns. Since the ECDT and DSDT EC share the same command/data ports (0x66/0x62), acpi_ec_add() keeps the ECDT GPE, so no EC events are ever handled:

ACPI: EC: GPE=0x6e

  /sys/firmware/acpi/interrupts/gpe6E:  0  EN  enabled   unmasked
  /sys/firmware/acpi/interrupts/gpe43:  0  EN STS invalid unmasked

GPE 0x6E never fires, while GPE 0x43 is left enabled with its status bit set and no handler, so each SCI it raises is counted in sci_not (about 7/s, 1.4 million over 55 hours of uptime). As a result, EC query events are lost: the brightness hotkeys and several other Fn hotkeys produce no input events at all, and battery/AC notifications/ laptop lid event are not delivered.

Add the machine to ec_dmi_table so that the DSDT GPE is used.

Tested by overriding the ECDT through the initrd with a copy whose GPE was changed from 0x6E to 0x43, and later by applying this patch and removing the override. With the fix the kernel reports "ACPI: EC: GPE=0x43", gpe43 receives events, sci_not stays at 0, and the brightness and other Fn hotkeys work.

---
 drivers/acpi/ec.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/acpi/ec.c +10 -0
index a89f10256..7c0643d5d 100644
@@ -2007,6 +2007,16 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "HP 250 G7 Notebook PC"),
 		},
 	},
+	{
+		/*
+		 * Lenovo Yoga S740-14IIL
+		 */
+		.callback = ec_honor_dsdt_gpe,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga S740-14IIL"),
+		},
+	},
 	{
 		/*
 		 * Samsung hardware
Signature · 1 line
2.54.0
maintainer Applied
#1 lore raw
Quoted 46 lines · Amir Sabbaghi

On the Lenovo Yoga S740-14IIL (81RS, BIOS BYCN29WW), the ECDT advertises GPE 0x6E for the embedded controller, but the EC is actually wired to GPE 0x43, which is what the DSDT EC0 device's _GPE method returns. Since the ECDT and DSDT EC share the same command/data ports (0x66/0x62), acpi_ec_add() keeps the ECDT GPE, so no EC events are ever handled:

ACPI: EC: GPE=0x6e

  /sys/firmware/acpi/interrupts/gpe6E:  0  EN  enabled   unmasked
  /sys/firmware/acpi/interrupts/gpe43:  0  EN STS invalid unmasked

GPE 0x6E never fires, while GPE 0x43 is left enabled with its status bit set and no handler, so each SCI it raises is counted in sci_not (about 7/s, 1.4 million over 55 hours of uptime). As a result, EC query events are lost: the brightness hotkeys and several other Fn hotkeys produce no input events at all, and battery/AC notifications/ laptop lid event are not delivered.

Add the machine to ec_dmi_table so that the DSDT GPE is used.

Tested by overriding the ECDT through the initrd with a copy whose GPE was changed from 0x6E to 0x43, and later by applying this patch and removing the override. With the fix the kernel reports "ACPI: EC: GPE=0x43", gpe43 receives events, sci_not stays at 0, and the brightness and other Fn hotkeys work.

---
 drivers/acpi/ec.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/acpi/ec.c +4 -0
index a89f10256..7c0643d5d 100644
@@ -2007,6 +2007,16 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "HP 250 G7 Notebook PC"),
                },
        },
+       {
+               /*
+                * Lenovo Yoga S740-14IIL
+                */

drivers/acpi/ec.c static const struct dmi_system_id ec_dmi_table[] __initconst = {

Quoted 10 lines
drivers/acpi/ec.c +6 -1
+               .callback = ec_honor_dsdt_gpe,
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga S740-14IIL"),
+               },
+       },
        {
                /*
                 * Samsung hardware
--

Applied as 7.5 material, thanks!