From patchwork Wed Mar 17 14:38:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 12146079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A93ACC433E0 for ; Wed, 17 Mar 2021 14:39:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E18F64F26 for ; Wed, 17 Mar 2021 14:39:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232069AbhCQOjV (ORCPT ); Wed, 17 Mar 2021 10:39:21 -0400 Received: from mail-bn8nam11on2079.outbound.protection.outlook.com ([40.107.236.79]:59457 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232151AbhCQOjC (ORCPT ); Wed, 17 Mar 2021 10:39:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fVDxt5F88QSzSmK5lG3Fycl4n549do1fBDQ2874sWu+suROSy+etncU1nLJUIzKXKx+BXbS16QTugibzXBBfUhdBzz7ZumrxTVLHHh2omdA13GPyt9QJFvDkyC74rCcYEfiLHl/Yw4SwM+WctNVrjTXKf1aA9ngdpPyKILTKlICTxHQkN70iA7V1fTGPuXeAJJualEzm02a5TSW+G7FHBzhsi5uo6L1R+t+AoiaeGVost6TS3TV7+VYN8sp9m5HDXJdPnqoR03DJ/DegyBC9YzLeLlxJtQMm+FZay/60FFN74Jy5zO3TenWwjTUI2JG7lLW7iJwPYcZFxPgzJwKl6w== 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-SenderADCheck; bh=NGtzko4HOIwk5a4eO6NuXL071uckrB7N6Q8tKBWOqKM=; b=NqUhWDsh2LMQFt5AJogqjXrMoyMwe774ZfGXYZL4Q5zPZli3z/YHVgBc9XYSbtnr6Pvk8qJgIwcghCtplNpoMIGAU091tCDMmetRNlaF15flqu9C974oKDZscIMVnDCjn06dpGLGa5Ho7gNdn6P7qdPZVgnymaJSkChdYZ5vpxKnfgwb6RgbovEgD2ejcan65Wq8+aYeZApSOv5HiDXkgDAFVUGNKF2djrwl2KRvgE0Td7MGuC9H8CRX3RpJqnD4mU1EkYNmCzUnafkJPM0J7yaORM9tT+BM7plI/YXijKItY6HhsfBTLLY4u+PVKJDiJT+xOlgsgMmWM+OK9k93Yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=NGtzko4HOIwk5a4eO6NuXL071uckrB7N6Q8tKBWOqKM=; b=MsWM+vi+r3Y6np+udkaYH5ZR+ooL7C3V27RUA/Hab/E4lPp6urk8fhcHJKr7YYkduHsIHKjALq8aNFQoZIiMCX/dM0NKIQxmVB3WcA2G2zx5Qri8zSuv++PDoHQ7obAXnxkW7EMEQd0E67us/h87Ohddj18awHNKkJ9rPvhzq4Q= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from MN2PR12MB4488.namprd12.prod.outlook.com (2603:10b6:208:24e::19) by MN2PR12MB4423.namprd12.prod.outlook.com (2603:10b6:208:24f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Wed, 17 Mar 2021 14:39:00 +0000 Received: from MN2PR12MB4488.namprd12.prod.outlook.com ([fe80::5deb:dba7:1bd4:f39c]) by MN2PR12MB4488.namprd12.prod.outlook.com ([fe80::5deb:dba7:1bd4:f39c%5]) with mapi id 15.20.3933.032; Wed, 17 Mar 2021 14:39:00 +0000 From: Alex Deucher To: amd-gfx@lists.freedesktop.org, linux-acpi@vger.kernel.org, rjw@rjwysocki.net, lenb@kernel.org Cc: hdegoede@redhat.com, Prike.Liang@amd.com, Shyam-sundar.S-k@amd.com, Alex Deucher , Marcin Bachry Subject: [PATCH 1/2] platform/x86: Add missing LPS0 functions for AMD Date: Wed, 17 Mar 2021 10:38:41 -0400 Message-Id: <20210317143842.786380-1-alexander.deucher@amd.com> X-Mailer: git-send-email 2.30.2 X-Originating-IP: [192.161.79.247] X-ClientProxiedBy: MN2PR13CA0023.namprd13.prod.outlook.com (2603:10b6:208:160::36) To MN2PR12MB4488.namprd12.prod.outlook.com (2603:10b6:208:24e::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (192.161.79.247) by MN2PR13CA0023.namprd13.prod.outlook.com (2603:10b6:208:160::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.11 via Frontend Transport; Wed, 17 Mar 2021 14:38:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 64c4e4cb-ff92-49df-fb1b-08d8e9526750 X-MS-TrafficTypeDiagnostic: MN2PR12MB4423: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fs6orAmSjN/zT0I6qjYGnDYDTXgtlRtZqcSXvuuuOWI/QFrpcfiPwLqtKCErZ391u8YnS1ajDYq88tXkDlngZeH01mxIY7CEJGtmYlXs4Lql/xRuHqCn4Pu0zhRPgFiF4UpSNf+Gz3IA0UTuiZ9735euKgTsTPPolDEFZOxk+Good4OLgWY1VsVpZG1NPMbEQgWD3k+bGCfFfIjbZu1ZOqaBQz7uReH6bXq9/2H+XFDDr4RiN4ZEgORaXqrXtnKW7SeMysWa5wNdhNJPqokxQ+GtsHZPIILj7eMRKL0YYyGv3daGgsIUYlpfBq0Y/d6lXUxKKQnDUQzAelFCRHCzzrf14VA76OlFZcPCo2h2AkwqWOfsioj31RBFeGh2kNt/Z6M0f5vIaEF5xT3F0GXm1KcKPBs9AXdvjZBSqVgrHT8+/O4oGXlgYYff27GYo4Qazp+JyuQaJrkVJst9eGI8XipUNgqi2V7glxQPWuFZSX2z4Or0Jch5P1EHZk5ru55HBwcb+ERqCeN9fLfewn1DJP0Ko9NgjbE25TdXMvrO7F+pEUeUZNuuo/T/pBQMteNBS35kdrCx7gCyWw2UUhwAwiSWPyJ1IVd+aB6Q1LS9TCVajbCznkjGtXTXJM/xf4rNf3UDWJZlHuB93SWVgG4HlQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB4488.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(346002)(39860400002)(366004)(376002)(396003)(16526019)(6666004)(6512007)(86362001)(8936002)(478600001)(966005)(186003)(956004)(83380400001)(2906002)(69590400012)(6506007)(66946007)(5660300002)(6486002)(36756003)(66476007)(4326008)(66556008)(8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eBSwpGPPo3svGxZsFJlJ6Hmh4y+iOpEu4/jtFd9LpYLbamt8CVq4eHQuNyMb/RNzKoarsQwnIJZCwpfH4THPTlVsI0YqbLrAco+klEnRAx+heWO/vgX55Rr6oL2+Mj7mHTQRpYoTShlQYX6aeWF2dvWoV9RcnLcMDC7pxv32iObRVIiAGXTlwqqW4SgicNKGqWudCt9L+ZMoRumf5o+iEbQWvdgXEfn1O3F3IrfbRhnBBQkgv6AlAVox9v5lGnm1/qr+CDvLqa7FedQAulADrkhVeX8QgwsmeifQGCApALexPv41xmR+ieNKbwjBsTvLHFRyHazYI1X5sfSpXHYEiIaboYx X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64c4e4cb-ff92-49df-fb1b-08d8e9526750 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4488.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2021 14:39:00.5305 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: H06n+PbxRQYcUh/qVRO7QnmxL7rWadG+jduCXWaYZVkmUbu1tIbWQQi8tUrHo7iEFVligYsPeokUHnqIWYN3TQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4423 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org These are supposedly not required for AMD platforms, but at least some HP laptops seem to require it to properly turn off the keyboard backlight. Based on a patch from Marcin Bachry . Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1230 Reviewed-by: Hans de Goede Signed-off-by: Alex Deucher Cc: Marcin Bachry --- drivers/acpi/x86/s2idle.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index 2b69536cdccb..2d7ddb8a8cb6 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -42,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = { /* AMD */ #define ACPI_LPS0_DSM_UUID_AMD "e3f32452-febc-43ce-9039-932122d37721" +#define ACPI_LPS0_ENTRY_AMD 2 +#define ACPI_LPS0_EXIT_AMD 3 #define ACPI_LPS0_SCREEN_OFF_AMD 4 #define ACPI_LPS0_SCREEN_ON_AMD 5 @@ -408,6 +410,7 @@ int acpi_s2idle_prepare_late(void) if (acpi_s2idle_vendor_amd()) { acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF_AMD); + acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY_AMD); } else { acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF); acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY); @@ -422,6 +425,7 @@ void acpi_s2idle_restore_early(void) return; if (acpi_s2idle_vendor_amd()) { + acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT_AMD); acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD); } else { acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT); From patchwork Wed Mar 17 14:38:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 12146081 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5926CC433E6 for ; Wed, 17 Mar 2021 14:39:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 15DF164F73 for ; Wed, 17 Mar 2021 14:39:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232097AbhCQOjW (ORCPT ); Wed, 17 Mar 2021 10:39:22 -0400 Received: from mail-bn8nam11on2079.outbound.protection.outlook.com ([40.107.236.79]:59457 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232171AbhCQOjE (ORCPT ); Wed, 17 Mar 2021 10:39:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jEGs2ATiqojVH/bFfCfAUQVGAVtzWSm48xZUzICavSpBrIGfu6gDcJagu8YGwTINcpcl7a9+9Uvh9Bd9AYz2Z2/vYAQpTTJd55UEP0zIT18jyAdlnzKyoyF/C5ItI1BadqK0n7wd6FsDP8ZVDhstGqucyZ690syupIVTRG02qxWKxArSH88j3uGE16+m9/W2npk+ZduYW+Ser3eEe3z5uMVK3BLcqnkPH2kXnxsZlNutgnhQZaWAgYoPSIkD5U2O6B7YynIqESXPQePZ8iWU58fxPO94lqhfUv310x5rSQwcz72qLAp9hiVqXf2dPAojRBCNVFYi+5PiCdGqeOcyZg== 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-SenderADCheck; bh=lVEWKR4pJ6PrNPeMKH8XS0LPqUmM65wiEvRRSSkt2xo=; b=e95A2pK5z/ZIeFuPTPdHq3tVB/yx+iqY0P9fcC9NGE03mMajuRxops+rSczyQalGuptiHQOamDZE9b7V/A4KRbzwvnLKKItE8znZisMCYVurlMvO4qETU4XYbcE/4QYo5uWOV5izzhaK9mH4dLCdtMEldXvqgDAvudCifNaoYqvhcXwXaa03tpx2TqxG3NIY6EK8KM9+P8c6zrP+9Hi+GELY/PX1qjIJo9Wv2kB2sseIA7ZwSCz+19HBmfDmoSuI7HEZdakZafKdTikzugkv2nHgFcrtgC50XR2SqiErbWgqspL6cBicyYlblyN/8cQQPW/H5BRfSoWBNb6W0Rh0cQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=lVEWKR4pJ6PrNPeMKH8XS0LPqUmM65wiEvRRSSkt2xo=; b=AHANGBt+sSzjFn2Ykx2TOUg3Zkpei3AYYSQnx+vMyv75ks0N7+DRUE/ZTP61bPW7FIrgstMOPVcwyjjlVK7v6LyrX8+x1Mq8ptATo3pHfaePjBETPpcTglO8/HAri7/EuALFbQ7AKf0I4HO6EVnoLvAnIdlI2IBCvJNqL3v4lsQ= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from MN2PR12MB4488.namprd12.prod.outlook.com (2603:10b6:208:24e::19) by MN2PR12MB4423.namprd12.prod.outlook.com (2603:10b6:208:24f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Wed, 17 Mar 2021 14:39:01 +0000 Received: from MN2PR12MB4488.namprd12.prod.outlook.com ([fe80::5deb:dba7:1bd4:f39c]) by MN2PR12MB4488.namprd12.prod.outlook.com ([fe80::5deb:dba7:1bd4:f39c%5]) with mapi id 15.20.3933.032; Wed, 17 Mar 2021 14:39:01 +0000 From: Alex Deucher To: amd-gfx@lists.freedesktop.org, linux-acpi@vger.kernel.org, rjw@rjwysocki.net, lenb@kernel.org Cc: hdegoede@redhat.com, Prike.Liang@amd.com, Shyam-sundar.S-k@amd.com, Alex Deucher , Marcin Bachry Subject: [PATCH 2/2 V2] platform/x86: force LPS0 functions for AMD Date: Wed, 17 Mar 2021 10:38:42 -0400 Message-Id: <20210317143842.786380-2-alexander.deucher@amd.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210317143842.786380-1-alexander.deucher@amd.com> References: <20210317143842.786380-1-alexander.deucher@amd.com> X-Originating-IP: [192.161.79.247] X-ClientProxiedBy: MN2PR13CA0023.namprd13.prod.outlook.com (2603:10b6:208:160::36) To MN2PR12MB4488.namprd12.prod.outlook.com (2603:10b6:208:24e::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (192.161.79.247) by MN2PR13CA0023.namprd13.prod.outlook.com (2603:10b6:208:160::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.11 via Frontend Transport; Wed, 17 Mar 2021 14:39:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2a4adc4f-fb7b-4946-5f9a-08d8e95267fa X-MS-TrafficTypeDiagnostic: MN2PR12MB4423: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qB4OMO2up7gvXKvdWfZr2MnxkvZ3X2z2MGdLe+W/UlsBsmmkpe2ibcMoHBXlPkGENHoJmXUN7YxeD/KMQUevDwFjTB7XPpaCFsNOyLe3yDm8bxt05kzSypzx0X73yPw16PwORiRK2bMneiSmvx64fkHYZdrQ1hmubbYhx3hYz54pvA+B1fdQkwvMQji0QIk7zjL3AVS6rvGGlmKDQS+cnGLOKopOT59Ti5brlj3dAKKftYhnti6xjZi2U6zMeaAAg6xOwrZtzpKRdGHsEnX/sermAV59e3OGFmSmo6hukXzTjjNiZoCW84YxGB/407o/T83/KoFq2y6m3yFll6vlQha+ARQf60k+0ZXNaWJqb7W48Zd9N7flNODhY8dGEUVKB5uHo8ZxyUOrk+pBy5kYxUDV27Tb8Vc4OIcNARNA1ADRAEvrNmneSdJ8XafgazyNTA8HRRMdYh0xkR/1w20sv2FCCRmlEUgmwOKv+lIyiyrWXS//5NgRd0o/QdlNKunnNFgfJvachrTJmsLoVLq4VVl8EpFl8vlg5kT18JcmCzgq5rfm8SH5M8ThSBVOwhwb+VHGfFM0T8VB2UoLe2F6A7Jjm7kw/UtAyz77CIa80012Hs6AsCJlaCVLfHRsIEiYXwPwMSjymqWqjpw9Ppx22VyXr1f7QVH3diyAHHAeRLs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB4488.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(346002)(39860400002)(366004)(376002)(396003)(16526019)(6666004)(6512007)(86362001)(8936002)(478600001)(966005)(186003)(956004)(2906002)(69590400012)(6506007)(66946007)(5660300002)(6486002)(36756003)(66476007)(4326008)(66556008)(8676002)(54906003)(1076003)(316002)(26005)(2616005)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: z9HTFVlWEMxrKbB0yhfSk2Ird8UtXcmVoewaxaNdbI7OoGtJuo1wUCmYYNMx+LPmEJDNKETgsWFupjff6L56csBzC2eZuQygyELxB15m7hTRjr/vZk0PA4dCbkXuMyq18TJVMdJuYBElUz8T/8j3tvngukhPGAT5/E185zl9Z7dcuPLxXpqVg59AXIUD1mTV+UbaxW6TYw5IRtA1p7E4P8aZ8RvaLY7sdtXyFiiG5mHtZpUmRi3RFFW+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5wk94tAiGsHQJrnNflyacL2+VG8F31z X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a4adc4f-fb7b-4946-5f9a-08d8e95267fa X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4488.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2021 14:39:01.5808 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TOB9gD4/F+0m+Njdj0okpuEi5r6uEo6PakrHBbnmvFfaqb84tqCE98yGiCwAF0pSEIoyDEgblV4jBSJNIz/UYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4423 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org ACPI_LPS0_ENTRY_AMD/ACPI_LPS0_EXIT_AMD are supposedly not required for AMD platforms, and on some platforms they are not even listed in the function mask but at least some HP laptops seem to require it to properly support s0ix. Based on a patch from Marcin Bachry . Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1230 Signed-off-by: Alex Deucher Cc: Marcin Bachry Reviewed-by: Hans de Goede --- V2: rework the patch to just fix up the specific problematic case by setting the function flags that are missing. drivers/acpi/x86/s2idle.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c index 2d7ddb8a8cb6..482e6b23b21a 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -368,6 +368,13 @@ static int lps0_device_attach(struct acpi_device *adev, ACPI_FREE(out_obj); + /* + * Some HP laptops require ACPI_LPS0_ENTRY_AMD/ACPI_LPS0_EXIT_AMD for proper + * S0ix, but don't set the function mask correctly. Fix that up here. + */ + if (acpi_s2idle_vendor_amd()) + lps0_dsm_func_mask |= (1 << ACPI_LPS0_ENTRY_AMD) | (1 << ACPI_LPS0_EXIT_AMD); + acpi_handle_debug(adev->handle, "_DSM function mask: 0x%x\n", lps0_dsm_func_mask);