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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1E8EC433F5 for ; Mon, 25 Oct 2021 00:38:48 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1DF5360238 for ; Mon, 25 Oct 2021 00:38:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1DF5360238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 59A1C8351A; Mon, 25 Oct 2021 02:38:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 8650B834F4; Mon, 25 Oct 2021 02:38:38 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 80B7483460 for ; Mon, 25 Oct 2021 02:38:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com 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 DCB69D6E; Sun, 24 Oct 2021 17:38:30 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8B97E3F70D; Sun, 24 Oct 2021 17:38:29 -0700 (PDT) Date: Mon, 25 Oct 2021 01:38:26 +0100 From: Andre Przywara To: Samuel Holland Cc: u-boot@lists.denx.de, Jaehoon Chung , Jagan Teki , Igor Opaniuk , Jernej Skrabec , Stephan Gerhold , Tim Harvey Subject: Re: [PATCH 3/4] power: axp: Avoid do_poweroff conflict with sysreset Message-ID: <20211025013826.40e118ec@slackpad.fritz.box> In-Reply-To: <20210822231807.3330-4-samuel@sholland.org> References: <20210822231807.3330-1-samuel@sholland.org> <20210822231807.3330-4-samuel@sholland.org> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Sun, 22 Aug 2021 18:18:05 -0500 Samuel Holland wrote: Hi Samuel, > The sysreset uclass has an option to provide the do_poweroff() function. > When that option is enabled, the AXP power drivers should not provide > their own definition. > > For the AXP305, which is paired with 64-bit systems where TF-A provides > PSCI, there is another possible conflict with the PSCI firmware driver. > This driver can be enabled even if CONFIG_PSCI_RESET is disabled, so > make sure to use the right symbol in the condition. > > Signed-off-by: Samuel Holland Not a big fan of adding #ifdef's, but it looks like these implementations of do_poweroff() can eventually be removed, when SYSRESET works everywhere? Or is there a reason we cannot select SYSRESET later on, and would still need do_poweroff from those AXP drivers directly? Anyway: Reviewed-by: Andre Przywara Cheers, Andre > --- > > drivers/power/axp152.c | 2 ++ > drivers/power/axp209.c | 2 ++ > drivers/power/axp221.c | 2 ++ > drivers/power/axp305.c | 2 +- > drivers/power/axp809.c | 2 ++ > drivers/power/axp818.c | 2 ++ > 6 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/power/axp152.c b/drivers/power/axp152.c > index d6e36125c12..a93987c1538 100644 > --- a/drivers/power/axp152.c > +++ b/drivers/power/axp152.c > @@ -79,6 +79,7 @@ int axp_init(void) > return 0; > } > > +#if !IS_ENABLED(CONFIG_SYSRESET_CMD_POWEROFF) > int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) > { > pmic_bus_write(AXP152_SHUTDOWN, AXP152_POWEROFF); > @@ -89,3 +90,4 @@ int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) > /* not reached */ > return 0; > } > +#endif > diff --git a/drivers/power/axp209.c b/drivers/power/axp209.c > index ade531940b9..3447b9f0113 100644 > --- a/drivers/power/axp209.c > +++ b/drivers/power/axp209.c > @@ -230,6 +230,7 @@ int axp_init(void) > return 0; > } > > +#if !IS_ENABLED(CONFIG_SYSRESET_CMD_POWEROFF) > int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) > { > pmic_bus_write(AXP209_SHUTDOWN, AXP209_POWEROFF); > @@ -240,3 +241,4 @@ int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) > /* not reached */ > return 0; > } > +#endif > diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c > index 3446fe7365d..d251c314b98 100644 > --- a/drivers/power/axp221.c > +++ b/drivers/power/axp221.c > @@ -264,6 +264,7 @@ int axp_get_sid(unsigned int *sid) > return 0; > } > > +#if !IS_ENABLED(CONFIG_SYSRESET_CMD_POWEROFF) > int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) > { > pmic_bus_write(AXP221_SHUTDOWN, AXP221_SHUTDOWN_POWEROFF); > @@ -274,3 +275,4 @@ int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) > /* not reached */ > return 0; > } > +#endif > diff --git a/drivers/power/axp305.c b/drivers/power/axp305.c > index 0191e4d427e..049ef07f746 100644 > --- a/drivers/power/axp305.c > +++ b/drivers/power/axp305.c > @@ -69,7 +69,7 @@ int axp_init(void) > return ret; > } > > -#ifndef CONFIG_PSCI_RESET > +#if !CONFIG_IS_ENABLED(ARM_PSCI_FW) && !IS_ENABLED(CONFIG_SYSRESET_CMD_POWEROFF) > int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) > { > pmic_bus_write(AXP305_SHUTDOWN, AXP305_POWEROFF); > diff --git a/drivers/power/axp809.c b/drivers/power/axp809.c > index 6323492b66d..49584e502fe 100644 > --- a/drivers/power/axp809.c > +++ b/drivers/power/axp809.c > @@ -220,6 +220,7 @@ int axp_init(void) > return pmic_bus_init(); > } > > +#if !IS_ENABLED(CONFIG_SYSRESET_CMD_POWEROFF) > int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) > { > pmic_bus_write(AXP809_SHUTDOWN, AXP809_SHUTDOWN_POWEROFF); > @@ -230,3 +231,4 @@ int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) > /* not reached */ > return 0; > } > +#endif > diff --git a/drivers/power/axp818.c b/drivers/power/axp818.c > index 0531707c8aa..0960786f4a7 100644 > --- a/drivers/power/axp818.c > +++ b/drivers/power/axp818.c > @@ -256,6 +256,7 @@ int axp_init(void) > return 0; > } > > +#if !IS_ENABLED(CONFIG_SYSRESET_CMD_POWEROFF) > int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) > { > pmic_bus_write(AXP818_SHUTDOWN, AXP818_SHUTDOWN_POWEROFF); > @@ -266,3 +267,4 @@ int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) > /* not reached */ > return 0; > } > +#endif