From patchwork Mon Sep 12 17:23:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 605312 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 474DAECAAD5 for ; Mon, 12 Sep 2022 17:24:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230130AbiILRYI (ORCPT ); Mon, 12 Sep 2022 13:24:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbiILRYG (ORCPT ); Mon, 12 Sep 2022 13:24:06 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2069.outbound.protection.outlook.com [40.107.96.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 188093F32A; Mon, 12 Sep 2022 10:24:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CQ9YX1YXi28O5H99w8bHCNW+IYA5yOvPpGnxkoCuR5uxoCUZQPxcAauMHNK0USV8BoVG+UlNs9Gx5IZz9ge01ZJLwl37edWFJe5U6HhOFWShYelkPfa0WmfjL7Cx4pWT23xSG9fMBaH7g9OnmSZCTlqKu5nXW3eH/cuqCuDvefu4KtD+hzv4ieqwsikhdITCwBtVz4J+LosJTtD9FB4syt3M65F9qP0qWhSUR9ty5hiT2oFBVSJ6EJrtxqNTmVEKc6G902TRW8zL/O+OAZ1hGg+7048bh5NqAuSHaCPCr8jqJXb7cbrUJzLfx/NB/Gk5FKliut2dVhiLfG1Hwaj64g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GhFJrJW+CG7zhjQDljwvhx20SO8Rxv0eM8ClyPIVpvM=; b=VHXdYP8yDimTqrpoHRIcwunJIs1V0X7KIsYhu3V9DVzmpkcvf/YXWPTwSuVo2awk5PcxKNBZWaHLSqBD5kHX8QuFPssrsGfKlmK9FLz8Jq+NfMkU4SdKiRCATbHiZ1NFC+ZDx7LRf6Vvq6H+Q/t3N1E0qoKwnJlm0v0nbVaswWBJkTxFcNazoIA6dy+iqeVK/FfJSklS1Hx8PWweGRZCXjsM6Z6CoR1LrLTxea7R/t+Lu4Q9Xo/dTlwjksbaWRLSTM64Wq2HwxD63zB1A2EmgOOQmVvowo4TJFNhEsGt8Pq+5jsN2TH16rRjopyuNPovEM3g7+uXXSbqh81+BDhciA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GhFJrJW+CG7zhjQDljwvhx20SO8Rxv0eM8ClyPIVpvM=; b=pTU7KAOhRDfqrysOPVd4nBPD+W2fQQQwM4yVLj6f9Ho/guL+NGh8R0Sdi8gb6Lgg/Hd5NGS12OrER2qHI4icO1132AAok+g4x8UlLF+VFr8CHqQdL5H1sBVKBqxEFKnVz0EN+j+mxlRAfn8tiVLWPCGmU+1FrifARN1HYfMBtdg= Received: from BN8PR04CA0023.namprd04.prod.outlook.com (2603:10b6:408:70::36) by BL1PR12MB5189.namprd12.prod.outlook.com (2603:10b6:208:308::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Mon, 12 Sep 2022 17:24:00 +0000 Received: from BN8NAM11FT115.eop-nam11.prod.protection.outlook.com (2603:10b6:408:70:cafe::27) by BN8PR04CA0023.outlook.office365.com (2603:10b6:408:70::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14 via Frontend Transport; Mon, 12 Sep 2022 17:24:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT115.mail.protection.outlook.com (10.13.177.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Mon, 12 Sep 2022 17:24:00 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 12 Sep 2022 12:23:58 -0500 From: Mario Limonciello To: , CC: , , , , Mario Limonciello , Len Brown , Subject: [PATCH v2 1/6] acpi/x86: s2idle: Move _HID handling for AMD systems into structures Date: Mon, 12 Sep 2022 12:23:55 -0500 Message-ID: <20220912172401.22301-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220912172401.22301-1-mario.limonciello@amd.com> References: <20220912172401.22301-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT115:EE_|BL1PR12MB5189:EE_ X-MS-Office365-Filtering-Correlation-Id: 618164bf-41f1-4759-d312-08da94e394d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yKLtBIN21wfH6z/S6QXCMK3w38D9W/6br68Mt0wnNsv0Gbery76b/7sHLsgmooQGQNonZTuI5X+fupodrsYQ/qFhHkG3JRCwugyNWiQIRAiJFGna9C16eukJua6B3a4rB/qsyvtdqpW4OC2zqDaNCNmsFjR+Pxt5EIu0831BP247PtnDOdQpD951IVtVDANOzSZh1PXL/5DJdBxL/Csx0X/JrOi8U1yKbCAHdz1A5ViWiOOoq1v4cHh3nfUoBZ/Xfi4rDKo+O7+NgEkWeViDjifiUpS76U6HlDkYda74ooS2PG9nfSfpY6CB+v++BAE95c6KriSut+Wph1jk+cqO8ZtrcGoSqTrDGFSO+A2MSLJXJEgykteY2cTmX33JvW/Zz56oNB/Oh1AYOKhuHBaxVMShTYBJJF/+fUDQp/tEB+LbztAeDMokZym5wbgtQgpM/rN/xquvTx2kfBMBORfwibFXNsc3Nfr3d6EIYl/q3Fr4BEdPPNuANhSbKZ0nsS36rW1qYc1SaNWuc+CsIuYtx2mUeW54umtrqdWrWhHrzw/3vomnmJyB3EC3Cmx4vKeU0V99NStrxhag2gJz50k51lGJjFbanWv6Xb/ur0G2q93WrW442+8g4g4U8xTcwlTnhV+loVpxdpFSLW5r3KFIdcSzECnLiB3lTfyCwtanAYf1a4b3nTQejq5HwqiKXCrTGIAbjRk02XMl0OMS2MktesvCfHperjmbcyt48UCJJp1nfeGF0RNGz6cDjVJlwoAnX3JTofdF9rNytzOSCfQJ4m0PdoEwPlzzMuDWD1cWPBf29B5BbjJByOiO1q0ZGx1q X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199015)(36840700001)(40470700004)(46966006)(45080400002)(316002)(16526019)(186003)(2616005)(47076005)(82310400005)(41300700001)(26005)(336012)(1076003)(82740400003)(2906002)(70586007)(81166007)(8936002)(40480700001)(70206006)(36756003)(5660300002)(8676002)(4326008)(6666004)(7696005)(478600001)(40460700003)(86362001)(356005)(54906003)(110136005)(83380400001)(44832011)(36860700001)(426003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2022 17:24:00.0987 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 618164bf-41f1-4759-d312-08da94e394d1 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT115.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5189 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Right now the information about which cases to use for what are in a comment, but this is error prone. Instead move all information into a dedicated structure. Tested-by: catalin@antebit.com Signed-off-by: Mario Limonciello Reviewed-by: Philipp Zabel Tested-by: Philipp Zabel # GA402RJ --- drivers/acpi/x86/s2idle.c | 63 ++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index f9ac12b778e6..a7757551f750 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -363,6 +363,39 @@ static int validate_dsm(acpi_handle handle, const char *uuid, int rev, guid_t *d return ret; } +struct amd_lps0_hid_device_data { + const unsigned int rev_id; + const bool check_off_by_one; + const bool prefer_amd_guid; +}; + +static const struct amd_lps0_hid_device_data amd_picasso = { + .rev_id = 0, + .check_off_by_one = true, + .prefer_amd_guid = false, +}; + +static const struct amd_lps0_hid_device_data amd_cezanne = { + .rev_id = 0, + .check_off_by_one = false, + .prefer_amd_guid = false, +}; + +static const struct amd_lps0_hid_device_data amd_rembrandt = { + .rev_id = 2, + .check_off_by_one = false, + .prefer_amd_guid = true, +}; + +static const struct acpi_device_id amd_hid_ids[] = { + {"AMD0004", (kernel_ulong_t)&amd_picasso, }, + {"AMD0005", (kernel_ulong_t)&amd_picasso, }, + {"AMDI0005", (kernel_ulong_t)&amd_picasso, }, + {"AMDI0006", (kernel_ulong_t)&amd_cezanne, }, + {"AMDI0007", (kernel_ulong_t)&amd_rembrandt, }, + {} +}; + static int lps0_device_attach(struct acpi_device *adev, const struct acpi_device_id *not_used) { @@ -370,31 +403,27 @@ static int lps0_device_attach(struct acpi_device *adev, return 0; if (acpi_s2idle_vendor_amd()) { - /* AMD0004, AMD0005, AMDI0005: - * - Should use rev_id 0x0 - * - function mask > 0x3: Should use AMD method, but has off by one bug - * - function mask = 0x3: Should use Microsoft method - * AMDI0006: - * - should use rev_id 0x0 - * - function mask = 0x3: Should use Microsoft method - * AMDI0007: - * - Should use rev_id 0x2 - * - Should only use AMD method - */ - const char *hid = acpi_device_hid(adev); - rev_id = strcmp(hid, "AMDI0007") ? 0 : 2; + static const struct acpi_device_id *dev_id; + const struct amd_lps0_hid_device_data *data; + + for (dev_id = &amd_hid_ids[0]; dev_id->id[0]; dev_id++) + if (acpi_dev_hid_uid_match(adev, dev_id->id, NULL)) + break; + if (dev_id != NULL) + data = (const struct amd_lps0_hid_device_data *) dev_id->driver_data; + else + return 0; + rev_id = data->rev_id; lps0_dsm_func_mask = validate_dsm(adev->handle, ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid); lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle, ACPI_LPS0_DSM_UUID_MICROSOFT, 0, &lps0_dsm_guid_microsoft); - if (lps0_dsm_func_mask > 0x3 && (!strcmp(hid, "AMD0004") || - !strcmp(hid, "AMD0005") || - !strcmp(hid, "AMDI0005"))) { + if (lps0_dsm_func_mask > 0x3 && data->check_off_by_one) { lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1; acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n", ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask); - } else if (lps0_dsm_func_mask_microsoft > 0 && + } else if (lps0_dsm_func_mask_microsoft > 0 && data->prefer_amd_guid && (!strcmp(hid, "AMDI0007") || !strcmp(hid, "AMDI0008"))) { lps0_dsm_func_mask_microsoft = -EINVAL; From patchwork Mon Sep 12 17:23:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 605311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21035ECAAD5 for ; Mon, 12 Sep 2022 17:24:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229601AbiILRYK (ORCPT ); Mon, 12 Sep 2022 13:24:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbiILRYI (ORCPT ); Mon, 12 Sep 2022 13:24:08 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2075.outbound.protection.outlook.com [40.107.237.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B3913FA36; Mon, 12 Sep 2022 10:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MoP2CRXDZ86wqXBusYe2uj1LOzST3nqA+hixZL3Rg2uQ5dOCzGZuJpXMriKY/p/lmKzpCWWy1RB0IfEZk9NBXwRwrYZEfzIcQSOhCT8MKeXsWSNo7n+wRXLdq4LptO84pMbpnfUNm2qj9K7eLtqPJl+xUshhvw+141Jcup9vPVhx0iSyOmTDMg0coLrHgOll+Yf4nTwl4nr3IHYUajxtEgAMT1xNRwiiPRT0t5P2S9oH8dZVsq7pAulCkt2hfT/cqhRlvL6a7ND5GTQdQkO8wvPEE27PBSlLs68EfbrzCEQhivCTRyyqHx8uki9TF2kzkiwERF2/FrhaNK9fiJiIaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3nQHF6cihPA7KZzNPRqdBCkFrOZ7QaWnoOMuPXT3MDw=; b=TEzHu4OrKt2f6WQdukfxDt/ViqxsC8BsPzEFM0zu25QAjejp7YtEpxmku+wS34YzBU9lCKyLfPIrIaeswU/bCzQdZc1LF4QBzjbVU33kpYJomtgjuXhDxk6Wv1STkAIZvADug/gFDJjRfhpVszlpnatIoqZLwB9eF7jYIKD33/7fl1ZQcuTUddhcNmA8FeAbMgtdnJ7GQr7h/LFdKD9iVGinKSDCE+FJFVDcyWAUBis1sEa5ve4TW8Mg8X7N4zkglpG4MkFx6Zeoa1KqvLE2+GZdSbtMdrHYNPPbRC5jL+giEbTdsuF1UmWfR2e9Ovj6MwNeU6vbuXF5jU4swStWvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3nQHF6cihPA7KZzNPRqdBCkFrOZ7QaWnoOMuPXT3MDw=; b=Rww4ANCU8sjDjPOENiBXTlI4wMSLID9D2DcZgMx5HQ4C5NMuSDBcV8uYe8ZO+t4iElkLZ3kQ3z/B31Mkp7N/RD8tH3T5Lx9hTjxI0ZVIT5a624HXmHRxIPrHNSc9f8Ah5qYwLiffglR4Jj1IhFE4AjapkxDEFOQCmvYFntfGEro= Received: from BN8PR04CA0029.namprd04.prod.outlook.com (2603:10b6:408:70::42) by CY5PR12MB6250.namprd12.prod.outlook.com (2603:10b6:930:22::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Mon, 12 Sep 2022 17:24:01 +0000 Received: from BN8NAM11FT115.eop-nam11.prod.protection.outlook.com (2603:10b6:408:70:cafe::10) by BN8PR04CA0029.outlook.office365.com (2603:10b6:408:70::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.15 via Frontend Transport; Mon, 12 Sep 2022 17:24:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT115.mail.protection.outlook.com (10.13.177.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Mon, 12 Sep 2022 17:24:00 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 12 Sep 2022 12:23:59 -0500 From: Mario Limonciello To: , CC: , , , , Mario Limonciello , Len Brown , Subject: [PATCH v2 2/6] acpi/x86: s2idle: If a new AMD _HID is missing assume Rembrandt Date: Mon, 12 Sep 2022 12:23:56 -0500 Message-ID: <20220912172401.22301-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220912172401.22301-1-mario.limonciello@amd.com> References: <20220912172401.22301-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT115:EE_|CY5PR12MB6250:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f75fb82-f83c-47d1-a825-08da94e39508 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UthoNvh7hViiXVRacmDaoOY4Q8QjBhOPqkEguA6FVXZwYnDXnZcByyjHLcT60EKSPGMgaJ22T34pFgsdV5Q+0rZM5qTtTr+pxwyqU8EaXMLO3doDd0pNKjtgcGQYWfJkaPwwDUvvVglmINOU4qzK1QVOnxDYmxRaE78gD1vp+B2yRBcncAvgTRxaBivE5zYMifxE/acZvU05FZJht9MLrMxOSmk0Y5imVW0dsR0W+OJa1dHvZrFDMtLf4HI15aak/Z1YYxHOWAVGzYzRAUOPcPs1GMs1w590P+g1pAIZwRR1IwOdO+OZokDPg2gQDmWNKGuPjCPK7ripDDW/dJPiIJRA4jDhF0oq1HOrrJWl3uPAwwYQYZv/HZUUjDk7jlbfMtsQ3R5hH+0lBaX/SaDkT0K7aykZKgtWblKx8O1ty4dtz91WLegyElTTisSFPoYmXU0liJ2R9zf3m/Szb211OuLK+QDiK4GLAtdExvtgqJNsWaiShEsqdnmGLtAhRahz5jPx+LPve8/0x2c2u2hB7XWMVAyC2kPu+zQW0hUu+CxNP8Tn1TpsUDxMIl+p/0ed3+mF0X9E3UbNcotwtYVVXTfl31K6xmThVUQuPacBvXWEM8nWz5ZJLjIVUV3ulnIlXhm5H7wUt3WQjCa80aON06aknsHwp4NE/gT9NR+eWwsK/KtWMdadaQiAHsbZtE6/nPguGtIW1VxxOg9ikDe+GDWU0rPKDg/Er8rV7nJw1HV+3iPSSwH5VnP+QwGOczJcMsW36Sb1tf2xCnvNeY+4pMyNnG2O8fGLF42YzLqgwxJV2Oyz4AgRJoHTPd9tOwzp X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199015)(46966006)(36840700001)(40470700004)(36756003)(478600001)(6666004)(2906002)(47076005)(426003)(81166007)(356005)(5660300002)(8936002)(8676002)(4326008)(36860700001)(82310400005)(2616005)(82740400003)(16526019)(1076003)(7696005)(40460700003)(86362001)(26005)(4744005)(70586007)(70206006)(41300700001)(54906003)(40480700001)(83380400001)(316002)(336012)(110136005)(44832011)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2022 17:24:00.4424 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f75fb82-f83c-47d1-a825-08da94e39508 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT115.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6250 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org A mistake was made that only AMDI0007 was set to rev of "2", but it should have been also set for AMDI008. If an ID is missing from the _HID table, then assume it matches Rembrandt behavior. This implicitly means that if any other behavior changes happen in the future missing IDs must be added to that table. Tested-by: catalin@antebit.com Signed-off-by: Mario Limonciello Reviewed-by: Philipp Zabel Tested-by: Philipp Zabel # GA402RJ --- drivers/acpi/x86/s2idle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index a7757551f750..a8256e5a0e8a 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -412,7 +412,7 @@ static int lps0_device_attach(struct acpi_device *adev, if (dev_id != NULL) data = (const struct amd_lps0_hid_device_data *) dev_id->driver_data; else - return 0; + data = &amd_rembrandt; rev_id = data->rev_id; lps0_dsm_func_mask = validate_dsm(adev->handle, ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid); From patchwork Mon Sep 12 17:23:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 605023 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A810C6FA89 for ; Mon, 12 Sep 2022 17:24:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230145AbiILRYJ (ORCPT ); Mon, 12 Sep 2022 13:24:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbiILRYI (ORCPT ); Mon, 12 Sep 2022 13:24:08 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2074.outbound.protection.outlook.com [40.107.220.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 034CE3FA0D; Mon, 12 Sep 2022 10:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GzH56FYbbwQlCqUeK3i3mnQve0A0i+qIoRDFkRaUnwc7sAL7lMyWfWqAHR5V77p45wJiuBW/wZYPD303jOSdvOOA5ar7OU/Yi1VohsxRyPMPK4ZWhRk72t8AEQZKETqQScauevUxnJxSshfKDrqNr2Kd9U3b0HYRwMFnKPHf+8684tZrRGIlvJUISijFLPDCXhfsLIJgnbmLpnIDL/HkQirzA6jRBo9XiDRh5w+gX/xlp9Y1ORcqJMPjnSjVMqblO4a2tCs5fLv6aVsuvmTvlqDU1Pz73IMtHxZboyfH0bKNlvr/sOwZCtiyH+C7vih4ND4YPSjOXvNEaN9q1TUWIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eJCqzRJRGdOcmbBQ/3UeozeAWVOetcD8M2l0k2hGyec=; b=MWoZ+Fsq4NTxX/LrXwHyCi/xbapxlpv8M6NnUfGcJEnG0zEuQRbNQ6XAsP5mOSS/PYUEzStpxHUdk+vb+uzxKKgZrU1X00iJt8MxLh2QflmfWvVg19FyT3jX3+PBSiV0TBU4mVkq/Vgny5OBxBLO5tZMqM6DAyGh3LRiMbOpOStbXN9gTUWDZrzBHpdggBvGkneaX8vBl5JBCI3RKBZV0p+6sIYIJZo+Ly6Ys8QjtL3g8trx6HoJZoICAh3aWnThdUtBuNBLxjujpXq2iQxa6JckPLnYeYqTFD1A1gWWu2KJZPqzq9Fg4KB4Gr/GfDUeZhcGxEQxsBWNo7mB0VuM8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eJCqzRJRGdOcmbBQ/3UeozeAWVOetcD8M2l0k2hGyec=; b=YF3zIg0WPmKT+Gs2FcXMGAK0Zh1TJuIS9GDzmXKn5FMX0ZIF9QrNwcqlkpVLxZiAv/7eJyNrEvO4nvFfEJi+JpQdFFWt8d7yn9dM9INbJxggGOKnuYf9zQk9hpHMi2M7hCyyobLe7Z6p29iB9qo3HTxmvlv06GybtJ8t77CIWHs= Received: from BN8PR04CA0005.namprd04.prod.outlook.com (2603:10b6:408:70::18) by SN7PR12MB6931.namprd12.prod.outlook.com (2603:10b6:806:261::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Mon, 12 Sep 2022 17:24:02 +0000 Received: from BN8NAM11FT115.eop-nam11.prod.protection.outlook.com (2603:10b6:408:70:cafe::f5) by BN8PR04CA0005.outlook.office365.com (2603:10b6:408:70::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12 via Frontend Transport; Mon, 12 Sep 2022 17:24:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT115.mail.protection.outlook.com (10.13.177.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Mon, 12 Sep 2022 17:24:02 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 12 Sep 2022 12:24:00 -0500 From: Mario Limonciello To: , CC: , , , , Mario Limonciello , Len Brown , Subject: [PATCH v2 3/6] acpi/x86: s2idle: Add module parameter to prefer Microsoft GUID Date: Mon, 12 Sep 2022 12:23:57 -0500 Message-ID: <20220912172401.22301-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220912172401.22301-1-mario.limonciello@amd.com> References: <20220912172401.22301-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT115:EE_|SN7PR12MB6931:EE_ X-MS-Office365-Filtering-Correlation-Id: 828693b8-7b39-4905-31bc-08da94e3963c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LJJ++O1DfmrNM5pwZtTXxGpoMlkeAzcmwpOwb6ZFkIPzqZaMZfEssRZJ1HHzlxzKD6AAonIipborvhDU0MnLBpeh+qoaptJVj2CeyNXT47lKIXSHh8pUTVJ3pvXQzdz6cf1UP8zDd7mzVJ0oqBwBuiwwF6z6ynpNg/gMx4bGfZa8kJaCOh2lk01Ct6SEuBDVJXJvWqpNbCIanz3Fp4Zv7wRQlDGnBgz4w1GFaQYXqvLE30dXRwXgvMfAjSeL9/zA6SwCclYyDQmPLp/pbp8wLqZr/kMSNvoS86qOIiduCRsWikr9XqlH5XiBIVxknqwNVI+B6nmTgMm/ksViMhz4mep0UpYm9y2if9wpIld4AAVu4E4qmpvYbc68cvAXjXJ9eiBSJRgfInA7ca9Rd0QATWVRwsitokCrVG0BUKwwQhFVHopkwgJWcG6+eE94cyrJhKBRHpMTYHRtCcsC5laf7qNIwZoxiPyD5RPeYP2Fpq3zGlwZOxso7PozrAZih5ngdvymmumaFhvjK0gIR1W3+dY3iEoqyiLD9IY0bj8+QUHP2hQ2gCywW1iDVfNpIkL+FYTXNopzTdMh9ukqJu0qKeCNcKkcDa+ul0jzJ2lNc/36L6o+Po2J8LXurqWFQ5PbYbJzPqiWBy6WtTgpsenJcqnH49H0H5t5S/gT8EQfZlSu6gfDSC+zyF/X4a7qtGFuPht2P7IUP1VZXujbfm9FQRuHUQkIIDHkMXtJHg4YdU8tRNq821MEFXocEy2BKRNdDs033zVxX6mDFPVWjP+NjDuIzvmpmWR2RyO845HdwyQ9ODMr1W4nyUDpfFCBDFde X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(346002)(396003)(39860400002)(136003)(47530400004)(451199015)(40470700004)(36840700001)(46966006)(16526019)(478600001)(81166007)(41300700001)(83380400001)(52230400001)(5660300002)(8936002)(8676002)(4326008)(44832011)(2906002)(7696005)(2616005)(186003)(40480700001)(1076003)(47076005)(86362001)(336012)(26005)(45080400002)(426003)(6666004)(40460700003)(36860700001)(82310400005)(36756003)(356005)(70206006)(82740400003)(110136005)(54906003)(316002)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2022 17:24:02.4735 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 828693b8-7b39-4905-31bc-08da94e3963c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT115.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6931 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org OEMs have made some mistakes in the past for the AMD GUID support and not populated the method properly. To add an escape hatch for this problem introduce a module parameter that can force using the Microsoft GUID. This is intentionally introduced to both Intel and AMD codepaths to allow using the parameter as a debugging tactic on either. Signed-off-by: Mario Limonciello Reviewed-by: Philipp Zabel Tested-by: Philipp Zabel # GA402RJ --- drivers/acpi/x86/s2idle.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index a8256e5a0e8a..a9b0f2b54a1c 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -27,6 +27,10 @@ static bool sleep_no_lps0 __read_mostly; module_param(sleep_no_lps0, bool, 0644); MODULE_PARM_DESC(sleep_no_lps0, "Do not use the special LPS0 device interface"); +static bool prefer_microsoft_guid __read_mostly; +module_param(prefer_microsoft_guid, bool, 0644); +MODULE_PARM_DESC(prefer_microsoft_guid, "Prefer selecting Microsoft GUID for LPS0 device"); + static const struct acpi_device_id lps0_device_ids[] = { {"PNP0D80", }, {"", }, @@ -402,6 +406,9 @@ static int lps0_device_attach(struct acpi_device *adev, if (lps0_device_handle) return 0; + lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle, + ACPI_LPS0_DSM_UUID_MICROSOFT, 0, + &lps0_dsm_guid_microsoft); if (acpi_s2idle_vendor_amd()) { static const struct acpi_device_id *dev_id; const struct amd_lps0_hid_device_data *data; @@ -416,16 +423,12 @@ static int lps0_device_attach(struct acpi_device *adev, rev_id = data->rev_id; lps0_dsm_func_mask = validate_dsm(adev->handle, ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid); - lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle, - ACPI_LPS0_DSM_UUID_MICROSOFT, 0, - &lps0_dsm_guid_microsoft); if (lps0_dsm_func_mask > 0x3 && data->check_off_by_one) { lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1; acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n", ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask); } else if (lps0_dsm_func_mask_microsoft > 0 && data->prefer_amd_guid && - (!strcmp(hid, "AMDI0007") || - !strcmp(hid, "AMDI0008"))) { + !prefer_microsoft_guid) { lps0_dsm_func_mask_microsoft = -EINVAL; acpi_handle_debug(adev->handle, "_DSM Using AMD method\n"); } @@ -433,7 +436,8 @@ static int lps0_device_attach(struct acpi_device *adev, rev_id = 1; lps0_dsm_func_mask = validate_dsm(adev->handle, ACPI_LPS0_DSM_UUID, rev_id, &lps0_dsm_guid); - lps0_dsm_func_mask_microsoft = -EINVAL; + if (!prefer_microsoft_guid) + lps0_dsm_func_mask_microsoft = -EINVAL; } if (lps0_dsm_func_mask < 0 && lps0_dsm_func_mask_microsoft < 0) From patchwork Mon Sep 12 17:23:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 605310 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C868CC6FA82 for ; Mon, 12 Sep 2022 17:24:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbiILRY0 (ORCPT ); Mon, 12 Sep 2022 13:24:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230158AbiILRYX (ORCPT ); Mon, 12 Sep 2022 13:24:23 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20620.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::620]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 926C73FA0F; Mon, 12 Sep 2022 10:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GhAX0W1iGnZw6TVqWK4KibxPBXskLURpulmkKMp2Fvei9b0BL8t2FWEA5scl3LhhaoSVKz2EVpL3b2jqqZqfE2rQciSHhdq0phQuadeLgt0oarJQkg29MYXM5HojvO2hSa196sbIyD8exN7e7bhNXcuGxnTaohAPRRYGDDyacsOjbF+XOY10JLRSaFnB4CGJhPTIiqziuNvJ3WEKMLg4OslLHekgwLWGCg5UVx2+QHnRl468jjdqGlRQwQpmuziJOo74QtGxxGUY+qv3os/DWB0fiD+cogkw+LU9/43Be4oKl8reK35HQAr+31noLwspN/TCSNUo3OuFgCpwluIPSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YZpEKY+2zajLTl+lOEyy4FywPK+0qLw1aCaUgpFXfW0=; b=ACS9xJQ6TJTdsr5bDd8Ky0iGRwyze5cOUuRu4hmVjd8yzv8k2m8wCioC/ECsGlkVkFt4GmR+0qiDx9f0bQXNeUEFAICujqrrs9NWb/ir2wOZCkeJlRJ3fml5fUdRbCEvinO0o+G2nHjlDXfrCRp7WQTbmw7lQ66O1q00xBT09ZfhnpyaDqhl6gQYmsA/6f8tL6wLBMTdxpZ5G37qDAlDyHh8+0lGdOmyI1EDTes1xKY1di9cBcX0lnB0UDOGeiv15jT+1lorcUbbbqG72DtszjzAzZ/d59ldwA0aMF6kcpEVRtr90smLc1/7PVwGxo01XL5LI0Y4+rcb7ZWuVYAHxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YZpEKY+2zajLTl+lOEyy4FywPK+0qLw1aCaUgpFXfW0=; b=4TiATE/XxLbAz78tinkjSnxIdHK8LkpmybpgPdbL0hhppj3xbSzaULCgjKSBx89P0cG3KRz/pRLMSc/2mTD0sbbmWIvPLicQAE0yT/khaila7ePf+x5UGF90Kl+u0rgZSRyrJcI0d7DDI6phNMZJq1XFODJSBYI+r5/lbjF0vAo= Received: from BN8PR04CA0008.namprd04.prod.outlook.com (2603:10b6:408:70::21) by SJ0PR12MB7034.namprd12.prod.outlook.com (2603:10b6:a03:449::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Mon, 12 Sep 2022 17:24:03 +0000 Received: from BN8NAM11FT115.eop-nam11.prod.protection.outlook.com (2603:10b6:408:70:cafe::2f) by BN8PR04CA0008.outlook.office365.com (2603:10b6:408:70::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.15 via Frontend Transport; Mon, 12 Sep 2022 17:24:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT115.mail.protection.outlook.com (10.13.177.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Mon, 12 Sep 2022 17:24:03 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 12 Sep 2022 12:24:01 -0500 From: Mario Limonciello To: , CC: , , , , Mario Limonciello , Len Brown , Subject: [PATCH v2 4/6] acpi/x86: s2idle: Add a quirk for ASUS TUF Gaming A17 FA707RE Date: Mon, 12 Sep 2022 12:23:58 -0500 Message-ID: <20220912172401.22301-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220912172401.22301-1-mario.limonciello@amd.com> References: <20220912172401.22301-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT115:EE_|SJ0PR12MB7034:EE_ X-MS-Office365-Filtering-Correlation-Id: 65f60eca-5a19-45bb-ee50-08da94e396bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /J8/1c59lw7lfFtWqQxJl61T/X3KuIHlTVr342mkqkfXhO/mZJ0Yjk8G7jDjvFRzgME0TyI7R1ryPi1ESGn+KdEfGT3YDTF9WgbwLlyz9+obZeWyisJN/ET6PpoQem35XmZAzYepuqvpLbCATWK0XEDabEfmuhVnFjsocnQ0oyzfFWOkvWJxY8bjT9tUGeQRhxOsNdRTDo3Y5JWofhm3T4MAbPnd4EP2wp6rCHoGXwqb8qmwgAar6+9Tm5AstzeIlAOd/n/5quVNFHODhc3yMrCqKopHMNsQn2N5u+uwqOZHdLccdLU/E+6SgLlvzWs0S+kTGfESWjQsw8VblsxxqlOlaNaEURyHo5sNQHWZXvTb73otNEwQwveDQMpV93KAYHt3+t3zcwLQKM7K5hNIc+mb/7VRFu8q3Yb8dcOwoVzsTPVs/rAM2qhbPZ/B+ZA5dm71TEbJehYNFMxGRlpwtcbQKdRererB3y9L9yD3QVmYBdsWnr4XQjCHytdS7K381Kon8GGgYsIs8r1KLkcK6TQr4dtv7UWNI42O99s2yT0WX8yqwPeNjzHM/MPyTI0vwx7wV+lNMihy4HLNkCvtxsS/prz9uKEX3oGGiJqABGqkos9fFeKSluZhECENeoALzATIE7yudmxdGvCHqJvfRR20MU6J7cdcNkDQo98CVXBGNTPVO3qs2niwqco7PG3jz7pAUKC/NQYPM5Pmp2wbdi5Xr2QFq3mN+oZvMz3v6p5pYUUIO2DPneLLJDhKvmV7Gd2P5WjRJ2Ksx8Lvz59aknwwI3FSTwmI8jHWZPQCyLJ+mzTlzY0aepChiOmVJ4+NnO9B0eU6ipV6CpxN3ygIaA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(376002)(136003)(346002)(396003)(451199015)(40470700004)(46966006)(36840700001)(70586007)(426003)(316002)(36860700001)(6666004)(41300700001)(47076005)(966005)(82740400003)(2616005)(8676002)(16526019)(1076003)(356005)(110136005)(45080400002)(81166007)(8936002)(186003)(5660300002)(44832011)(36756003)(86362001)(82310400005)(478600001)(54906003)(83380400001)(7696005)(40480700001)(4326008)(26005)(40460700003)(70206006)(2906002)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2022 17:24:03.3016 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 65f60eca-5a19-45bb-ee50-08da94e396bc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT115.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7034 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org ASUS TUF Gaming A17 FA707RE has problems with ACPI events after s2idle resume. It's from a missing call to an ASL method in AMD the s2idle calling path. Force the system to use the Microsoft Modern Standby calling path instead. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216101 Reported-and-tested-by: catalin@antebit.com Signed-off-by: Mario Limonciello Reviewed-by: Philipp Zabel Tested-by: Philipp Zabel # GA402RJ --- v1->v2: * Fixup for __init --- drivers/acpi/x86/s2idle.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index a9b0f2b54a1c..9ee734e0c3c5 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -17,6 +17,7 @@ #include #include +#include #include #include "../sleep.h" @@ -400,6 +401,28 @@ static const struct acpi_device_id amd_hid_ids[] = { {} }; +static int lps0_prefer_microsoft(const struct dmi_system_id *id) +{ + pr_debug("Preferring Microsoft GUID.\n"); + prefer_microsoft_guid = true; + return 0; +} + +static const struct dmi_system_id s2idle_dmi_table[] __initconst = { + { + /* + * ASUS TUF Gaming A17 FA707RE + * https://bugzilla.kernel.org/show_bug.cgi?id=216101 + */ + .callback = lps0_prefer_microsoft, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "ASUS TUF Gaming A17"), + }, + }, + {} +}; + static int lps0_device_attach(struct acpi_device *adev, const struct acpi_device_id *not_used) { @@ -566,8 +589,9 @@ static const struct platform_s2idle_ops acpi_s2idle_ops_lps0 = { .end = acpi_s2idle_end, }; -void acpi_s2idle_setup(void) +void __init acpi_s2idle_setup(void) { + dmi_check_system(s2idle_dmi_table); acpi_scan_add_handler(&lps0_handler); s2idle_set_ops(&acpi_s2idle_ops_lps0); } From patchwork Mon Sep 12 17:23:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 605022 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8DB4C6FA89 for ; Mon, 12 Sep 2022 17:24:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230124AbiILRYL (ORCPT ); Mon, 12 Sep 2022 13:24:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbiILRYJ (ORCPT ); Mon, 12 Sep 2022 13:24:09 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2041.outbound.protection.outlook.com [40.107.212.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31C803FA14; Mon, 12 Sep 2022 10:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M7leVopCiquovhB+aplOQEqtPvH82yM0vlGja3CeW3md+2uP23EKESe2t79sVsYDsVGSjKa2HqOM40HCe2s4WDrlLXKXdpG5qDizVsQz9u2cC1Gz6kWxwBIFyTBi3aSwjycHku2oQ6UMGNsB5bpBGsLtP5/u8jpWmmwp5/TCiyyh2YxRVVcb0Z5BZn9xc1pOFj4T4eMgAcZU7+SUY3VrWixNTahsoyFdz/DwUatcgnEDCU0f4/u8Ug1lr0Wf2kA7uavTy3AoY6/FUJZ+skGdWXn2t1tG1zRtTsoBfkDb0fXRSX3vkxI9BFzDS1eG7+yXwQa2UD9bHnAmL+bVbMw+gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6lK9uxD6xIm0iY2YY+0p39rG6K4Hz8h+/204xdfwS/U=; b=IAtgPKH7hXuiE5fO7F37nIDswIt9/co4fBRwvZ3n/qVsnajNh2jcLWJnGkpbOdamWMqyaVpiUbv/2Q20OVodk+Cksx3PE79/kRiop5AeYwcYhWno8xxPcJa4BF9k7Ya1c6N5Kio75C6vq06vOIx+/l2G4Vznwx2M1jnX5SkkUq4vOhSl8NHWqO1VGHX0/BGerc2k71si6fFYNN6wgf9fgu/3iJ98A1ZHlf8vQn+YhCheosdB1IPVdX2/IaX2Wfy4n2QsLldWJcfKVrPBu6lUFIxB8XYeIZwf5UCfAGYBGgwn6uom3MZBwLv8Oo4kSKPg3ghjbilMQz+lXGosa522PA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6lK9uxD6xIm0iY2YY+0p39rG6K4Hz8h+/204xdfwS/U=; b=VDZoDYlst1eg416VouuY+AblMgImhj1PEz3QM12viJqtj4/pC+fQCc5XgrYSWU9lPMVgvoCgctiN7hQKS+iIQlN39T7xv3vIjFt4kl53yGedvlYNG08FBxyeUw/IR90PprM8rKqIpfH0EzrzMAyQJfnX6cmXMlVtN9wMKlUyDYE= Received: from BN8PR04CA0035.namprd04.prod.outlook.com (2603:10b6:408:70::48) by SJ1PR12MB6076.namprd12.prod.outlook.com (2603:10b6:a03:45d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.12; Mon, 12 Sep 2022 17:24:04 +0000 Received: from BN8NAM11FT115.eop-nam11.prod.protection.outlook.com (2603:10b6:408:70:cafe::7d) by BN8PR04CA0035.outlook.office365.com (2603:10b6:408:70::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.15 via Frontend Transport; Mon, 12 Sep 2022 17:24:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT115.mail.protection.outlook.com (10.13.177.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Mon, 12 Sep 2022 17:24:04 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 12 Sep 2022 12:24:01 -0500 From: Mario Limonciello To: , CC: , , , , Mario Limonciello , Len Brown , Subject: [PATCH v2 5/6] acpi/x86: s2idle: Add a quirk for ASUS ROG Zephyrus G14 Date: Mon, 12 Sep 2022 12:23:59 -0500 Message-ID: <20220912172401.22301-6-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220912172401.22301-1-mario.limonciello@amd.com> References: <20220912172401.22301-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT115:EE_|SJ1PR12MB6076:EE_ X-MS-Office365-Filtering-Correlation-Id: f03f12f8-1fc8-4d3e-966c-08da94e39749 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gFP0eY12GhREdXWE1pQAaH2JiD74fFQ2lXZbRl13/bzddorsSyWfxaCMUVBRkgLnMzxWHd2UYmagR/2D5RrePheqXk6OIz5zEolH1N/Stg3KyXveGdMxkeLT7FJX+H1ZKGiL5Aj+lE9dG1y4KcrI+PCEI+N9d8Z7v2Po+/m4/+lmos0hAJQSEV9R13kP2RY0OO786ZUA1wipvBE16O1vdOgpVKhJD9pJNN895DCsDhN3psUi0MWmftVD83WKzdl4vIr1wvtDrtXdIXH20CTsVzHQP0ObDSQCp8MfyiE/chpaBfL6GsW1ymoAtB6N788eCAifKPgZFI9jgJafPWmhO5WBuWW+nYgEM+dB4g65H95o9tYbQSpM36j4rVREJgJtZHste5Rl0WELLCtpLMDkboKfV5DHP51cJyca7eZjo4ezhoH8UHN6edRwY1/Z9kG3NmSf9jn7smm7yD0WyQFB/w89ca1akWLEXK4KdILvVJc0LeHeC+waFeu+xN4IcU3EkjbDZCnWJaJcF2np3QCjs0Ap1kkRZZyoJs9Ul12FjYZ6Kg8U9hC6FvzUkZszjxOD+nuKbYGfIdp52O0e0W6lz/PF+4uDpsRS5dr/UsBdKyKZFDNVBATrTEiE/Yocw8ixSQ5DBrxe3JP9nrYj9+BgLL/XjSdGWc0qGhLInmqFfKmDQ4wKuwYVRRz3n2/iV5y5DHn+1PstTIDfALq7E24frxSIij4u0O7Wd9Vcz0LvVDPnEICHUhj8mGmTqxNKXktMIsycsqq1cgY4LJUcJFCrXeP5kD/s4ZISTTpMqsiRD6HjmROWhJ4lK238CShigv+C X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(346002)(376002)(396003)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(26005)(4744005)(356005)(2906002)(81166007)(47076005)(7696005)(41300700001)(82310400005)(186003)(36860700001)(8676002)(316002)(70586007)(4326008)(110136005)(478600001)(8936002)(54906003)(40460700003)(86362001)(1076003)(16526019)(40480700001)(2616005)(45080400002)(336012)(5660300002)(44832011)(70206006)(426003)(82740400003)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2022 17:24:04.2390 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f03f12f8-1fc8-4d3e-966c-08da94e39749 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT115.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6076 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org ASUS ROG Zephyrus G14 is affected by the same BIOS bug as ASUS TUF Gaming A17 where important ASL is not called in the AMD code path. Use the Microsoft codepath instead. Reported-and-suggested-by: Philipp Zabel Signed-off-by: Mario Limonciello Tested-by: Philipp Zabel Tested-by: Matthew Anderson --- v1->v2: * New patch --- drivers/acpi/x86/s2idle.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index 9ee734e0c3c5..4bdc7133d2ea 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -420,6 +420,14 @@ static const struct dmi_system_id s2idle_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "ASUS TUF Gaming A17"), }, }, + { + /* ASUS ROG Zephyrus G14 (2022) */ + .callback = lps0_prefer_microsoft, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "ROG Zephyrus G14 GA402"), + }, + }, {} }; From patchwork Mon Sep 12 17:24:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 605021 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 132ABECAAD5 for ; Mon, 12 Sep 2022 17:24:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230129AbiILRY2 (ORCPT ); Mon, 12 Sep 2022 13:24:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230141AbiILRYJ (ORCPT ); Mon, 12 Sep 2022 13:24:09 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2045.outbound.protection.outlook.com [40.107.212.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29BE13F329; Mon, 12 Sep 2022 10:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LqxDMugQyj/V4EgeKyX6Hb/vEfj1G7zhN2L0ZTzQAfrBy69YXsGoWtUK/CONg/IXMADz+rnPm5rHEvNZ/b0n/sL2yH5f3LdBmqqqv1eiCmUJfCbYBjl7UDh/cJn3lKkA5Yokmut+10TgX4S3I2fBxWCDNGjVrFzCUS0NuIYbmH+WkhibuzJ21X/cokr/YQEf7qu7s+vPbz6kGU/MseTRd01u+VFO72+8ylupYc+LlpCxVI3B3KQUu4drhuVhBmljoMQGfeXIU17O3BG/CwntK0pB4FKmLwUQzLVJGfonHPHEryYCvsKZXOXw+U9EqpfzrHNupx6qQQW8zDVLTY4TMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rpKlc3bKgAX+Jo59M23L+qgxh8VVLDmY64Q2XIhNDMI=; b=GY5e/K+RaCDcxwBSVnRacbxZxrvD94WsMA/T4oh0BCwCDuQHhvaZIGzH3dl8cnBtuJ2o+ZJ145TclghRUXSNq/bCa5Mc3oCNidH2/ekIsTT20wg0GAvd+g9qlj3YiVVtf0Of8c6mMP23ll9vpcOIaEoQpmkd9rbyAhw7RSWqY7A2UI+BXl7zHKiSo+iSyGXxA8ZjM56kJv186x/PP9/yQyKG1AyUw9YWu3dm8qR4iO+WK45lsvVQQSbbgMFB0UXmiWDbn2xOTZtYTis/8NBlSvqdjjnGAcLOsXR6yQrqLTNQIyVdWul8T8/cn96dO7trvC7ibuz4gEO4+3VjSprMPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rpKlc3bKgAX+Jo59M23L+qgxh8VVLDmY64Q2XIhNDMI=; b=TCx8QDz3zB89ZDJNVjkBxXiEpAiFxYLAM5bA6vacG/m5oOGTvin7zmiUDqyd0iq4JbXbRfizcqKforgx/X7ilX0T3yBhKDAW5BdBxIQDxryzF+zAXJcAvYo1v6LNED6NkuhF9yPb6lHnvzjTlm1JI0ruKXwlqFQCBc2sJp5KP74= Received: from BN8PR04CA0027.namprd04.prod.outlook.com (2603:10b6:408:70::40) by SJ0PR12MB5673.namprd12.prod.outlook.com (2603:10b6:a03:42b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Mon, 12 Sep 2022 17:24:05 +0000 Received: from BN8NAM11FT115.eop-nam11.prod.protection.outlook.com (2603:10b6:408:70:cafe::21) by BN8PR04CA0027.outlook.office365.com (2603:10b6:408:70::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14 via Frontend Transport; Mon, 12 Sep 2022 17:24:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT115.mail.protection.outlook.com (10.13.177.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Mon, 12 Sep 2022 17:24:05 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 12 Sep 2022 12:24:02 -0500 From: Mario Limonciello To: , CC: , , , , Mario Limonciello , Len Brown , Subject: [PATCH v2 6/6] acpi/x86: s2idle: Add a quirk for Lenovo Slim 7 Pro 14ARH7 Date: Mon, 12 Sep 2022 12:24:00 -0500 Message-ID: <20220912172401.22301-7-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220912172401.22301-1-mario.limonciello@amd.com> References: <20220912172401.22301-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT115:EE_|SJ0PR12MB5673:EE_ X-MS-Office365-Filtering-Correlation-Id: cbc9bfb3-9ce9-42dc-2c2f-08da94e397c3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ntZML20Nro5AZnt/GsIQ8FkSpYSNCalpIhExzQhLcNcRMePcgPWmi5eIN+dl8QThvyknUKsuVlGNG3QkpMXhI3yX76vG33gJj7sfCSCsR11JoQYimz9IJy7q5zPKUaGpwIRyQ/aRPVoYjnbF6fmZEypLLcI5NspxfF6IdMHPqQMruDq+I4Xe9bLheZ7o/x4tNM97qpvMey0UOi14z6lHGJ/LR3SSk5zy3/pZl83aTCBRpBMssVhVVk7M6gi4Q6Sckvlh8JjEjTyS+aHenVxh8dZTHl3nHMk1xIUCnXDWjlE3TDouUlV9OegzSJf/aAl0tjNFNoDKkjDa8fsZRsjrUnHjzdGQqdk25KkUHQtHvPpx8BjM+tVFdYkvs2ZfnVCvQtlqqNBlLo77BwUJdfnyJPszoou/uNqTj0ClixnrdrF0NVeGFz3CkUw/uXFFDP80PgTxz4nEL091+zQtUAMihZwdgckwb6DbeewdYyDimDWZDkYamItN3Ye83KMKSzmgo/jR030nTwPUetcBArBECDySYTcFo51xLYwClTeqVxqW5oXC63mK7C0dcA6faU8DUyprcWfTJ66kcCumMFRW8wwwqQdTPFLuzbz+SIkMcPnN3GPD+mMf76vD5rThJMivwnnhhWUhO6tMqrR5moB27JLRa4UC/FkzVHrI8JlGTgwFim4qoeLNnyYt6yeFUU+HhSxE6TmufZVsbyMrCtuavHfAwJom1h2WtNJlI3qLzb1yhs9+CN8FOOGstGeA0N7x1cQQBWt2i7ETg0Snacrl+ugtHsOz37sJSCNzrgLFsiVH+QNYZrMbEijh5urqm/oRiywm4cSW20mBvV3ERMoPxA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(346002)(136003)(376002)(396003)(451199015)(40470700004)(36840700001)(46966006)(8936002)(5660300002)(426003)(356005)(70206006)(40460700003)(36756003)(4326008)(16526019)(7696005)(82310400005)(82740400003)(478600001)(186003)(1076003)(47076005)(36860700001)(81166007)(2906002)(45080400002)(26005)(86362001)(110136005)(316002)(8676002)(2616005)(54906003)(44832011)(966005)(70586007)(40480700001)(41300700001)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2022 17:24:05.0359 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbc9bfb3-9ce9-42dc-2c2f-08da94e397c3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT115.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5673 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Lenovo Slim 7 Pro 14ARH7 has a sporadically non-functional keyboard when resuming from s2idle. This is caused by some missing calls to the EC that don't occur in the AMD codepath but only in the Microsoft codepath. Add the system to the quirk list to force Microsoft codepath. Reported-by: Travis Glenn Hansen Link: https://bugzilla.kernel.org/show_bug.cgi?id=216473 Signed-off-by: Mario Limonciello --- v1->v2: * New patch --- drivers/acpi/x86/s2idle.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index 4bdc7133d2ea..8475a3915812 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -428,6 +428,17 @@ static const struct dmi_system_id s2idle_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "ROG Zephyrus G14 GA402"), }, }, + { + /* + * Lenovo Slim 7 Pro X 14ARH7 + * https://bugzilla.kernel.org/show_bug.cgi?id=216473 + */ + .callback = lps0_prefer_microsoft, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82V2"), + }, + }, {} };