Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9809707rwl; Sun, 1 Jan 2023 10:33:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXsJEdmknByilGcpj259+rUBtYPQnZcww+D+7hQ1BO6ppb10lXEXWz4sjJh88L8Y5/AmSMVt X-Received: by 2002:a17:906:32c3:b0:82a:5b57:3fe4 with SMTP id k3-20020a17090632c300b0082a5b573fe4mr33389087ejk.68.1672598027842; Sun, 01 Jan 2023 10:33:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672598027; cv=none; d=google.com; s=arc-20160816; b=Hypbh79O0QUM5mU1GROeyT+xGtUiDTBSql8WdXPf41wcgX2nNLUT/6nk+fqMryjsyW k7TkWjaZngmEggvuqmC0bCW8RlTs2BwXreSI9h7B0mPeRv92c2eHtGJ0Uc5a/LF+6D2R el4RLTZT4sMzHZUYKBVpPKS287TLE+znxENmvWpuho+zVarn5wbfvstTW7ugft+l10hi jqKib2M2hhKMSifWdKYZBybKtKVniafeUcVHNnYfcx2gQBMsZhNTJ7452DQ+KHOHQskf iHmXA8uvNBPgVDpnW3++o9HCD5w2T4iVdQc+oQd++ElNdr6ubWbcy7vhSqVES7DAG2wU AiAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=E06gK8B1k5R+4obR/pb85rIU152DGA90BBobWIrecS8=; b=r6IQZiRV/XoAxzhJ89pqRezIJOuCnRBEHvEYLDuRI1v2EfkQ6gW2rNCRop6eAX4qT8 A8wcDS5SlfVIXTgfAQ6ZmK1LPoa69TF9353PXGrgc2LLmNwwlvNsLo0GiazZZQdfI+YS J8A9p88kt4jqRl0t/Qy6vhjwXN59MWxuPUA3DW2Ed3Bj9ZCLbYALdUhDK7Y5cQ2ZM/To IcN66Zf9VcPBss5xkcTkO3FxjiB9bDbXht9Mne5b8iRkC9UnhBjGWBWxjWbRe8wSyCef n4B8UfwLs9OlHyFbRoXBZ/DaFoPPrIKbYckDCFLevAlScpS3e1rOTQ9mcH/kiiZb+zY1 MVgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=0Ln4PadV; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=D5gzXsaY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp18-20020a170906c15200b007c195f5947fsi23667453ejc.1003.2023.01.01.10.33.32; Sun, 01 Jan 2023 10:33:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=0Ln4PadV; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=D5gzXsaY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229936AbjAASR0 (ORCPT + 61 others); Sun, 1 Jan 2023 13:17:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbjAASRY (ORCPT ); Sun, 1 Jan 2023 13:17:24 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35D012BC3 for ; Sun, 1 Jan 2023 10:17:22 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 731815C0039; Sun, 1 Jan 2023 13:17:21 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 01 Jan 2023 13:17:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1672597041; x=1672683441; bh=E0 6gK8B1k5R+4obR/pb85rIU152DGA90BBobWIrecS8=; b=0Ln4PadVciBogZjekQ 2pS+AmcHB3Z/l6e+7rIqjIB1Ssvq2CPP9JIv3KgdkWVpWx6y3N1yTgkX9h+6OY7+ HW9L/p+8GM5YwcNe4q+ymkSZIqzqhaiUF6iFiH6ZlbYkTcGOdr2gAqNLzApOExY7 t4ODXJgoMa0zqp37nj5D9Q2WONTWYkBP5jWrw2G5yqCEJviHU+OyfSqUzZ0R6P/b ZRd1RQMhbixVW8rZmOcW4BTz28NpNrOUZiRr1dv3eR1OhEBJUIvcfV9/r1w1B1qQ 6D1SfKlxAadkQThAzExq/M7hRYv2N4MtHXP/TD2dy7HmYBGbGdQs4ylf4nAOWYU5 r9rQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1672597041; x=1672683441; bh=E06gK8B1k5R+4 obR/pb85rIU152DGA90BBobWIrecS8=; b=D5gzXsaYc/R85U8dvuMeHjfDFIJ/v VQGQAZppwsjhHP9B4u/ijxQXtOxc7S8Nodp/K5uN7ggP6w7adlq3Qz1A2C7YcveP ikUcAJfVVl/FHkxO7MWOw6bQUPc6kWZeQYJcBNitjSqZGLwlyd1xQZ+3hU/+hOFH slR7xlmlrsGyWimgPppH3IuyDDaOXp17lOn99TRWeMWmKLKriTiSn8wjw5IRg3bX XEHtGiz6YXRQLjBce3NTgP/ZdQ8Hkulix9+8wCh92E5aNakx6G0sd8eAkw0JcjKk Lh3IZk80esbjQYk2xSIGJvRHU7VbxpsV87CECfwN4sMD5TRapmzyJQ9RA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrjedtgddutdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudekteeuudehtdelteevgfduvddvjefhfedulefgudevgeeghefg udefiedtveetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 1 Jan 2023 13:17:20 -0500 (EST) From: Samuel Holland To: Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Dmitry Osipenko , "Rafael J . Wysocki" Cc: Samuel Holland , John Ogness , Kai-Heng Feng , Luis Chamberlain , Petr Mladek , YueHaibing , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, tangmeng Subject: [PATCH v2 2/2] firmware/psci: Switch to the sys-off handler API Date: Sun, 1 Jan 2023 12:17:15 -0600 Message-Id: <20230101181715.42199-3-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20230101181715.42199-1-samuel@sholland.org> References: <20230101181715.42199-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Any other poweroff handlers registered at the default priority will run before the legacy pm_power_off() function. Register the PSCI poweroff handler with the correct priority to ensure it runs first. PSCI_0_2_FN_SYSTEM_OFF never returns, so the value returned from psci_sys_poweroff() is meaningless, but that function must return some value to have the right prototype for a notifier callback. Signed-off-by: Samuel Holland --- Changes in v2: - Update commit messages drivers/firmware/psci/psci.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index e7bcfca4159f..6d528021925d 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -322,9 +321,11 @@ static struct notifier_block psci_sys_reset_nb = { .priority = 129, }; -static void psci_sys_poweroff(void) +static int psci_sys_poweroff(struct sys_off_data *data) { invoke_psci_fn(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0); + + return NOTIFY_DONE; } static int psci_features(u32 psci_func_id) @@ -603,7 +604,9 @@ static void __init psci_0_2_set_functions(void) register_restart_handler(&psci_sys_reset_nb); - pm_power_off = psci_sys_poweroff; + register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, + SYS_OFF_PRIO_FIRMWARE, + psci_sys_poweroff, NULL); } /* -- 2.37.4