From mboxrd@z Thu Jan 1 00:00:00 1970 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 B5EBAC4332F for ; Sat, 5 Nov 2022 21:50:22 +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=vBIePQsCl+gvINiOVXVMOKKjF0as4sdRg93Pu9QA7Bg=; b=Jls4pCJ4LDps+V wdBXQ1eaGxIKtF4oFs4blvCbb38FqPYwV3tX9hFI9xp1kuwKRbIxMcqxgwXcgdBqlS+5zAbOeYFkn bUqbIfcsAEr2+LlGpDKMlSLQkadKxU4VqD4oldD/vzveIF3yzDqT1AVI6tgYHT8MWJc2oPaeGd76E ZZkNdEYtljP0dx8k9DM4gVd6Hketwcne8aGtXYCuH8gIW5bATRei45aAI3SUfavMM/fCKfhBSFZMS QddhK4oYuF3M4iiFHVtm1Vr9BrHr38TNeOlqU4hK6daYnamHV48G0M3jrnRCv7arWwru/RSgSOHZ9 +7P7oMcFa0IphwHrr/KA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1orR2J-007I3N-C3; Sat, 05 Nov 2022 21:49:07 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1orR21-007I1T-R5 for linux-arm-kernel@lists.infradead.org; Sat, 05 Nov 2022 21:48:51 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id DF302320027A; Sat, 5 Nov 2022 17:48:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 05 Nov 2022 17:48:49 -0400 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=fm1; t=1667684928; x=1667771328; bh=H8 veXpvoO34Pl6tFHer7gYF/PO/WldpA4cjeFDX9dV0=; b=BOQ+xVr9BgNBJ53Np2 2GVbC01Gy1k7LsisJ6a4HuFQ3aNwUYuzdzm3kSYYjx33wwfxPd0z3fECkRdEfz4F 62Ckj0vTqo+3S0f1R73TNu9D4AXuFNon1dbIpj9aF4IKjZk2tDFoPyojbI0oQ5Ix g4FwJgG5IO77IGz6Jr3cpRjq8dhQogtGz1IRhP3LwNipbhXviPOBoGB0/NIncCQX U6qCvJNceg91LP93s5iTTQdXCfCxWf/1fTzpJYAwa0dbpMGBt99el8lLAPM6Yp7U 8YPb8yfCQd5ZeWTXhK6J515XXEX+UQMNrnHpZaMMKsQ//xhb7epA0EqIw7JVLRUT T8bQ== 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=fm3; t=1667684928; x=1667771328; bh=H8veXpvoO34Pl 6tFHer7gYF/PO/WldpA4cjeFDX9dV0=; b=ttfz6Ev9+nb8DRzIFbSUQXXoxy9ds MqMYAiRBBZ3/WgwsScVNN2kM2Sgat6JoK3cuvMFUt1Aoicg3XsJDkqDiCmPBy2CE xVzfbYRrCAn7ViWfA2DrzmRnqphG4AkBaJqKRIpfjTH3FZs6uwmdxs1RKs0MPlYY obe6NpNuqQ7Flq1zyG6ykN3p32xcz59OpwqWmcetbOYO38K/MBODaAO6H7SSz5a3 ZwZYYEKPHLxBZ5QkpWMj9Ehqi9tFw8tX6MgvREmHH1+IqcDUZtVj5K6BJLrIQb3l U9cQtO+CZYTwm+FzVVabUcWH9lVZBKk/yzLK2u3Qvnti3H5yt22pP7a3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvdeggdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 5 Nov 2022 17:48:47 -0400 (EDT) From: Samuel Holland To: Dmitry Osipenko , "Rafael J . Wysocki" , Mark Rutland , Lorenzo Pieralisi Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Samuel Holland Subject: [PATCH 2/2] firmware/psci: Switch to the sys-off handler API Date: Sat, 5 Nov 2022 16:48:40 -0500 Message-Id: <20221105214841.7828-3-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221105214841.7828-1-samuel@sholland.org> References: <20221105214841.7828-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221105_144849_923288_36280F74 X-CRM114-Status: GOOD ( 11.37 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. Signed-off-by: Samuel Holland --- 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.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel