Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2799263pxv; Mon, 12 Jul 2021 02:06:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAIqUVnjIPQsrrKpUjh+IeeCXEJclTWH8Az/kZ55jXNQbeiMvMLvhFftcnPM0pnnH0N9iz X-Received: by 2002:a92:ad02:: with SMTP id w2mr37446890ilh.8.1626080772779; Mon, 12 Jul 2021 02:06:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626080772; cv=none; d=google.com; s=arc-20160816; b=wIpXlX2LIQKm026N4wL18IAUZHYik3ot59guCY72j8arRtuhvl/CiYqz9T8fQh5DyW Gpsj236BtQ1FTlaUT8W+VLhgY6/oMBnpRTilWJq3WTMp3h7gMEgoEVZOEcuuyVmDkvt9 ygzi8wy1BRXceCy+GX34xdn/NGGZjKE45UOyaD2/OBWwB3NEyRr/I+Uf35F3Q9P2MmBN FgR+2pEY6Ub0aVx356Cvr6eelMo7LQWptTK53zBh9WKW4a66pn4AVh5WetEAJQB/LYb1 fNHMFhGMRD/9vppPAYeb+j9BcEs0aQFaCxfqHswK2PNFAi60/N2XTFL7hUxQj1a+BXv8 eu0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=v7up9uncD/41tIZlQcCQkH4UELQJZWkTklpKTvyWR+w=; b=0BBWqz/jwd9cmpC3KLJYLLDrutifi/PEaVJzdiozEgvkmaKpZZ6UsD6rXTWOgGtc3l 5gD2n9fEsbDQsP6JAec6U0CbvWJPefFB4YWeeDUYPVOrfpYAmnCMdOl0C77/lkZIqDP7 6UPp+Nnr1jeByGhdvAYNfr1vB38Lqyyd8S1BVZod/WfQ2AFgo+e+JfusZq3rCSr88WPk yOZQhbhFmqhG03FUZ4O9W5yJbOjQVhYl6Fxsc6kTkPWvwDtb6b7P1BeF8IFhqr8HiJl4 mdqFeoufbOIXdTCXQGf1Dvd3S35dflCJpB8fNIrqElUCYYPrSQ3P7RUFnn9LTbnlZtxS 6/mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YevUDwTK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si16183737iom.50.2021.07.12.02.06.01; Mon, 12 Jul 2021 02:06:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YevUDwTK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384986AbhGLJFe (ORCPT + 99 others); Mon, 12 Jul 2021 05:05:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:35618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355684AbhGLIKN (ORCPT ); Mon, 12 Jul 2021 04:10:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 762E8613DB; Mon, 12 Jul 2021 08:07:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626077243; bh=xcVBS5NR2/kTAx0CnPSNv/gVAuYNRhkMw/yRU9TTFh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YevUDwTKkU+tE+dX/0R/5TGREOMUC+rXYjhrwrrJKDpxMIeDfjUlrjeD6/JM8yAZR P4UZNots4JzHxstPn2eKVnNy2elDR5xRLf93M0WT/edv1AYzR7PyY8VYc2GaDqXP8l LVANxSy/rKuhAUuuDADxH0ZwfOQA5qKS/kTsXBUM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Rui , "Rafael J. Wysocki" , Sasha Levin , Chen Subject: [PATCH 5.10 197/593] ACPI: EC: trust DSDT GPE for certain HP laptop Date: Mon, 12 Jul 2021 08:05:57 +0200 Message-Id: <20210712060904.683308055@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060843.180606720@linuxfoundation.org> References: <20210712060843.180606720@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhang Rui [ Upstream commit 4370cbf350dbaca984dbda9f9ce3fac45d6949d5 ] 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 Signed-off-by: Zhang Rui Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/ec.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 32f3b6d268f5..be3e0921a6c0 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -183,6 +183,7 @@ static struct workqueue_struct *ec_query_wq; static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */ static int EC_FLAGS_IGNORE_DSDT_GPE; /* Needs ECDT GPE as correction setting */ +static int EC_FLAGS_TRUST_DSDT_GPE; /* Needs DSDT GPE as correction setting */ static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */ /* -------------------------------------------------------------------------- @@ -1606,7 +1607,8 @@ static int acpi_ec_add(struct acpi_device *device) } if (boot_ec && ec->command_addr == boot_ec->command_addr && - ec->data_addr == boot_ec->data_addr) { + ec->data_addr == boot_ec->data_addr && + !EC_FLAGS_TRUST_DSDT_GPE) { /* * Trust PNP0C09 namespace location rather than * ECDT ID. But trust ECDT GPE rather than _GPE @@ -1829,6 +1831,18 @@ static int ec_correct_ecdt(const struct dmi_system_id *id) return 0; } +/* + * Some ECDTs contain wrong GPE setting, but they share the same port addresses + * with DSDT EC, don't duplicate the DSDT EC with ECDT EC in this case. + * https://bugzilla.kernel.org/show_bug.cgi?id=209989 + */ +static int ec_honor_dsdt_gpe(const struct dmi_system_id *id) +{ + pr_debug("Detected system needing DSDT GPE setting.\n"); + EC_FLAGS_TRUST_DSDT_GPE = 1; + return 0; +} + /* * Some DSDTs contain wrong GPE setting. * Asus FX502VD/VE, GL702VMK, X550VXK, X580VD @@ -1883,6 +1897,11 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), DMI_MATCH(DMI_PRODUCT_NAME, "X580VD"),}, NULL}, { + /* https://bugzilla.kernel.org/show_bug.cgi?id=209989 */ + ec_honor_dsdt_gpe, "HP Pavilion Gaming Laptop 15-cx0xxx", { + DMI_MATCH(DMI_SYS_VENDOR, "HP"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Gaming Laptop 15-cx0xxx"),}, NULL}, + { ec_clear_on_resume, "Samsung hardware", { DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL}, {}, -- 2.30.2