Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1557570rwb; Mon, 7 Nov 2022 03:07:05 -0800 (PST) X-Google-Smtp-Source: AMsMyM6q1F1amgJRXxqn9LuVljP5cnjRsp/bdAB7N881KzHzwSviIZIVAEGJEeHv7+9boplbIsZe X-Received: by 2002:a17:906:3607:b0:7ad:a798:cdc0 with SMTP id q7-20020a170906360700b007ada798cdc0mr46540268ejb.357.1667819224766; Mon, 07 Nov 2022 03:07:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667819224; cv=none; d=google.com; s=arc-20160816; b=UUbIVt34ryBh1NhMhYPYgs2/pD6pigQbJln6IOoFynAbAvOQsg07ftM6NQpmJfccQ3 6lNqYxfPYcQeQ3FQEfIbxGisz5R4ZVlGVK+0LQFyfqIJiYIhG6W9bC5TZjDcmM5zCQ4S zwbPTQjdfhIoUP22K1ZPgRfUEV/YSXVn0Ild/HL+V/crDVryXih6h+1Ru/dE134PHn6v p5PQQlQ7dO/f7mHmz4aVGjudmAyLTaueI4qaj7ssG3USbE2tU1qBj3YXPxeV8atVZYug IazC0VG6pETyEoRfzY8in/yvihAlRjZZDCoQVkODPrHmgE2D2YN/8L6ggmjgNtCW54Cs rMGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Z/361ish3wDTS17YX2oLf2e8tWXTi8ui6CE1jdpXWiY=; b=HUcmvYbiNxw2eCPKmR9c1NPqEz3sW/EkW369KB4PXEcFStPPOsCmXFyGtHRO+F1JTs sE/kILKenoKoU5NSNbAam/eMmj49NpyvUqwA0DM2jmMTLtRM+ECIyrTs1v8uHY34PhEQ 8MzX09X/0h1gs9IS3XKTzPLpLTZAQQdSBZY1VvWl8G0l2FG2lfjJfi0wkHhEl4HXhbl6 xd9D8ooJCoWBgXpuV2Eh2u+PmAmm5ZtN0LzwO0FGcx/g3tnJZ28ngr6ZRhTklWlZyfkD 7p+kAiyU7xP86PrExsMIcVXuehvfj668+0b7bKVqATF1NVrS+qsq1g8rRyXs8BW+9/BD osxQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne25-20020a1709077b9900b007adc4a0aeb5si9096194ejc.873.2022.11.07.03.06.41; Mon, 07 Nov 2022 03:07:04 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231682AbiKGKzO (ORCPT + 93 others); Mon, 7 Nov 2022 05:55:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231237AbiKGKzN (ORCPT ); Mon, 7 Nov 2022 05:55:13 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 70EC7F9 for ; Mon, 7 Nov 2022 02:55:11 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5789C1FB; Mon, 7 Nov 2022 02:55:17 -0800 (PST) Received: from bogus (unknown [10.57.6.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 728B33F73D; Mon, 7 Nov 2022 02:55:09 -0800 (PST) Date: Mon, 7 Nov 2022 10:55:06 +0000 From: Sudeep Holla To: Samuel Holland Cc: Dmitry Osipenko , "Rafael J . Wysocki" , Sudeep Holla , Mark Rutland , Lorenzo Pieralisi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/2] firmware/psci: Switch to the sys-off handler API Message-ID: <20221107105506.pfoxmngp7shhci3p@bogus> References: <20221105214841.7828-1-samuel@sholland.org> <20221105214841.7828-3-samuel@sholland.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221105214841.7828-3-samuel@sholland.org> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 On Sat, Nov 05, 2022 at 04:48:40PM -0500, Samuel Holland wrote: > 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; Just note that PSCI SYSTEM_OFF doesn't return and hence the above return is useless. I understand the generic idea here and should be fine, just thought of pointing that the firmware won't return from the call. -- Regards, Sudeep