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 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5F66C2BCA1 for ; Fri, 7 Jun 2019 15:21:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A87F6208C3 for ; Fri, 7 Jun 2019 15:21:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729456AbfFGPVU (ORCPT ); Fri, 7 Jun 2019 11:21:20 -0400 Received: from foss.arm.com ([217.140.110.172]:42562 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728665AbfFGPVU (ORCPT ); Fri, 7 Jun 2019 11:21:20 -0400 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 99207337; Fri, 7 Jun 2019 08:21:19 -0700 (PDT) Received: from e107155-lin (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E9EEB3F718; Fri, 7 Jun 2019 08:21:16 -0700 (PDT) Date: Fri, 7 Jun 2019 16:21:14 +0100 From: Sudeep Holla To: Ulf Hansson Cc: Lorenzo Pieralisi , Mark Rutland , linux-arm-kernel@lists.infradead.org, "Rafael J . Wysocki" , Daniel Lezcano , "Raju P . L . S . S . S . N" , Amit Kucheria , Bjorn Andersson , Stephen Boyd , Niklas Cassel , Tony Lindgren , Kevin Hilman , Lina Iyer , Viresh Kumar , Vincent Guittot , Geert Uytterhoeven , Sudeep Holla , Souvik Chakravarty , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/18] drivers: firmware: psci: Prepare to support PM domains Message-ID: <20190607152114.GG15577@e107155-lin> References: <20190513192300.653-1-ulf.hansson@linaro.org> <20190513192300.653-9-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190513192300.653-9-ulf.hansson@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Mon, May 13, 2019 at 09:22:50PM +0200, Ulf Hansson wrote: > Subsequent changes implements support for PM domains to PSCI. Those changes > are mainly implemented in a new separate c-file, hence a couple of the > internal PSCI functions needs to be shared to be accessible. Let's do that > via adding a new PSCI header file. > > Moreover, to implement support for PM domains, switching the PSCI FW into > the OS initiated mode is sometimes needed. Therefore, let's share a new > function that implement this. > This looks fine. -- Regards, Sudeep > Signed-off-by: Ulf Hansson > --- > > Changes: > - Convert psci_set_osi_mode() to return an int. > - Don't share psci_get_domain_state() as that's no longer needed. > - Update changelog. > > --- > drivers/firmware/psci/psci.c | 17 ++++++++++++++--- > drivers/firmware/psci/psci.h | 16 ++++++++++++++++ > 2 files changed, 30 insertions(+), 3 deletions(-) > create mode 100644 drivers/firmware/psci/psci.h > > diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c > index 4aec513136e4..0e91d864e346 100644 > --- a/drivers/firmware/psci/psci.c > +++ b/drivers/firmware/psci/psci.c > @@ -34,6 +34,8 @@ > #include > #include > > +#include "psci.h" > + > /* > * While a 64-bit OS can make calls with SMC32 calling conventions, for some > * calls it is necessary to use SMC64 to pass or return 64-bit values. > @@ -96,7 +98,7 @@ static inline bool psci_has_ext_power_state(void) > PSCI_1_0_FEATURES_CPU_SUSPEND_PF_MASK; > } > > -static inline bool psci_has_osi_support(void) > +bool psci_has_osi_support(void) > { > return psci_cpu_suspend_feature & PSCI_1_0_OS_INITIATED; > } > @@ -161,6 +163,15 @@ static u32 psci_get_version(void) > return invoke_psci_fn(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0); > } > > +int psci_set_osi_mode(void) > +{ > + int err; > + > + err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, > + PSCI_1_0_SUSPEND_MODE_OSI, 0, 0); > + return psci_to_linux_errno(err); > +} > + > static int psci_cpu_suspend(u32 state, unsigned long entry_point) > { > int err; > @@ -292,12 +303,12 @@ static inline u32 psci_get_domain_state(void) > return __this_cpu_read(domain_state); > } > > -static inline void psci_set_domain_state(u32 state) > +void psci_set_domain_state(u32 state) > { > __this_cpu_write(domain_state, state); > } > > -static int psci_dt_parse_state_node(struct device_node *np, u32 *state) > +int psci_dt_parse_state_node(struct device_node *np, u32 *state) > { > int err = of_property_read_u32(np, "arm,psci-suspend-param", state); > > diff --git a/drivers/firmware/psci/psci.h b/drivers/firmware/psci/psci.h > new file mode 100644 > index 000000000000..f2277c3ad405 > --- /dev/null > +++ b/drivers/firmware/psci/psci.h > @@ -0,0 +1,16 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > + > +#ifndef __PSCI_H > +#define __PSCI_H > + > +struct device_node; > + > +int psci_set_osi_mode(void); > +bool psci_has_osi_support(void); > + > +#ifdef CONFIG_CPU_IDLE > +void psci_set_domain_state(u32 state); > +int psci_dt_parse_state_node(struct device_node *np, u32 *state); > +#endif > + > +#endif /* __PSCI_H */ > -- > 2.17.1 >