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=-11.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 415E3C433E6 for ; Tue, 1 Sep 2020 10:18:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFEB8206FA for ; Tue, 1 Sep 2020 10:18:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yx4P7jvb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFEB8206FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iceD9aLcVa5ZabDtcudKKe1KBi3O3XnCEUXl2K7uhZs=; b=yx4P7jvbUF9CYfFu/pmTFdE4X 5RaaGXI3TETLYqtzm9XC/UdKg5rsyMYHQhEtLVaGRmv6H/jXUUbgU0iFpDv5jPICDwBNKAbr4N1Kz dbQX7IfQWicEjhOdj6klEFxkjZGs4B5tFTBMXYLccGIE2nXbCGkvMxMm4u9WlW5Yve9ShKkR9vSE5 XcPQFOETjc05W2vT4U5RAgji2+Z+Ao8v05llBYwsTr6IMK6gj9H0THM5ydIPQCLyv8jhnhJJVrTst eqibmvbuKX5AIAbpI+MFFBjhFMgnHPUYJshAneOoLVVkbXkLTDwnnrUHtgOaBayZEnizdxv97fJlA Byo6xh84Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kD3MB-0005S2-Mb; Tue, 01 Sep 2020 10:17:39 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kD3M8-0005RC-D1 for linux-arm-kernel@lists.infradead.org; Tue, 01 Sep 2020 10:17:37 +0000 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 0A03830E; Tue, 1 Sep 2020 03:17:35 -0700 (PDT) Received: from bogus (unknown [10.57.5.92]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 45A443F71F; Tue, 1 Sep 2020 03:17:32 -0700 (PDT) Date: Tue, 1 Sep 2020 11:17:25 +0100 From: Sudeep Holla To: Ulf Hansson Subject: Re: [PATCH] cpuidle: psci: Allow PM domain to be initialized even if no OSI mode Message-ID: <20200901101725.GA23815@bogus> References: <20200814123436.61851-1-ulf.hansson@linaro.org> <20200818123507.GD6873@bogus> <20200901090125.GA14397@bogus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200901_061736_535250_02CA7A79 X-CRM114-Status: GOOD ( 47.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Vincent Guittot , Benjamin Gaignard , Linux PM , Stephen Boyd , Daniel Lezcano , "Rafael J . Wysocki" , Lina Iyer , Bjorn Andersson , Linux ARM , Sudeep Holla , Lukasz Luba 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 On Tue, Sep 01, 2020 at 11:43:34AM +0200, Ulf Hansson wrote: > On Tue, 1 Sep 2020 at 11:01, Sudeep Holla wrote: > > > > On Wed, Aug 19, 2020 at 10:20:52AM +0200, Ulf Hansson wrote: > > > On Tue, 18 Aug 2020 at 14:35, Sudeep Holla wrote: > > > > > > > > On Fri, Aug 14, 2020 at 02:34:36PM +0200, Ulf Hansson wrote: > > > > > If the PSCI OSI mode isn't supported or fails to be enabled, the PM domain > > > > > topology with the genpd providers isn't initialized. This is perfectly fine > > > > > from cpuidle-psci point of view. > > > > > > > > > > > > > Indeed. > > > > > > > > > However, since the PM domain topology in the DTS files is a description of > > > > > the HW, no matter of whether the PSCI OSI mode is supported or not, other > > > > > consumers besides the CPUs may rely on it. > > > > > > > > > > > > > And why are they even registered as part of cpuidle-psci-domain ? > > > > If they have to be, can be decouple it completely from cpuidle then ? > > > > > > These devices can't be decoupled as they are a part of the CPU cluster > > > PM domain. > > > > > > This is for example the case RPMH (rsc) device for Qcom platforms, but > > > there are other platforms that need this too. > > > > > > > > > > > > Therefore, let's always allow the initialization of the PM domain topology > > > > > to succeed, independently of whether the PSCI OSI mode is supported. > > > > > Consequentially we need to track if we succeed to enable the OSI mode, as > > > > > to know when a domain idlestate can be selected. > > > > > > > > > > > > > I thought we had discussed this in past, why are we back to the same > > > > discussion ? I may need to read those again to get the context. > > > > > > That discussion was according to my understanding about whether we > > > should allow CPU devices to be managed by runtime PM and the CPU PM > > > domains, if OSI was *not* supported. > > > > > > We concluded that we didn't want to allow that, which makes sense - > > > and I am not changing that in $subject patch. > > > > > > > > > > > > Note that, CPU devices are still not being attached to the PM domain > > > > > topology, unless the PSCI OSI mode is supported. > > > > > > > > > > Signed-off-by: Ulf Hansson > > > > > --- > > > > > drivers/cpuidle/cpuidle-psci-domain.c | 49 +++++++++++++-------------- > > > > > 1 file changed, 24 insertions(+), 25 deletions(-) > > > > > > > > > > diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c > > > > > index b6e9649ab0da..55653c110e3a 100644 > > > > > --- a/drivers/cpuidle/cpuidle-psci-domain.c > > > > > +++ b/drivers/cpuidle/cpuidle-psci-domain.c > > > > > @@ -28,6 +28,7 @@ struct psci_pd_provider { > > > > > > > > > > static LIST_HEAD(psci_pd_providers); > > > > > static bool psci_pd_allow_domain_state; > > > > > +static bool psci_osi_mode_enabled; > > > > > > > > > > static int psci_pd_power_off(struct generic_pm_domain *pd) > > > > > { > > > > > @@ -37,7 +38,7 @@ static int psci_pd_power_off(struct generic_pm_domain *pd) > > > > > if (!state->data) > > > > > return 0; > > > > > > > > > > - if (!psci_pd_allow_domain_state) > > > > > + if (!psci_pd_allow_domain_state || !psci_osi_mode_enabled) > > > > > > > > I really don't like this check. Why do we have to keep checking > > > > psci_osi_mode_enabled every single time and that is the reason IIRC > > > > I was against this and just don't add the domains. > > > > > > You have a point about the check, it's not very nice - but from an > > > execution point of view, I don't think it's the end of the world. > > > > > > Note that, when not using OSI, then the ->power_off() callback will > > > not be invoked in the cpuidle path. > > > > > > > Then drop the check. I am confused as why we need that runtime check if > > we get the setup right. > > > > > Anyway, if you like, I can try to rework the code, so that the > > > ->power_off() callback doesn't get assigned, if we are not using OSI. > > > > +1 for sure. > > > > > Although, I am not sure the trouble is worth it, as I probably need to > > > try to enable OSI before initializing the genpd data structures. Then, > > > if failing with genpd initializations, I need to revert back to PC > > > mode. > > > > > > > Just to clarify, you can use psci_osi_mode_enabled anytime during > > initialisation and get the setup right so that we can drop unnecessary > > runtime check every single poweroff call. I prefer to remove that. > > Okay, I will respin the series then. > > Although, just to be clear, this means that I will have to invoke > psci_set_osi_mode() prior to initializing the PM domains. Then if it > turns out that initializing the PM domain fails, I will have to switch > back to PC mode. > > To do that, I will probably need to extend psci_set_osi_mode() to take > a bool as a parameter (to indicate enable or disable OSI mode). You > are okay with this, right? > I am fine with that. I assume by disable OSI mode, you are referring to switch back to PC mode. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel