From patchwork Fri Feb 25 19:06:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12760824 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F0EDC433FE for ; Fri, 25 Feb 2022 19:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l+w4ukSNMRGYpK0pQYXPDetCZhj+b6W6vpW8fCi6av8=; b=0a1XJma7HmFb0K /gxrLseFbo4RfDMai837uooeunMcDdH0BHf+2p/foE1fisYegM0KqtSDJZ9NqccTAyhZTVEROHzhE P11+Ox8J+lBQj6BIswBk9YWSgOPMXyKyXPRvpdginZPbj6QlWMjemJlNn7m6e/YHFR4+iARk3h3Oj wNfkX0L09VAR7X3qR6xtzMXcfeBocT8a8+HBf2qrhqTROBLQgM9jfTUgmc1BS+F9weO/ck5MepMSk TMJDEk7L9PHVbQbqhzwCJYLWSqPixBBpeMIDipDAkFqXk53NwMGgsFhSO9EMXlsohov5xRfgMrv2n 6abaaluaIiTYyQ7QPpVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNg0D-006kd8-Th; Fri, 25 Feb 2022 19:11:42 +0000 Received: from mail-bn8nam12on2060a.outbound.protection.outlook.com ([2a01:111:f400:fe5b::60a] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNg02-006kbK-A9 for linux-arm-kernel@lists.infradead.org; Fri, 25 Feb 2022 19:11:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CEIs2NoGNgWbrpcoIH9elWklkPEksnHztRfA9c4SogJWcy/8JM8kwT8Hi/g8iqojZtJfCXPkWASfoVeJAfQyxgLzbz/o6v9cjEqGACji9fNW9pDk35e1anJoVX1VXFEbZy+kw9jSPSmNf5QdZXtw+vMAoYqdOeFoop4TKC2yVucB5MgsKaN1jru3XecSK/R5PDXit5xG6nuGd2F+nwkb+jqHTK67pAJjYUQoxxUm1Ztp5oo7CABFUt6vbeb8UQSpbcnJpG2GKBE8ZVP02q0mfSB4vWsdGEeF6QXvw4mXLXhmgNJsxplzidYQ3sBC9/H7dPHQkEVUK0G97HA2G4ztZQ== 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=NFNwR9HA7cfXXcR4TFqE26sXJ8hX3VdOUfIl8Ta3Cy4=; b=E1eBfOeWAdPAHL/K0iHwRlJArXaR/iyX8ERtsSkBb0J+AX/yYZhNhVKr+C54HjJK2oGJZv7U9L4StcVloNHIMBnCbiGMBKaagOnVhKscHCk7Crj88yQWMq5mSEWXbtb3Iyr6JuyEWChSdzptxgEhAkbu5SslQGG82vzlzXnvcL92WtAxOB6C4Vr7JyxCxCXCSHvRvujJX3GMB4nvhOknIJfNQrhyk7wUmAabNxwKliDhGEN4iyxG/KiLLKJ93HZ5pA6g6VeN/bBl8QHsjUQ6grjXUHpzE0tCuo1iPgtLOdYGmDLbtlAA5QSgcY4MA4MdsK0pMC+QPIFBKQv9TvR42Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=rjwysocki.net 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=NFNwR9HA7cfXXcR4TFqE26sXJ8hX3VdOUfIl8Ta3Cy4=; b=IXLLacalorUpo8OQJvH+qmeK92OuSfwqWxzuNfq40MblezjcLJU3D4uSlund/THqH7v4L5sHXg6sLI1efS6Gpm/MQ7o0ms9sgJd9AZrsywte+A0c4v9mrWIXF4rfKZAQfL0CNdGOkzA8iC2KLFVQ58Y8UYWPpmmBywTpQ2b7zj0= Received: from DM3PR11CA0010.namprd11.prod.outlook.com (2603:10b6:0:54::20) by BL0PR12MB2388.namprd12.prod.outlook.com (2603:10b6:207:4a::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.25; Fri, 25 Feb 2022 19:11:27 +0000 Received: from DM6NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:0:54:cafe::75) by DM3PR11CA0010.outlook.office365.com (2603:10b6:0:54::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22 via Frontend Transport; Fri, 25 Feb 2022 19:11:26 +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; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT056.mail.protection.outlook.com (10.13.173.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5017.22 via Frontend Transport; Fri, 25 Feb 2022 19:11:26 +0000 Received: from localhost.localdomain (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.18; Fri, 25 Feb 2022 13:11:24 -0600 From: Mario Limonciello To: "Rafael J . Wysocki" , Catalin Marinas , Will Deacon CC: , , Mario Limonciello , Sudeep Holla Subject: [PATCH v2 1/2] PSCI: cpuidle: Move the `has_lpi` check to the beginning of the function Date: Fri, 25 Feb 2022 13:06:45 -0600 Message-ID: <20220225190646.1045695-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220225190646.1045695-1-mario.limonciello@amd.com> References: <20220225190646.1045695-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 983be2d5-cf8a-4314-fe21-08d9f8929ec8 X-MS-TrafficTypeDiagnostic: BL0PR12MB2388:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yJ/I8YFDiDaZint8Fr63x3jKjTevRieovmYA21SyzV6w4/WUjmpIR/MYqviOIL2BRbCrJN0PJBE2pGDp94U4I7Ug6QU/7rkFteUjvpQwpg63hdcVVPf36HqegOIoC3pTy+qzI+LpKO2pINbRCa9v3+ZnJeaPV2OnvEXCRenN5tyxN0mkUgdfAxeB+RVx6wMuiVucJOLURU+qrOLENcSXZoku7BqjM1dcZtsmQcU00CQ8qoKSPGL6WjQalXDBddC4K4cEuMf6x0///Z/6cvzmrp/qmpDI1Ei5LQ16Dqs65aUi2p/p/X0gfiMF49SDMRf7boB1l/5V5tvIzVaapBu/es2QH1wRrc1VQ58j2hNpSUG0UVpq4cgHqTDvfATs/wVEfCoK1Qvm+J74vaqT+3FaR7wKA49k9Qw2zWpXsLi073juNyt7GxqIzQe+4IQpz+P0rxAJ0xk7pR8DmIoUFcSwAKCo+T5CiYzhv7KHbacoR598+e1M0yijNThnpPvPnSXsm1YZI4i2gTgat2nZA3MIqWbKsHUBdGpQ3AuRvPN64Fny0hDPzbERhLZ5hjAWtn6OJQeB1Qj7Kq849u+aWMaOqdxW1lFLt8BiBj+wqre8EQ9kCE6ZSd913KkKGbV73ONl5qIH8RfWceo+HH/gLEL6uh5qjI+Ev3b0DPBOIncF9sUbEfbb9+7YLKuI6RPajljRKjPj8bmYpMbWFMmWRSlhHK+XjFz2BWy2KfGFLpC30TI= 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:(13230001)(4636009)(46966006)(36840700001)(40470700004)(2616005)(40460700003)(83380400001)(26005)(47076005)(1076003)(186003)(16526019)(336012)(426003)(356005)(86362001)(82310400004)(36860700001)(81166007)(6666004)(316002)(54906003)(110136005)(36756003)(8676002)(70586007)(70206006)(508600001)(44832011)(4326008)(2906002)(8936002)(5660300002)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 19:11:26.1428 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 983be2d5-cf8a-4314-fe21-08d9f8929ec8 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: DM6NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB2388 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220225_111130_380014_70513103 X-CRM114-Status: GOOD ( 14.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently the first thing checked is whether the PCSI cpu_suspend function has been initialized. Another change will be overloading `acpi_processor_ffh_lpi_probe` and calling it sooner. So make the `has_lpi` check the first thing checked to prepare for that change. Reviewed-by: Sudeep Holla Signed-off-by: Mario Limonciello --- arch/arm64/kernel/cpuidle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/cpuidle.c b/arch/arm64/kernel/cpuidle.c index 03991eeff643..3006f4324808 100644 --- a/arch/arm64/kernel/cpuidle.c +++ b/arch/arm64/kernel/cpuidle.c @@ -54,6 +54,9 @@ static int psci_acpi_cpu_init_idle(unsigned int cpu) struct acpi_lpi_state *lpi; struct acpi_processor *pr = per_cpu(processors, cpu); + if (unlikely(!pr || !pr->flags.has_lpi)) + return -EINVAL; + /* * If the PSCI cpu_suspend function hook has not been initialized * idle states must not be enabled, so bail out @@ -61,9 +64,6 @@ static int psci_acpi_cpu_init_idle(unsigned int cpu) if (!psci_ops.cpu_suspend) return -EOPNOTSUPP; - if (unlikely(!pr || !pr->flags.has_lpi)) - return -EINVAL; - count = pr->power.count - 1; if (count <= 0) return -ENODEV; From patchwork Fri Feb 25 19:06:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12760825 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45856C433F5 for ; Fri, 25 Feb 2022 19:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QHebWFQQZlCM2bBsb7C7ixQLBZ1Lom+m2wP+qx9AHyU=; b=3y5UNXJqXtsYFA 2KFoT2zbKzpl7yw9FA43vVBUBgyMcgPeUPOAo3LaLUPhXAyXboIgfI3Y57QnCAQA9dF0scQQcYaCw Ov2sZgRefGSnhgQdUuBbS3KDdd+/sBjVOS9zkekqCuriFcSFMWJUKlUk1AWIS+m/s0LrvWFFEABF3 ge7NELk+3DmM70b9OEjo2/Q2+pPy3200GwIhmicDSsIUl3mkm3TO7pQD2FmLyt83Pk1TuItv1UPxl NherzFfkuc1+OymRGF2JZroUVi7gZPAZe7Ozhfo6aga7A35kyKQVmVgI6KDj65se8/pfSKVQHhk5e 42wb47AEh27GI9veNAkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNg0O-006kg3-NP; Fri, 25 Feb 2022 19:11:52 +0000 Received: from mail-mw2nam08on20604.outbound.protection.outlook.com ([2a01:111:f400:7e8c::604] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNg03-006kbk-AX for linux-arm-kernel@lists.infradead.org; Fri, 25 Feb 2022 19:11:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lIMflcJat8FYCEoXO5Uphc0Qu99ebnkEZTOggCgnoSCM/9HXlVJF7m938croBZHpXkuYHLIIzZuHDOYYTuhEWfS1y695zOrmNeZKUgIQUwo6K5eGegephKIwyjjQZNvCVQSgbf0gCFqyXh+c1FigB9UYH320a9TKqoxuxoSQkLqnWf91eaRqBj55by7368KtjHr7TWq07SVEn/ZLCWMmhzdTwd5z7JudlnjphCmMi61tfM+N3GVKOrQBmXwIxAeMopMRryYsH0cw9btXvzXL5EWRMJeW/ALFyv/bRkRdBMNGXz+Twfatg1rb3JDari6GhoEAbtwhaA0o2D45gnQQTg== 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=KeD0ZUQO6Dd9eBcVmI7HzIlHpQJOjM8wWdoM+Hi8Fx8=; b=N39p4CHO+MVAC+Nc9Ro1DXIGL/0BiHy3LoOzz2qsmlOpCWAaa6E/dcxLb9Hb+XPhS4s1xLIK2Evm8ztV7yDtHthTJCRUN9zCpfANm6wIVN0xOHFWYLlWBg5Te5wnmxrauthB5WptBjqKtjEqr4zcs3NvwAwvShepruTNMQ6qJM8jdpvSoyCS9dp3WvezOYIOANe4GCpn0cLkJHcV7qZhEae4Uk8Uy0eBO6GOjeongriIK2YewYwCFsVTJbSSSoBCRdugSyDQaTTVE6jhxg9UxohA+BV+LYCdqA9AdX8KFO2aACOnmnIgskdQG7OyZIQ1ec3W7yOsTd3X/Ipkfmb74Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=rjwysocki.net 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=KeD0ZUQO6Dd9eBcVmI7HzIlHpQJOjM8wWdoM+Hi8Fx8=; b=nrggVf9zu3MUK2cFkEU4odB5b3mhBN2fy5PlQSIWUW00SsvaW0OeEGS5SK+dnzqTudy3JcgjspovM/kC/baRGpQKFIiRUOs3ga1PKTaikA0DjTC48vUff3cxz5Qg7nr2dW0mFXP9eChY6G4hECPxd2laPsv6cpOxvtHzwmJTXyQ= Received: from DM3PR11CA0006.namprd11.prod.outlook.com (2603:10b6:0:54::16) by CY4PR1201MB0184.namprd12.prod.outlook.com (2603:10b6:910:1d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.24; Fri, 25 Feb 2022 19:11:27 +0000 Received: from DM6NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:0:54:cafe::82) by DM3PR11CA0006.outlook.office365.com (2603:10b6:0:54::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21 via Frontend Transport; Fri, 25 Feb 2022 19:11:27 +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; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT056.mail.protection.outlook.com (10.13.173.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5017.22 via Frontend Transport; Fri, 25 Feb 2022 19:11:27 +0000 Received: from localhost.localdomain (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.18; Fri, 25 Feb 2022 13:11:25 -0600 From: Mario Limonciello To: "Rafael J . Wysocki" , Catalin Marinas , Will Deacon CC: , , Mario Limonciello , Sudeep Holla Subject: [PATCH v2 2/2] ACPI: processor idle: Check for architectural support for LPI Date: Fri, 25 Feb 2022 13:06:46 -0600 Message-ID: <20220225190646.1045695-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220225190646.1045695-1-mario.limonciello@amd.com> References: <20220225190646.1045695-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7c340fb-3280-40ea-9e97-08d9f8929f55 X-MS-TrafficTypeDiagnostic: CY4PR1201MB0184:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 17WWnhZisehKXqS18JU2FRIXpQ8zgxNuHWomDSKsL6N4vM+LT5F1a6Lr/Q2XxNAfgHzanoVOwtGyK3l9Hc2IiZFnSieMStHrtt565f3DT1LIroeEtEidNNczsUhYAhysb3dU+1ysbNJGAkxKY4Z0E9klWcmY/IWrMbqLIGO7v/xmGg2XiiLEelm2gfvcvrtFNWEfv97zzLO/ElR3751ombQF8uVYTV1uZ9Fwo16kcQiEcKxO7TFyEurHaTDM8YjCoL2FZ0AMmrXEvkxGd/kjyGJKfd2gkpUy5ug7RW0JZgDMgNRt1MdmuT2QFsYAdQY+++nBcrcS6SDGFbcWUIU4ojz4jtFHlQqawsttLhW4dPLlV6dZhLf79J0XqkCR87bhmDcdmgfQHf837FY3Jy15+3jW9dwaogyJfhsAjlM+K/2RqD3lDcvQCoQID9A8HH5KfnlGQzALsC7OXR9sEFB1j+IqEyFSSdjnkKYHV4V30Gnjv53Vx3Ws7250305bordm4Q+Cu8KpA/p5rXBT/HPnt4LKNoouRmqsOswPIPA65Zk5fK63xUIVROSPE9TuhALxQR7djDrg5OJ494uSFkZm8Y7XNUYJTc6DMM7HZpq5pwD8JWWlvQBYtGqL4y0nicDFtjIu1789aXTS2aY3b3Grx8qFt6yEJIQTlc9jMXi9z9FFkWn8BPG9fcyWq5+fVhi6FhNBhwvsxtfOVt/D/d02iw== 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:(13230001)(4636009)(36840700001)(46966006)(40470700004)(316002)(186003)(83380400001)(36756003)(356005)(508600001)(54906003)(110136005)(26005)(16526019)(1076003)(336012)(426003)(81166007)(86362001)(2616005)(40460700003)(70586007)(4326008)(8676002)(70206006)(2906002)(82310400004)(47076005)(6666004)(8936002)(5660300002)(36860700001)(44832011)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 19:11:27.0644 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7c340fb-3280-40ea-9e97-08d9f8929f55 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: DM6NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0184 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220225_111131_389381_8BF7595E X-CRM114-Status: GOOD ( 15.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When `osc_pc_lpi_support_confirmed` is set through `_OSC` and `_LPI` is populated then the cpuidle driver assumes that LPI is fully functional. However currently the kernel only provides architectural support for LPI on ARM. This leads to high power consumption on X86 platforms that otherwise try to enable LPI. So probe whether or not LPI support is implemented before enabling LPI in the kernel. This is done by overloading `acpi_processor_ffh_lpi_probe` to check whether it returns `-EOPNOTSUPP`. It also means that all future implementations of `acpi_processor_ffh_lpi_probe` will need to follow these semantics as well. Reviewed-by: Sudeep Holla Signed-off-by: Mario Limonciello --- drivers/acpi/processor_idle.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index f8e9fa82cb9b..32b20efff5f8 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1080,6 +1080,11 @@ static int flatten_lpi_states(struct acpi_processor *pr, return 0; } +int __weak acpi_processor_ffh_lpi_probe(unsigned int cpu) +{ + return -EOPNOTSUPP; +} + static int acpi_processor_get_lpi_info(struct acpi_processor *pr) { int ret, i; @@ -1088,6 +1093,11 @@ static int acpi_processor_get_lpi_info(struct acpi_processor *pr) struct acpi_device *d = NULL; struct acpi_lpi_states_array info[2], *tmp, *prev, *curr; + /* make sure our architecture has support */ + ret = acpi_processor_ffh_lpi_probe(pr->id); + if (ret == -EOPNOTSUPP) + return ret; + if (!osc_pc_lpi_support_confirmed) return -EOPNOTSUPP; @@ -1139,11 +1149,6 @@ static int acpi_processor_get_lpi_info(struct acpi_processor *pr) return 0; } -int __weak acpi_processor_ffh_lpi_probe(unsigned int cpu) -{ - return -ENODEV; -} - int __weak acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi) { return -ENODEV;