From patchwork Fri Jul 1 02:33:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 586474 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 4A67CCCA480 for ; Fri, 1 Jul 2022 02:33:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233527AbiGACdd (ORCPT ); Thu, 30 Jun 2022 22:33:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232774AbiGACdc (ORCPT ); Thu, 30 Jun 2022 22:33:32 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2071.outbound.protection.outlook.com [40.107.95.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C57583703B; Thu, 30 Jun 2022 19:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QuBWGnPhYLuDZYvWwskGpaxe+95Sok/GpyKzYmYnBRWLhnls4EnETGnL+i6+9W8wyv/OZa5JYdqksRAMdbkSaSlKBj5qcUJmM98nM8dXli94YYpwG98TuxdgQJtweZ7tmy+yGGMVGb2ZhxrdJgtXfjQz/3MOIKj+59uUb9ZvwboJayRzlyBc7tYGKbu/PKHedE9ragsPY86Zh98eECrruWl/jXqOoQMSDQA2AFIwxw818klw6dP+QQOnI+/CxJFMSNSaAnsIx0yKy2DXeXzILivx/bjPgC/NGVe7NIanmkZO7+GhSBgZRhHnjU7XQnIpwlfOLtG7r7iP7A2oNLAPmg== 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=M4OYHeLBiGCTdHytHu79OW+y55R0NXOUkWnfnEDMBeo=; b=mI9CKUX46Cs9wgnzdUnSsSNyjVbQloCN6crIPOpqEbBDgFoZfAzwqsn8zNReqejl7TEL/BzXinecFtk8anDEZoxBHZoA050fJH0Hi+m5RK+MTfOr5i5veQIt5+qRFx/QyC6Vm2uebLvIH4EyzF43TLg188/cqZxmUFKDvNsV+aTO8ywIcYRR3YiwwqakXR/pkVOnXTw/MgtGNVVVq7kqUZCxXE09JB++5I5gOY7gr158Zyhs2tmP6E3kSQP5GywSPyGUKmG2u7wnj3h8NXufaqoxJVlrQFn4eR5OGXvvGR75MEDR8CZ9eiBplt7dG6FMxvgWBvyYFwuxJZb5rxsBag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.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=M4OYHeLBiGCTdHytHu79OW+y55R0NXOUkWnfnEDMBeo=; b=y0WIO5/2tDcR9vpn4Fc+0ujzkr2TR0QwLVtGDEZopR94I4Ybq4dfQaJdExgKFP8mlDzhx/7edfck42gI38TFx9TY1CejLrsziaG51DT868c9k4n+fy7KTBSZiD2dHRQbedEHki6x4/oWrGvDQlfX6s83rpYO74uduwGoZO5atPg= Received: from BN9PR03CA0964.namprd03.prod.outlook.com (2603:10b6:408:109::9) by CY5PR12MB6299.namprd12.prod.outlook.com (2603:10b6:930:20::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Fri, 1 Jul 2022 02:33:30 +0000 Received: from BN8NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:408:109:cafe::b3) by BN9PR03CA0964.outlook.office365.com (2603:10b6:408:109::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14 via Frontend Transport; Fri, 1 Jul 2022 02:33:30 +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 BN8NAM11FT020.mail.protection.outlook.com (10.13.176.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5395.14 via Frontend Transport; Fri, 1 Jul 2022 02:33:29 +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; Thu, 30 Jun 2022 21:33:28 -0500 From: Mario Limonciello To: , CC: , "Rafael J. Wysocki" , "Len Brown" , Subject: [PATCH v3 02/10] ACPI / x86: Use new `pm_suspend_preferred_s2idle` Date: Thu, 30 Jun 2022 21:33:20 -0500 Message-ID: <20220701023328.2783-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220701023328.2783-1-mario.limonciello@amd.com> References: <20220701023328.2783-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-Office365-Filtering-Correlation-Id: f2a4537d-5b43-42dd-d5ef-08da5b0a15ce X-MS-TrafficTypeDiagnostic: CY5PR12MB6299:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oxuJ08nGb30ahGIW0KkuLrMeUySnLQ2fEx0GXTRBdnaNorfum03mA6dtrutWbSiYZffqQ2SHmuq/mCtn2rjdb7iqhGVU47OXJwcMKkJlA30YCiBGsPd3gSmyHjvXBZ1PYjrUbVV7KRiHEs7jt/597GA+jp8Ex/rawMrINhLrzEZh2RJIn8UbzJbwLQlu9QHMFfPBoaKes2RQy44wqJIM10eYtjLH3yCy5UVLwmb98mgFGegw9Imuk2YHInBfqr5Aeb2vgqkn72PZjM9LsuUmoLBKSirHGypkiExK0bTAejSA0TUITdpOEeGSlVERtPb6VivqK+eQZgWgFaYDDA/Pn2axV3wAteNtbcJMmSLK+6N9JNV3Nrh0CN8fNkWmlaMWnyvNr8iMM1aUN3u+xCPngn+grNwjtNQnV/TvuEkisH+22meb9uaj18KMv2KjvDAEcRHNqxjDCVyYMOHZeLn5dYaF38bHmf7GAMKpXDhzMDx4fB2s7D4GCWhvu6d8q2LbpeApLl3jXPo64gmRglEGzYG3XFJXwIelNSAyDi3JxdhifO8wTOYygZv2EdRz36u6JCDaYVRjVPbA7jM9Jpd+ISm8mNfj4iE+SmxlMKTUljehZOwBX0RvYnx03y9iBijMKgILNuR2YAFgM3R3cNskxI6gOblCTkTzjFqUWjLdsZGhufh5Fx10JyYKElkXwfimKgyhPVgGVwSpSIM61YglzVGNmUwGcJ7A7Er4JybBizF4qcWbYvGq/mydUj0PGDJZvcJREO07hDiDJxPeOlR3j+lMCaXyBqkGvBLufDBqx0cg0o/tg2NQI4SL0OazBDgUAm8orAPXPILD1IzhtD0Jq7LvMuZs/drpvN7S698QsnoPubzrF3ymF9e0vLNyWSP9 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:(13230016)(4636009)(346002)(136003)(396003)(376002)(39860400002)(36840700001)(40470700004)(46966006)(1076003)(478600001)(2906002)(8676002)(7696005)(26005)(316002)(54906003)(110136005)(36756003)(8936002)(4744005)(86362001)(5660300002)(44832011)(2616005)(70206006)(4326008)(70586007)(40460700003)(83380400001)(81166007)(186003)(16526019)(336012)(426003)(47076005)(82310400005)(6666004)(41300700001)(356005)(40480700001)(82740400003)(36860700001)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2022 02:33:29.9242 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2a4537d-5b43-42dd-d5ef-08da5b0a15ce 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: BN8NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6299 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Drop the direct check from the FADT and use the helper instead. Signed-off-by: Mario Limonciello --- 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 2963229062f8..b1483d5092c1 100644 --- a/drivers/acpi/x86/s2idle.c +++ b/drivers/acpi/x86/s2idle.c @@ -369,7 +369,7 @@ static int lps0_device_attach(struct acpi_device *adev, if (lps0_device_handle) return 0; - if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) + if (!pm_suspend_preferred_s2idle()) return 0; if (acpi_s2idle_vendor_amd()) { From patchwork Fri Jul 1 02:33:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 586473 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 02DA5CCA482 for ; Fri, 1 Jul 2022 02:33:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233550AbiGACdl (ORCPT ); Thu, 30 Jun 2022 22:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232774AbiGACdh (ORCPT ); Thu, 30 Jun 2022 22:33:37 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2046.outbound.protection.outlook.com [40.107.243.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D38231915; Thu, 30 Jun 2022 19:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VubtvMxUNDW9B5SOG96p21t1SSlDXUIJ0oNklUI6rUuZYMoAz+NQ0PILk4Gcy8msnw70NHWwpidFZhMggvofHtoF9bZxrXKzUoCulO7OnvmA74LmhWzdIy+HTtgKyDIsYqsjjW2gBOEAtmNoZzA8OK/5Qy9P3GY9Cq5yipA0LU0lj6nr09IrxgvF5w739cKh9X+ikhIT4j6npa62cMsmK+g1ypZLrfOoyedq6jO5H+QV6HBiqDN3b+4hvZl/dmU91D1rSIVQrWspy1nJgD//v+VzfieisJCGxTGB0pTsbJa/TEhih4DCIg1623vwugvwOF3sSxUGsyu/Al3ffnVhnA== 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=pQ2jCG+/BGFUJOgmgaScen+SAE8p6B0K9/Uu236103c=; b=bGScZTKZ1X/905OMRFtVBxpW08EWF0pJYeoQLllg/b3gEytVG+JVhwFqUNNuq1n+qCYIep2lk2E2xr3Ko3FKrP8iqT1CnypmVHJhth7o0oD57P1FB1fjQJ9rz1EvTXNoKQJjNhvh/jCPAkEWK9vyOpn+jnICZrmDEkLH/5RrZsYQkdTasDzS3hcZHJjMWJ+aEqa7KIIDGFDxPWBN9eYjzp19FjQRWdzoECD9KrnO9BbLfhK3amC0cl5tikZOTlgUQxduN6EQ7hBYPpOspR+VF9la6U44lMhrOBF1baoTsCDzHUWTPvgdK4RBr7f/rdvn+FiYbFsunGGPT5z8tDUQLQ== 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=pQ2jCG+/BGFUJOgmgaScen+SAE8p6B0K9/Uu236103c=; b=fzkNMna/Dkxn7kKTwedutf002ITjQotIIXTlILOxz4KMH9NUyZQ+PKuzThET1uybgYvh9ZT3G6At8XWQ6Z5KmQBLbp1oAeSI/rWgTEX81EibIyRajbEmHEcJjilPmqtQVC+AzKNhF+rLhPtaGyp1P59PP+hecZRAMFYPJZkt8mQ= Received: from BN9PR03CA0963.namprd03.prod.outlook.com (2603:10b6:408:109::8) by DM4PR12MB6638.namprd12.prod.outlook.com (2603:10b6:8:b5::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Fri, 1 Jul 2022 02:33:30 +0000 Received: from BN8NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:408:109:cafe::b1) by BN9PR03CA0963.outlook.office365.com (2603:10b6:408:109::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14 via Frontend Transport; Fri, 1 Jul 2022 02:33:30 +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 BN8NAM11FT020.mail.protection.outlook.com (10.13.176.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5395.14 via Frontend Transport; Fri, 1 Jul 2022 02:33:30 +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; Thu, 30 Jun 2022 21:33:29 -0500 From: Mario Limonciello To: , "Rafael J. Wysocki" , "Len Brown" CC: , , Subject: [PATCH v3 03/10] ACPI: LPIT: Use new `pm_suspend_preferred_s2idle` Date: Thu, 30 Jun 2022 21:33:21 -0500 Message-ID: <20220701023328.2783-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220701023328.2783-1-mario.limonciello@amd.com> References: <20220701023328.2783-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-Office365-Filtering-Correlation-Id: 31dccc51-a4b2-4a59-32f0-08da5b0a162e X-MS-TrafficTypeDiagnostic: DM4PR12MB6638:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IDxk2yuwL7PsxVLJL+cnLOpa91cPfiSD4M4+o4+3CxfDqipmkOGew2BydYgCZ2WoHRAp2RXNXQfiFWMnZe2/MQ4m+h1CYby7ez5mCD6UejKC/5qk2CFtOysM4+v+JQjYvu5E6OVhrtmxIVcwTcQIcDYbjjW0KbKLAUYh4ypb0t8gSTghDsL3qbQdrV7q4TcykMEpvazhEbkc/ySoKdHwQZgkOaYhzTG2lcfHqajq0/YRK/052DA8O6+3fAmibpwK6Y8Vaba7itR+5peZeFXhbvUD9mU2TCtKTGLfcArZQT+vMwu9GA4/P7fEiCkd1r3UK+a/TYNtUJXuwepUehv4EWeUJav6p0l7nO/00djLb36cVPzRH4LvUMEHjC/8wou3qbjgGSI9xqMcFloHlUxQIfS+vuyiJiwmF2VBYUXRxOc/OBhA1RYR4CO1VqNxsHLX6xkWZcSiaARDAnTySALkmopx/fdDQKl94/nG4KrRXsf3DqK6I86zb03F26fdMXFtvYAd2HdFywUtHRtyVvCMk1+5I9AiHuAqzAyEZgFCk0aDj42yWYcLfY6GDbrD8+6WbaiaR42q+XeNlYwgVLmHVDM0CcbAo+NjeQvTT2e15P6VL7x8GC7KSoLRb4zEx9GB/Vad5SJObVo/Sa5chelNBaayJ2c7tBfCg73aGenHhjtlBzDxUTI/rOIGe9iC5bVstvOkP0ZVNkOqrpcEzVeSjrGbL9GsOjZIACaxcIMDlpWdGyqEAgM9w6yZNX7w5kATGtz3Vy0YP4G8Czq28mzTnPANKHgDmiFiEiaemUU0yJwN4r4MpZmnTNfOaAG4JMcL24HmznaSlYj6VgzQ9LuWixADRPD8RBT8qzOJtuNZuHsMR8qbuBbkum9nU424ka28 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:(13230016)(4636009)(136003)(346002)(376002)(396003)(39860400002)(40470700004)(36840700001)(46966006)(36756003)(110136005)(54906003)(316002)(2616005)(26005)(86362001)(82310400005)(7696005)(1076003)(82740400003)(356005)(186003)(16526019)(81166007)(4326008)(70206006)(8676002)(70586007)(478600001)(8936002)(44832011)(426003)(47076005)(336012)(36860700001)(40480700001)(2906002)(41300700001)(83380400001)(5660300002)(40460700003)(6666004)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2022 02:33:30.5648 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31dccc51-a4b2-4a59-32f0-08da5b0a162e 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: BN8NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6638 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Drop the direct check from the FADT and use the helper instead. Signed-off-by: Mario Limonciello --- drivers/acpi/acpi_lpit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c index 48e5059d67ca..31c49107c579 100644 --- a/drivers/acpi/acpi_lpit.c +++ b/drivers/acpi/acpi_lpit.c @@ -6,6 +6,7 @@ * Copyright (C) 2017 Intel Corporation. All rights reserved. */ +#include #include #include #include @@ -109,7 +110,7 @@ static void lpit_update_residency(struct lpit_residency_info *info, if (!info->iomem_addr) return; - if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) + if (!pm_suspend_preferred_s2idle()) return; /* Silently fail, if cpuidle attribute group is not present */ @@ -117,7 +118,7 @@ static void lpit_update_residency(struct lpit_residency_info *info, &dev_attr_low_power_idle_system_residency_us.attr, "cpuidle"); } else if (info->gaddr.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) { - if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) + if (!pm_suspend_preferred_s2idle()) return; /* Silently fail, if cpuidle attribute group is not present */ From patchwork Fri Jul 1 02:33:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 586472 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 AFD7FC43334 for ; Fri, 1 Jul 2022 02:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233665AbiGACdn (ORCPT ); Thu, 30 Jun 2022 22:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233597AbiGACdj (ORCPT ); Thu, 30 Jun 2022 22:33:39 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2078.outbound.protection.outlook.com [40.107.243.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ACDB59255; Thu, 30 Jun 2022 19:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KCV6hm0zral0haWM/Kvtwfhip3QJ1FixJWtYyfZBz8ymtzVzaDCAwDatcu2qmVX1TtEeD6l+5xDnpgmnDFUJnlq4wsBZ5ZzNTMk0Wzo9H9ejWUuckBzwH7DK7dLJgF7NJ7KXmg5VC3JHtkZWOHouwUdt9Z0NxYslTPfH3DSxKSoBlkwY4GckEXokdMUz3vIos9V1AmPaRdTVp7Mk3uyc2kTEhenPU3k5KvPFlhiVnTsmQDMwjuaQDWr6haFzmf7KSgraV+csOID2jYWmVWDBLS02O7lu1e4A9DP2S1wiZFOJ1FvhmNpu+krT7THD/sB6cyayZZioAG1j5OtK1gMV5g== 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=JwYHCWBiktNLSfc1XdxTouK9jP8FVFrHK5tjfdewSM4=; b=PtEB66j6tetoPRxVrf4ZPGrU7pqHJLpQLoiuvqo50c5ktrMoEazGBdE1OliMB5zZmBqAEQOQ5/XjapYz5YxiqonE6x2Eo0vjENnsFBMz1xfqeyLaEsAXz3flGVRa6ehxDsPqGxeebaAYndPDcAnzaqcBfc8oFzJl+EyQzspMArKOoZ81SSKbwp7P3llhNogNB249QimVZZxE5atSmPcmNhPFkeQsp+7+4x10wngCEMHAyyC72WhovU9+hdsjXsFFwXKnDJBziBg1G0gkJR9nlirT+abfK1Eo4QraHriL1HidR0mXS41hXnpxWFk+JkpeLjQMsylPEJj2RP1O4lKgKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=towertech.it 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=JwYHCWBiktNLSfc1XdxTouK9jP8FVFrHK5tjfdewSM4=; b=wMVmToo6t7AsF4VdrhBkdxFkqixY/2zUz7z/xpHT7qBgI791+JyfBrEXcMpf3k5+ji9maFqKxut9kAzeEUXGMoxPwy2ZdZ8aXNDvHZST8+4d1eE8hL7QjzO7YxS/pIif/oXUrGK6166NbmzepglviTgMN7m6uLHWLyMYfXkTzD4= Received: from BN9PR03CA0977.namprd03.prod.outlook.com (2603:10b6:408:109::22) by SJ0PR12MB5609.namprd12.prod.outlook.com (2603:10b6:a03:42c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Fri, 1 Jul 2022 02:33:32 +0000 Received: from BN8NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:408:109:cafe::d3) by BN9PR03CA0977.outlook.office365.com (2603:10b6:408:109::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15 via Frontend Transport; Fri, 1 Jul 2022 02:33:31 +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 BN8NAM11FT020.mail.protection.outlook.com (10.13.176.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5395.14 via Frontend Transport; Fri, 1 Jul 2022 02:33:31 +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; Thu, 30 Jun 2022 21:33:31 -0500 From: Mario Limonciello To: , Alessandro Zummo , Alexandre Belloni CC: , , Subject: [PATCH v3 05/10] rtc: cmos: Use `pm_suspend_preferred_s2idle` Date: Thu, 30 Jun 2022 21:33:23 -0500 Message-ID: <20220701023328.2783-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220701023328.2783-1-mario.limonciello@amd.com> References: <20220701023328.2783-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-Office365-Filtering-Correlation-Id: 4a1c4df6-6c7b-4c30-764a-08da5b0a16f6 X-MS-TrafficTypeDiagnostic: SJ0PR12MB5609:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8tU0E4EImF5CmLr9PvR/wkmpwxCfHEGXCeKien83o7AfmyUpxpo+hWGxehGLOqAsB/uOYqMo724jIW09A3WgY+KXFfrjPU75epnOnXhh7cNPiPGjC0sD9wRzAGHRgZJzW6y7d+U48dTdo+i7FDo8xR/wBlhKBWRAmMRhT/+18hJXSvG4rFpXNxsv6OOmlbih4tXhhVZqmA8eQp/Fz5vUIdpg0rq8VCfRzh2LgwH1kf6r5xZnx3fO9I+uFq6DRKarL/yODvgharwAsLcNfPxeahZfd/1Ke56MiKtMlPxiyFz/Puukmb94ROx+pZ/sJYcyZYWykkFCmD22fu8pjlwQWldm6HEoN63yjQZy499Xu4PTyRtEP1q1XGJ39SfsdV2OUGE9hOC1+wxETe+KsKr7yHPrOzB68xA+Cbr80Fju5zPaqIJXhLMwnBNdTLfoT35ohwNIUsFH0PvF0N7ufpexZAE6OYfDwq2ap3RNJHMirNBIt2X9vRSpTn3BxfCDga2iXTEjQfcluMjiOzKBBaK8lEUEVH8ZmrvRpPuNxkGRxz5N4pXyBJ8dtcANx6RnM1/hVY2HEYfKuzRBx5Un6Aa5UK6s8SBmx3xFRdgKam2hmacGhk1lDn3wt7Vg1no0VXyYLOezgXoio28Ox+O25l5GekVkpXGwfKwl8ACDz6WCOzteioUQg9qM/hPUC834M2uel2KN6ey3HrTnw3DFEMYbTp1/Fn71FeM/qN5oPD2HUaDcKWXxRDLJkPbup4+U89zutsc/BmChqNgu0rF5agp5v5f6446toPHcMOmqrzBeP7QLYchS++er5rhtn0Oo34/wduZ2jPJgCYlYxTn3SQv1yhmVSgt0XPRYuvZxNjYIiJiTqewq5BhzYpUReSwWvhxc 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:(13230016)(4636009)(376002)(346002)(39860400002)(396003)(136003)(40470700004)(36840700001)(46966006)(4744005)(81166007)(316002)(36756003)(2616005)(186003)(6666004)(47076005)(41300700001)(426003)(70206006)(54906003)(2906002)(70586007)(356005)(7696005)(336012)(82310400005)(36860700001)(478600001)(4326008)(26005)(44832011)(82740400003)(40480700001)(110136005)(83380400001)(5660300002)(8936002)(40460700003)(16526019)(1076003)(86362001)(8676002)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2022 02:33:31.8772 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a1c4df6-6c7b-4c30-764a-08da5b0a16f6 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: BN8NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5609 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Drop the direct check from the FADT and use the helper instead. Signed-off-by: Mario Limonciello --- drivers/rtc/rtc-cmos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 7c006c2b125f..2e3d35e87061 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -1260,7 +1261,7 @@ static void use_acpi_alarm_quirks(void) if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) return; - if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) + if (!pm_suspend_preferred_s2idle()) return; if (!is_hpet_enabled()) From patchwork Fri Jul 1 02:33:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 586471 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 9AB71C43334 for ; Fri, 1 Jul 2022 02:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233676AbiGACdr (ORCPT ); Thu, 30 Jun 2022 22:33:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233607AbiGACdl (ORCPT ); Thu, 30 Jun 2022 22:33:41 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2062.outbound.protection.outlook.com [40.107.93.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5232361D4C; Thu, 30 Jun 2022 19:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XJdWspBOCFMXM8ajZquGQxR1yNeIBjg+X7SMnkZXiyWf2pA/yRrw5/W/mbxdSZFgVRIZD9m3gGgLZ/VnzX7+kiPya2/X1l41J9N/IY+hyW6VdSFWdVDCD0OJ1DSVfwE44esEgRss9elirzJ1nT69HnpbzuDQ/9dfnoTR25GyO30+huiv6Sic+SgQvw03IjaWvjXSuI+5jhJVb3I99VWDOqmQeZAVSMGAj63SLrG+SO1LV8OkeWsuG9DppvLQDfy1HyLevy/wP1R2N5l/3QKSATG64nshZL2DScpPv25hUWKfcjcDig6huTQK0QeYBuE3geQEelKAIzBtpWHTfjnW9w== 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=UNgflNT87elPNP2tLJuLiglNSU86pfbDP+uIsZJeDdU=; b=mgZNw7lU75hyVDnQXVZHi+vfuwfAHyywyPdddDg61hWb6DyN/PAsyMTB6+hzzJikeFSiTCTGmfCSxXRzbr+Ou3oMh0b5fek16q6hjcyhIGx4G152VsLullfIjtxKNHizsB/E0lkgLzaoG6kyDjI/BhVd11yO4Sd1jvFA/gG2RBCEi3Ldn40qT7Q+ukbwCXl22Sijgh+O0hhQRtJFzTaYVsUFke3oRlOr+FtTRCrJgvqqSEBrBu68OZyhRD+GU7uSnAhgk/KmvUyZyo2v2W5bbGhncVkQWIcjyCAeH9P4jmUnXvf+MtEtDrIMR1J0uMgxPQ5FwWr1lYelkW/AL6hlOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.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=UNgflNT87elPNP2tLJuLiglNSU86pfbDP+uIsZJeDdU=; b=FFwQZ4IJhtBSwkMGPPdmcdIotGewTDyRIk2Jlfxqn5TID3+nbFVcBbSLRZFcCYRvTjduJSUTSwlGQZGLR04raaJsqGMphAexHyfS79zEjN20y8s15/aKn4OTRyvyZmOXW5b6SQx6EPbfw7sJqJM5LhylDMQIJWXEs53MCLp+cI0= Received: from BN9PR03CA0221.namprd03.prod.outlook.com (2603:10b6:408:f8::16) by MWHPR1201MB0159.namprd12.prod.outlook.com (2603:10b6:301:59::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Fri, 1 Jul 2022 02:33:35 +0000 Received: from BN8NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f8:cafe::ea) by BN9PR03CA0221.outlook.office365.com (2603:10b6:408:f8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14 via Frontend Transport; Fri, 1 Jul 2022 02:33:34 +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 BN8NAM11FT045.mail.protection.outlook.com (10.13.177.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5395.14 via Frontend Transport; Fri, 1 Jul 2022 02:33:34 +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; Thu, 30 Jun 2022 21:33:33 -0500 From: Mario Limonciello To: , CC: , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , , Subject: [PATCH v3 08/10] drm/amd: Use `pm_suspend_default_s2idle` Date: Thu, 30 Jun 2022 21:33:26 -0500 Message-ID: <20220701023328.2783-8-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220701023328.2783-1-mario.limonciello@amd.com> References: <20220701023328.2783-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-Office365-Filtering-Correlation-Id: c847054f-3af7-4e6f-bf66-08da5b0a18b9 X-MS-TrafficTypeDiagnostic: MWHPR1201MB0159:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KGHHIwBYWqQ+DFapNshVqmHhHJJ42BH0MlWPsJx5q0cpK17euGJCcRlKTYlbzYHA+DewuhxKvTPN9R1jf48s3dNsWAZi+FHYz2BLixaWK0kKDyU4dAcen6wIRVcxjrf7W7azFUcr4CqHExM1W7KPDqlgVxK/A5r8BcxL5mWoKqSdTKtY5xXdRX2ZQ9e+7nkxVPj/Xwoo8NbvP18YW2EcPAwwMUmTumL5RMivqFPeY62AGeTmJkbw7TKG12xypw8FEX/TzVKgIYYYy9rs3Jbb9zdLEU6LAXvrQ5WmhiG17v1ZujfH9QaQrBNsPsP+tmztumatrZnLk2SzdkkLHpl6rYtTwDjwnMRhLxecoF8PABQs6rkU9t9OLDAvS1fHRFP/q3RRPUvdTGuz4uPQic6n+Xv8b3EgnAs8nFTcexPM8XuMao9r2BR4o0dE49wwFsTsGh7qO7SFZ6njiIKNcv5Wx4zsQtH8O17sGP64kSzNfWxaasTN2acPmWLZkNBqY6McTaNI9wTsswCSbtY+hb43jjPioZGsNxIdUjiRmHB4aURHkTlzkhkJO3Jb9vMTd5gJ6xahGRJ5WnWL+OF2VEszw0SkYPlBKpbGiYgfyTt4Fg8hAdLqFAdd60V+WKZjjJKa5xW70u5I+4b322nVfQGcbyf7YVtvCmVkyBsTJ5ba4Mh2MB0AV6HTfKrXu2lA/oUKkE96/iCCRVSDxg6QYZBPcQU6Aiw4tOSrDuB3Kx+FOxvxhV27v+rnIShaOVvQF9B1fj0/RU6tkZAx/BatF7y+zvLPej0PVknNns7rxCWyIDPslyg3RtSe10moJ+ny3pQ3k8++whWfzqQUe0q7RmctIP6mz5eyE8Y8MwHNXVTgXSZNXoIyiRN3DJ7lfLESOPAL 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:(13230016)(4636009)(396003)(346002)(39860400002)(136003)(376002)(36840700001)(40470700004)(46966006)(70206006)(70586007)(36860700001)(8676002)(86362001)(186003)(7696005)(16526019)(44832011)(82740400003)(4326008)(1076003)(8936002)(2906002)(356005)(6666004)(81166007)(2616005)(41300700001)(5660300002)(40480700001)(478600001)(40460700003)(83380400001)(82310400005)(426003)(54906003)(26005)(316002)(336012)(36756003)(47076005)(110136005)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2022 02:33:34.8348 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c847054f-3af7-4e6f-bf66-08da5b0a18b9 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: BN8NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0159 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Rather than examining the suspend target, examine what the system is configured to use. This should be no functional change, just improves readability by taking the helper instead. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index 2146232c62ef..fc2c6e311979 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -1056,7 +1056,7 @@ bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) { if (adev->flags & AMD_IS_APU) return false; - return pm_suspend_target_state != PM_SUSPEND_TO_IDLE; + return !pm_suspend_default_s2idle(); } /** @@ -1069,7 +1069,7 @@ bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { if (!(adev->flags & AMD_IS_APU) || - (pm_suspend_target_state != PM_SUSPEND_TO_IDLE)) + !pm_suspend_default_s2idle()) return false; if (!pm_suspend_preferred_s2idle()) { From patchwork Fri Jul 1 02:33:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 586470 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 B5E63C433EF for ; Fri, 1 Jul 2022 02:33:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233740AbiGACd5 (ORCPT ); Thu, 30 Jun 2022 22:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233627AbiGACdl (ORCPT ); Thu, 30 Jun 2022 22:33:41 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2053.outbound.protection.outlook.com [40.107.93.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7530B61D5B; Thu, 30 Jun 2022 19:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=izqvq9cHhJjEDHs3SWrxpv7vwXXRNwqN+rLTrwwZxuDouYpwYXJOMWOA2fjvIKWSohfRfZ1p9PfHSVjHAwOFdgVge/41MKvx7sRSjRsiPpc5Wux0SzNfnQV8Nxnjuujn4SBFy9G6OkE1FV7qVrT2vKGdLyRwJ6Ykxu9qeMNLYm1BrnvAPuahJaQfyTr9bXCIx+9PzeOaK+gbLw3S3wQ0vKF7hCvUCdQfIwfW1Wtb+3qlroEGiJp8IAPZTMUU4elPLS4YJnNFBW7KGcWK8iIPbbeCYXS/FY7CXBYObssqKmWGZaRXWCJg8Lffc+HqQBbg2P02yf1e9Sd96yu7/624IA== 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=Ds5u4rRkCsRMI2FUO2XS3EpFLNvC4Pj9U42rUkxWM/k=; b=fkQbySNm45E5zxUrItbsQV4xdkGngb4y+fIOQrDACGooBeboe40jXV70breTp5B0rYZs5uEidl+zJBd1Wy+wKbGq52eHCwb++7hKleLR0ppW5Jl8Ixn2P0+H+UgPWLGX+faZ1kKylPZBDW6BzDvqofG5WXFk4zm62PD3NtL9wvt3u9yhvZFa9Qg35+3sJA4f16/YWXj4/40t8ovypWKP+tYjQF0omVxgvwEW0AqjkC/j7KmbRQ2nMp/1+qRUXpaxYkpA6128O8K33o0Ai2r7xK17vAUGzefnyvLwIYI4q6IcXodGMQYaRK/gKY0M2LC8PospZ9ZcVqbLMfmFmNL4NQ== 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=Ds5u4rRkCsRMI2FUO2XS3EpFLNvC4Pj9U42rUkxWM/k=; b=n7hZv++FMBIu0EAndacMX23CPmveYB69trHdKdBpcLnVLk8R0Zc4yg2hkGQOf7eVUFeF0LCcRiVIl9wYaT+xPaErOuJ1SomZUD7V5PY2FbPlgO1TGylcHivASA78kld1QyPuyb5MwQLTZe0/6eG15JDUUBepY82xFjt8qxmj3xo= Received: from BN9PR03CA0237.namprd03.prod.outlook.com (2603:10b6:408:f8::32) by SJ0PR12MB5422.namprd12.prod.outlook.com (2603:10b6:a03:3ac::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Fri, 1 Jul 2022 02:33:36 +0000 Received: from BN8NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f8:cafe::e6) by BN9PR03CA0237.outlook.office365.com (2603:10b6:408:f8::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15 via Frontend Transport; Fri, 1 Jul 2022 02:33:36 +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 BN8NAM11FT045.mail.protection.outlook.com (10.13.177.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5395.14 via Frontend Transport; Fri, 1 Jul 2022 02:33:36 +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; Thu, 30 Jun 2022 21:33:35 -0500 From: Mario Limonciello To: , Jiri Kosina , "Benjamin Tissoires" CC: , Richard Gong , , , Subject: [PATCH v3 10/10] HID: usbhid: Set USB mice as s2idle wakeup resources Date: Thu, 30 Jun 2022 21:33:28 -0500 Message-ID: <20220701023328.2783-10-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220701023328.2783-1-mario.limonciello@amd.com> References: <20220701023328.2783-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-Office365-Filtering-Correlation-Id: 7172b8b2-510d-4aed-9d1a-08da5b0a199e X-MS-TrafficTypeDiagnostic: SJ0PR12MB5422:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wBthxZMrcknrwZ8V48kPMITVyjClYaWzR5pCmM6C8rizbZ6gARP3+vvGWc/V4bLIetv1nD5cax4y5bwyfQceWGckD4LFdpk8sEbU2f/YYIIEEgLujuumreJrAgedaTJzUj+zi+ownsDs7pBXx5KqN2Tz2N+baHVo40Kqpncw0flC+n1ehCtwfbLeIjU8mpnj6ETPP33S4tRWKiSFwHhFp6qtnLDWVL7ntr2XsYKtbFJ4m5jW5MwysFTBN0gzdXd9doy2YItAwd0QgWr3QI+V9SYp1nw795AYm1NmNbuVpdrrI3vNyZvJoU9GRYQe9j1Z/2N/14/epCIiVL8YXixKuRoumSz4I8lr/2vOLyoBCuM4J00JZC9Gmf/IxbiFueopneSf5HODj0nbpbdHaw3fNDWMISQ6iZLiXBJWCkgaseRwvkwsIIbVBVmuMf5kqGF6RwSqsUMCodNI9gbwBQ+MNFnxPSkhWkQ5n+/d2cesIOeHQAvI+HA1LpQ7qYjpGItsWx1cEyNpQ0F64qkxYWRavaiP3UK/LUwXgZaFwG5ZQKxe0uSzBRGkmDeeystkGMIltskR1Z3jGU/ujK4/vemWm9Q5i76jw76Z9MtxHsRMBMR217Ym39Z5sFZ6bRYwRUYAn9w6ipAUi8kG2wow1k5ANt/nsUFSn+uZ+1b0aWAzXwr+wF+OH9+aEmKhPVpRG35bkV5ZLAZyb3yuUSwqDJE+Tp+JllJ5ZMr2RxxuDyh3wxkPjiTV+Y4LczkngYvIOq+hMp7nN3p3umAEDadtRlWtHAcJ6kBLz1ANSPFhLH8Xe3S0XVckKEbKQWwS5NfF5IXYuHyVg0SZSGUDYYhYYORgrEqnXxeY/PsyOLo1lY1J76UEuZYpmJZbE25eCbu+LaMTqyq4TTywc1USPTnKiS+UGHkCCexasWw+V5tMOeHAwcg= 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:(13230016)(4636009)(136003)(39860400002)(396003)(346002)(376002)(40470700004)(46966006)(36840700001)(110136005)(478600001)(45080400002)(70586007)(966005)(86362001)(36756003)(81166007)(7696005)(6666004)(41300700001)(336012)(426003)(47076005)(54906003)(26005)(316002)(8676002)(70206006)(4326008)(2616005)(186003)(16526019)(1076003)(82310400005)(2906002)(40460700003)(40480700001)(44832011)(5660300002)(8936002)(83380400001)(356005)(82740400003)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2022 02:33:36.3191 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7172b8b2-510d-4aed-9d1a-08da5b0a199e 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: BN8NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5422 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The USB HID transport layer doesn't configure mice for wakeup by default. Thus users can not wake system from s2idle via USB mouse. However, users can wake the same system from Modern Standby on Windows with the same USB mouse. Microsoft documentation indicates that all USB mice and touchpads should be waking the system from Modern Standby. Many people who have used Windows on a PC that supports Modern Standby have an expectation that s2idle wakeup sources should behave the same in Linux. For example if your PC is configured "dual-boot" and is used docked it's very common to wakeup by using a USB mouse connected to your dock in Windows. Switching to Linux this is not enabled by default and you'll need to manually turn it on or use a different wakeup source than you did for Windows. Changes for wakeups have been made in other subsystems such as the PS/2 keyboard driver which align how wakeup sources in Linux and Modern Standby in Windows behave. To align expectations from users on USB mice, make this behavior the same when the system is configured both by the OEM and the user to use s2idle in Linux. This means that at a minimum supported mice will be able to wakeup by clicking a button. If the USB mouse is powered over the s2idle cycle (such as a wireless mouse with a battery) it's also possible that moving it may wake up the system. This is HW dependent behavior. If the user sets the system to use S3 instead of s2idle, or the OEM ships the system defaulting to S3, this behavior will not be turned on by default. Users who have a modern laptop that supports s2idle and use s2idle but prefer the previous Linux kernel behavior can turn this off via a udev rule. Link: https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby-wake-sources#input-devices-1 Link: https://lore.kernel.org/linux-usb/20220404214557.3329796-1-richard.gong@amd.com/ Suggested-by: Richard Gong Signed-off-by: Mario Limonciello --- More people keep coming to us confused that they couldn't wake a Linux system up from sleep using a mouse, so this patch is being revived. Microsoft documentation doesn't indicate any allowlist for this behavior, and they actually prescribe it for all USB mice and touchpads. changes from v2->v3: * Use `pm_suspend_preferred_s2idle` * Drop now unnecessary acpi.h header inclusion * Update commit message * Adjust comments from v2 per thread changes from v1->v2: * Resubmit by Mario * Update commit message * Only activate on systems configured by user and OEM for using s2idle --- drivers/hid/usbhid/hid-core.c | 37 ++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 4490e2f7252a..d08511f00d3b 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -1176,17 +1177,31 @@ static int usbhid_start(struct hid_device *hid) usb_autopm_put_interface(usbhid->intf); } - /* Some keyboards don't work until their LEDs have been set. - * Since BIOSes do set the LEDs, it must be safe for any device - * that supports the keyboard boot protocol. - * In addition, enable remote wakeup by default for all keyboard - * devices supporting the boot protocol. - */ - if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT && - interface->desc.bInterfaceProtocol == - USB_INTERFACE_PROTOCOL_KEYBOARD) { - usbhid_set_leds(hid); - device_set_wakeup_enable(&dev->dev, 1); + if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT) { + switch (interface->desc.bInterfaceProtocol) { + /* Some keyboards don't work until their LEDs have been set. + * Since BIOSes do set the LEDs, it must be safe for any device + * that supports the keyboard boot protocol. + * In addition, enable remote wakeup by default for all keyboard + * devices supporting the boot protocol. + */ + case USB_INTERFACE_PROTOCOL_KEYBOARD: + usbhid_set_leds(hid); + device_set_wakeup_enable(&dev->dev, 1); + break; + /* + * Windows configures USB mice to be a wakeup source from Modern + * Standby, and users have expectations that s2idle wakeup sources + * behave the same. Thus setup remote wakeup by default for mice + * supporting boot protocol if the system supports s2idle and the user + * has not disabled it on the kernel command line. + */ + case USB_INTERFACE_PROTOCOL_MOUSE: + if (pm_suspend_preferred_s2idle() && + pm_suspend_default_s2idle()) + device_set_wakeup_enable(&dev->dev, 1); + break; + } } mutex_unlock(&usbhid->mutex);