Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2310234ybi; Thu, 18 Jul 2019 06:32:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyH0EzIhQqLWmfWRMCrXztdh9CevlNCB4WEimKVyU0JXAA5F6MHEssrsULe4vN+8EyJasi X-Received: by 2002:a17:902:44f:: with SMTP id 73mr50667994ple.192.1563456723045; Thu, 18 Jul 2019 06:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563456723; cv=none; d=google.com; s=arc-20160816; b=LDGxWkqP7Gh2gUJ9yeGIlqXsBeYiiNNLmjIpOaASUhwkP/gAiWJU1NE2X3YRpQCjMT 2l4QA8bZFC8kHOf0B1BY+cWXXPcMCaM7wqt8UUJkyc8ZDYjUou1+23u+1coxhuVJ/MuL BELbILxMamcUWnHQtOWN6fYAgABMiHSWCC7f0TyfQFeV6zA7bNvLEze+Umz0/4FH8rvR 1J+rm2rM5X+C1NCRyQr02u+YDojmnc9KPRqkbNRhaqqdRxbC4YfJEPec3a8Ahvtr80nM eklCdExbULMSZJnB9meEuvVaqt8SMtKgnXYnWOhKI2sDn9BNe/oHikepS4zuM8UXb95J jFUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tfZd7AO+WfmJnt0Qna8zr0GP49e2lLdjMimFLUaB8kM=; b=CGbGcPhf9qcq3nK8GjgLwmhSTfxERG64B2DCIcXXLAzPFERvgidfwfnZvheImWauBX rVHS29Vp9q7wYCkVIU4WwY8eH/w0TPR6JIs9/fKbPzh5IsX2HtEue8dllHmOi17HYi4U iTo6ELR7FUKmt6ObrIVh5WNKBS7PToyK7r7oArpejQkUa29Wmup59LfAKIx8hh7eSHzh Fa2TRgz3Bp4HZ3yC9G/Fykhwrq/n/PyXMTtcqNzU9YBFbRAklckL6gcauWznO3S/zozG JUZbCkSfd+Pmnkx1nnMVBCmMwG44zb8rGs2g1U0krP6KLr5dGqwXKfA0kiK5adwki+Hh dbTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si2815134pgm.43.2019.07.18.06.31.47; Thu, 18 Jul 2019 06:32:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390134AbfGRNbG (ORCPT + 99 others); Thu, 18 Jul 2019 09:31:06 -0400 Received: from foss.arm.com ([217.140.110.172]:58428 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726608AbfGRNbF (ORCPT ); Thu, 18 Jul 2019 09:31:05 -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 E5B6A344; Thu, 18 Jul 2019 06:31:04 -0700 (PDT) Received: from e121166-lin.cambridge.arm.com (unknown [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 59D753F71F; Thu, 18 Jul 2019 06:31:02 -0700 (PDT) Date: Thu, 18 Jul 2019 14:30:53 +0100 From: Lorenzo Pieralisi To: Ulf Hansson Cc: Sudeep Holla , Mark Rutland , Linux ARM , "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 , Souvik Chakravarty , Linux PM , linux-arm-msm , Linux Kernel Mailing List Subject: Re: [PATCH 14/18] drivers: firmware: psci: Manage runtime PM in the idle path for CPUs Message-ID: <20190718133053.GA27222@e121166-lin.cambridge.arm.com> References: <20190513192300.653-1-ulf.hansson@linaro.org> <20190513192300.653-15-ulf.hansson@linaro.org> <20190716155317.GB32490@e121166-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 18, 2019 at 12:35:07PM +0200, Ulf Hansson wrote: > On Tue, 16 Jul 2019 at 17:53, Lorenzo Pieralisi > wrote: > > > > On Mon, May 13, 2019 at 09:22:56PM +0200, Ulf Hansson wrote: > > > When the hierarchical CPU topology layout is used in DT, let's allow the > > > CPU to be power managed through its PM domain, via deploying runtime PM > > > support. > > > > > > To know for which idle states runtime PM reference counting is needed, > > > let's store the index of deepest idle state for the CPU, in a per CPU > > > variable. This allows psci_cpu_suspend_enter() to compare this index with > > > the requested idle state index and then act accordingly. > > > > I do not see why a system with two CPU CPUidle states, say CPU retention > > and CPU shutdown, should not be calling runtime PM on CPU retention > > entry. > > If the CPU idle governor did select the CPU retention for the CPU, it > was probably because the target residency for the CPU shutdown state > could not be met. The kernel does not know what those cpu states represent, so, this is an assumption you are making and it must be made clear that this code works as long as your assumption is valid. If eg a "cluster" retention state has lower target_residency than the deepest CPU idle state this assumption is wrong. And CPUidle and genPD governor decisions are not synced anyway so, again, this is an assumption, not a certainty. > In this case, there is no point in allowing any other deeper idle > states for cluster/package/system, since those have even greater > residencies, hence calling runtime PM doesn't make sense. On the systems you are testing on. Lorenzo > > The question then is what cluster/package/system states > > are allowed for a given CPU idle state, to understand > > what idle states can be actually entered at any hierarchy > > level given the choice made for the CPU idle state. > > > > In the case above, a CPU entering retention state should prevent > > runtime PM selecting a cluster shutdown state; most likely firmware > > would demote the request to cluster retention but still, we should > > find a way to describe these dependencies. > > See above. > > [...] > > Kind regards > Uffe