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=ham 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 0FF49C433E7 for ; Tue, 1 Sep 2020 14:13:14 +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 CB154207D3 for ; Tue, 1 Sep 2020 14:13:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MUjTnTst" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB154207D3 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=haHsKvimT/OvWVvhyYpzboRcZV4ZXpl3aImTDmvYzJI=; b=MUjTnTsts1s/HG4m/PzFh2I8o rZyD1QNCOsRVWd0TzYKKcfct31tbV1x/u3C/rM2G0XOHKATvzXGr9l8ibZCRhscgmBUp5QX1dH66+ R/acPDJjXT4taiWfR0AmKAWei4V53aTIiNJ+nhjioetJuqJyBAFl07MwNNx++Jqe7xvmnSfKHNeyw 3APJpjSvBA3Pu4dt030n1gggHIKa5qqG01u+XVJFkIuEizwAsiCT8cShIlj77q98Z9kb8niMd8jgi c+NEPaW1f9K2wZupMX0nj0zuigHxVuoabJxbUqvhJijXfGxIR037h7UbrMVTvUUYJT6oF6BAJqSK9 f/skvFTww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kD70r-0001Lz-U9; Tue, 01 Sep 2020 14:11:53 +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 1kD70o-0001L7-SV for linux-arm-kernel@lists.infradead.org; Tue, 01 Sep 2020 14:11:52 +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 9B1E81045; Tue, 1 Sep 2020 07:11:49 -0700 (PDT) Received: from bogus (unknown [10.57.5.92]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B2F473F66F; Tue, 1 Sep 2020 07:11:47 -0700 (PDT) Date: Tue, 1 Sep 2020 15:11:41 +0100 From: Sudeep Holla To: Ulf Hansson Subject: Re: [PATCH v2 2/2] cpuidle: psci: Allow PM domain to be initialized even if no OSI mode Message-ID: <20200901141141.GA11121@bogus> References: <20200901121226.217568-1-ulf.hansson@linaro.org> <20200901121226.217568-3-ulf.hansson@linaro.org> <20200901133218.GB27090@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_101151_012729_8E2AF20E X-CRM114-Status: GOOD ( 33.36 ) 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: Mark Rutland , 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 03:49:55PM +0200, Ulf Hansson wrote: > On Tue, 1 Sep 2020 at 15:32, Sudeep Holla wrote: > > > > On Tue, Sep 01, 2020 at 02:12:26PM +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. > > > > > > 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. > > > > > > 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. > > > > > > 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 > > > --- > > > > > > Changes in v2: > > > - Assign the genpd ->power_off() callback, only when the PSCI OSI mode > > > has been successfully enabled. > > > > > > --- > > > drivers/cpuidle/cpuidle-psci-domain.c | 57 ++++++++++++++------------- > > > 1 file changed, 29 insertions(+), 28 deletions(-) > > > > > > diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c > > > index b6ab0415f450..256e7e35b5af 100644 > > > --- a/drivers/cpuidle/cpuidle-psci-domain.c > > > +++ b/drivers/cpuidle/cpuidle-psci-domain.c > > > @@ -105,7 +105,7 @@ static void psci_pd_free_states(struct genpd_power_state *states, > > > kfree(states); > > > } > > > > > > -static int psci_pd_init(struct device_node *np) > > > +static int psci_pd_init(struct device_node *np, bool use_osi) > > > { > > > struct generic_pm_domain *pd; > > > struct psci_pd_provider *pd_provider; > > > @@ -135,11 +135,14 @@ static int psci_pd_init(struct device_node *np) > > > > > > pd->free_states = psci_pd_free_states; > > > pd->name = kbasename(pd->name); > > > - pd->power_off = psci_pd_power_off; > > > pd->states = states; > > > pd->state_count = state_count; > > > pd->flags |= GENPD_FLAG_IRQ_SAFE | GENPD_FLAG_CPU_DOMAIN; > > > > > > + /* Use the ->power_off() callback when OSI is enabled. */ > > > > IIUC, you did mention that we need to attach PD even when the OSI fails > > as this could be shared domain. With the below conditional assignment > > of power_off, I understand that if OSI fails and we have domains attached, > > then it will be always ON ? > > From a genpd point of view, the corresponding PM domain can be powered > off (as long as all attached consumers allow that as well, of course). > Can be powered off ? Or will be powered off ? It sounds wrong if it will be powered off as the domain needs to be powered up for CPU to be running. It sounds like we may be out of sync though not a big issue, it sounds weird for me. > Hmm, maybe we should add a GENPD_FLAG_ALWAYS_ON, to really enforce > that it stays on? > Should that not be default for CPU power domains if OSI can't be enabled ? -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel