Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1871798yba; Fri, 10 May 2019 02:26:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzsLdaxogJS5M+6OHRQrYo5UXWvggMAtsqF/Yetl9J5+iRJO2HOBb4WFA4zqpABcFrqqaPo X-Received: by 2002:a63:5264:: with SMTP id s36mr7523799pgl.258.1557480412647; Fri, 10 May 2019 02:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557480412; cv=none; d=google.com; s=arc-20160816; b=J0Iorr4Y2xQB3O+1206wcr/o2jgsNjMob2/y5OWaVcvThuRh/UQkZ9fnQDK2kOLoPK SCT1XkawFeYcoEctvx50asCgQQllPL2IXngRzU/AKI+DFPHwOtd0jFmNvlp9rg+DUhVe Bz9xxuw982YRSKOp6ZkqfXIzex0TrHe+AijqsLFzJo0OHWDVMcl8cyrflKBsNJqZJxl6 RXUtmTVRZmNh+rvuQHNrNh8ss7o6WUSVHbna6EqCO4RrWtaU6HozqVdI/FkHKANn11HI o0GYdqKGEGLl5gmVtYqp97PWpwL2gR/0wPVDFxXu1on+GpjPpwgvxAotBHAX6+z2aUwF x3qA== 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=Oee0IfwksyHXrjW9sg2G33G17xxK2UYWj31A4ayjHuE=; b=djcFnXvRpmshKFc1jI3yGlu5hQgT4jEVkF1u3wp2/BnmVRGl5gy5Ygp6ddEP2DYSIM s//V1avfD2QE3ZmKtjNwHDNvxveQ37iVcXPL9TfBy+3sO0qB+ZW5NiNWeblgUIjkbxaz Gu8jpLqdRHEFMQM2cW9oz7IZLu3q+t3pm5xM5xMbTr0UPz8Cs6VuCEN1oa55a0FPoZVt SdnGbqFwT+L+535VUCP9RQYOXo95KnCgfj7n3NKNcLuTnsjaxwcGOt2ozr2HY3GxuAgD U1ss+wJ4wejVAfzv9ouigkchjVhcXF3vbRf/np15gDtEZWJE9+QNFOFevrHZ3cJGOztz +7jg== 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 f34si6821934plf.258.2019.05.10.02.26.36; Fri, 10 May 2019 02:26:52 -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 S1727262AbfEJJYq (ORCPT + 99 others); Fri, 10 May 2019 05:24:46 -0400 Received: from foss.arm.com ([217.140.101.70]:40896 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727160AbfEJJYq (ORCPT ); Fri, 10 May 2019 05:24:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9A7F7A78; Fri, 10 May 2019 02:24:45 -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 1B2FC3F738; Fri, 10 May 2019 02:24:42 -0700 (PDT) Date: Fri, 10 May 2019 10:24:37 +0100 From: Sudeep Holla To: Amit Kucheria Cc: Niklas Cassel , Lorenzo Pieralisi , Andy Gross , David Brown , Rob Herring , Mark Rutland , Jorge Ramirez-Ortiz , Lina Iyer , Ulf Hansson , Bjorn Andersson , linux-arm-msm , DTML , Sudeep Holla , Linux Kernel Mailing List Subject: Re: [PATCH] arm64: dts: qcom: qcs404: Add PSCI cpuidle support Message-ID: <20190510091158.GA10284@e107155-lin> References: <20190508145600.GA26843@centauri> 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, May 09, 2019 at 11:19:23PM +0530, Amit Kucheria wrote: > (Adding Lorenzo and Sudeep) > > On Wed, May 8, 2019 at 8:26 PM Niklas Cassel wrote: > > > > On Wed, May 08, 2019 at 02:48:19AM +0530, Amit Kucheria wrote: > > > On Tue, May 7, 2019 at 1:01 AM Niklas Cassel wrote: > > > > > > > > Add device bindings for CPUs to suspend using PSCI as the enable-method. > > > > > > > > Signed-off-by: Niklas Cassel > > > > --- > > > > arch/arm64/boot/dts/qcom/qcs404.dtsi | 15 +++++++++++++++ > > > > 1 file changed, 15 insertions(+) > > > > > > > > diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi > > > > index ffedf9640af7..f9db9f3ee10c 100644 > > > > --- a/arch/arm64/boot/dts/qcom/qcs404.dtsi > > > > +++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi > > > > @@ -31,6 +31,7 @@ > > > > reg = <0x100>; > > > > enable-method = "psci"; > > > > next-level-cache = <&L2_0>; > > > > + cpu-idle-states = <&CPU_PC>; > > > > }; > > > > > > > > CPU1: cpu@101 { > > > > @@ -39,6 +40,7 @@ > > > > reg = <0x101>; > > > > enable-method = "psci"; > > > > next-level-cache = <&L2_0>; > > > > + cpu-idle-states = <&CPU_PC>; > > > > }; > > > > > > > > CPU2: cpu@102 { > > > > @@ -47,6 +49,7 @@ > > > > reg = <0x102>; > > > > enable-method = "psci"; > > > > next-level-cache = <&L2_0>; > > > > + cpu-idle-states = <&CPU_PC>; > > > > }; > > > > > > > > CPU3: cpu@103 { > > > > @@ -55,12 +58,24 @@ > > > > reg = <0x103>; > > > > enable-method = "psci"; > > > > next-level-cache = <&L2_0>; > > > > + cpu-idle-states = <&CPU_PC>; > > > > }; > > > > > > > > L2_0: l2-cache { > > > > compatible = "cache"; > > > > cache-level = <2>; > > > > }; > > > > + > > > > + idle-states { > > > > > > entry-method="psci" property goes here. I have a patch fixing it for 410c ;-) > > > > > > I don't think the psci_cpuidle_ops will even get called without this. > > > > Hello Amit, > > > > I added debug prints in psci_cpu_suspend_enter() and arm_cpuidle_suspend() > > when verifying this patch, and psci_cpu_suspend_enter() is indeed called, > > with the correct psci suspend parameter. > > > > The output from: > > grep "" /sys/bus/cpu/devices/cpu0/cpuidle/state?/* > > also looks sane. > > > > However, if 'entry-method="psci"' is required according to the DT binding, > > perhaps you can send a 2/2 series that fixes both this patch and msm8916 ? > > Last time I discussed this with Lorenzo and Sudeep (on IRC), I pointed > out that entry-method="psci" isn't checked for in code anywhere. Let's > get their view on this for posterity. > Yes entry-method="psci" is required as per DT binding but not checked in code on arm64. We have CPU ops with idle enabled only for "psci", so there's not need to check. Once we have DT schema validation, this will be caught, so it's better to fix it. > What does entry-method="psci" in the idle-states node achieve that > enable-method="psci" in the cpu node doesn't achieve? (Note: enable- > vs. entry-). > From DT binding perspective, we can have different CPU enable-method and CPU idle entry-method. However on arm64, it's restricted to PSCI only. I need to check what happens on arm32 though, as the driver invocation happens via CPUIDLE_METHOD_OF_DECLARE. > The enable-method property is the one that sets up the > psci_cpuidle_ops callbacks through the CPUIDLE_METHOD_OF_DECLARE > macro. > Indeed. > IOW, if we deprecated the entry-method property, everything would > still work, wouldn't it? Why do you want to deprecated just because Linux kernel doesn't want to use it. That's not a valid reason IMO. > Do we expect to support PSCI platforms that might have a different > entry-method for idle states? Not on ARM64, but same DT bindings can be used for idle-states on say RISC-V and have some value other than "psci". > Should I whip up a patch removing entry-method? Since we don't check > for it today, it won't break the old DTs either. > Nope, I don't think so. But if it's causing issues, we can look into it. I don't want to restrict the use of the bindings for ARM/ARM64 or psci only. -- Regards, Sudeep