Skip to content

Commit 4370cbf

Browse files
zhang-ruirafaeljw
authored andcommitted
ACPI: EC: trust DSDT GPE for certain HP laptop
On HP Pavilion Gaming Laptop 15-cx0xxx, the ECDT EC and DSDT EC share the same port addresses but different GPEs. And the DSDT GPE is the right one to use. The current code duplicates DSDT EC with ECDT EC if the port addresses are the same, and uses ECDT GPE as a result, which breaks this machine. Introduce a new quirk for the HP laptop to trust the DSDT GPE, and avoid duplicating even if the port addresses are the same. Link: https://bugzilla.kernel.org/show_bug.cgi?id=209989 Reported-and-tested-by: Shao Fu, Chen <[email protected]> Signed-off-by: Zhang Rui <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 6306f04 commit 4370cbf

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

drivers/acpi/ec.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ static struct workqueue_struct *ec_query_wq;
183183

184184
static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */
185185
static int EC_FLAGS_IGNORE_DSDT_GPE; /* Needs ECDT GPE as correction setting */
186+
static int EC_FLAGS_TRUST_DSDT_GPE; /* Needs DSDT GPE as correction setting */
186187
static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
187188

188189
/* --------------------------------------------------------------------------
@@ -1593,7 +1594,8 @@ static int acpi_ec_add(struct acpi_device *device)
15931594
}
15941595

15951596
if (boot_ec && ec->command_addr == boot_ec->command_addr &&
1596-
ec->data_addr == boot_ec->data_addr) {
1597+
ec->data_addr == boot_ec->data_addr &&
1598+
!EC_FLAGS_TRUST_DSDT_GPE) {
15971599
/*
15981600
* Trust PNP0C09 namespace location rather than
15991601
* ECDT ID. But trust ECDT GPE rather than _GPE
@@ -1816,6 +1818,18 @@ static int ec_correct_ecdt(const struct dmi_system_id *id)
18161818
return 0;
18171819
}
18181820

1821+
/*
1822+
* Some ECDTs contain wrong GPE setting, but they share the same port addresses
1823+
* with DSDT EC, don't duplicate the DSDT EC with ECDT EC in this case.
1824+
* https://bugzilla.kernel.org/show_bug.cgi?id=209989
1825+
*/
1826+
static int ec_honor_dsdt_gpe(const struct dmi_system_id *id)
1827+
{
1828+
pr_debug("Detected system needing DSDT GPE setting.\n");
1829+
EC_FLAGS_TRUST_DSDT_GPE = 1;
1830+
return 0;
1831+
}
1832+
18191833
/*
18201834
* Some DSDTs contain wrong GPE setting.
18211835
* Asus FX502VD/VE, GL702VMK, X550VXK, X580VD
@@ -1870,6 +1884,11 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = {
18701884
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
18711885
DMI_MATCH(DMI_PRODUCT_NAME, "X580VD"),}, NULL},
18721886
{
1887+
/* https://bugzilla.kernel.org/show_bug.cgi?id=209989 */
1888+
ec_honor_dsdt_gpe, "HP Pavilion Gaming Laptop 15-cx0xxx", {
1889+
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
1890+
DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Gaming Laptop 15-cx0xxx"),}, NULL},
1891+
{
18731892
ec_clear_on_resume, "Samsung hardware", {
18741893
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL},
18751894
{},

0 commit comments

Comments
 (0)