Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2438289yba; Fri, 10 May 2019 11:31:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9Y6TrG0F+xC5VbAVFpNtV4KhYg6skiJ6xR2wWAhK4MMEgvjm65/c/CJgtHRfWJgEO0LEK X-Received: by 2002:a63:a449:: with SMTP id c9mr15795002pgp.149.1557513071347; Fri, 10 May 2019 11:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557513071; cv=none; d=google.com; s=arc-20160816; b=RVwNontzT3xSZXfc9Kji13sVQks+4XPZzLTgwq2dfBQU5QnkiE5+vXk60fRqPKCoKy CqHlwxdCVlGhDDNN/+B/fg90WgbFqckXtyLcFaVI1i5F6vJ9wUj2FsMMC8hh+V8P6HBc 3+REP4xjcp/58aW6pS5oTqSVCc4ifVN3UqPauB+IwBABSBqc8MFgmvLp6kNU7FPq8WCC tOSA/eYRJr8PPmLdrRrnQKDWnH4JyadnORblPWkKvhdxSgnVxInV4tQ/S/m0gp1GJqmo kBmx1w0YHA9NeQpX8uqxLYS28UPsb8B17KOI5bmhWMFXFv25wYLkLDI5u068aRWiHL2K x39w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=53B459eecvRty+a3wV9xVIaRrF5O7M+rhPq+rsdt49Q=; b=UuavKfMt2ur8njdbLq4RqBp2mdqmKpNyofD2HiVU++TJzTiqA0G0ab1x/pI2bZ9+5t CSrx5y78GonDd98VU7tycJUJ8YLHrtBdQ3uBj5HBLmmodRoJuun1T7U/MstEltxs/cv1 k2P0mfHu03n1RkOqhqM8FKqcuS5WPg3KT2dcjvHq8TUOpbGMdJLzm/E5umnYLilHXk0B 0LwjOt9Bv9yU5uR64qE70Ernt3ff63gfD6lvZ7lBC7uaZBVxU4xYHEaF1Bqemuz94m5O BkJE7ERKjr6Z+3LOQFk6aVqQRgQCQWOpZVOhit6qj2XpeUmkCKmvMSg9Te647KlC49OE 9DXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cg00A8UF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c29si8217345pgc.370.2019.05.10.11.30.54; Fri, 10 May 2019 11:31:11 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Cg00A8UF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727876AbfEJS2x (ORCPT + 99 others); Fri, 10 May 2019 14:28:53 -0400 Received: from mail-ua1-f66.google.com ([209.85.222.66]:43030 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727642AbfEJS2w (ORCPT ); Fri, 10 May 2019 14:28:52 -0400 Received: by mail-ua1-f66.google.com with SMTP id 94so2462089uaf.10 for ; Fri, 10 May 2019 11:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=53B459eecvRty+a3wV9xVIaRrF5O7M+rhPq+rsdt49Q=; b=Cg00A8UFLYkETfa0fNN/fBZTQ/WB3tM0tBvqcgmsD7y4Qnh+T7w5qI3un3uJFEYnzl KaC1ZQ/e9h8U5x1HQqzOqNI+6QLjLi/9TFwZV2s5ZCpnbc93Q+uelEF4LDdko9hbTWIF qGhDp/rhVSoIR1YCxVfG+VsqcQf+Yd0U54jPTVl1qycbXo2zKhtQGbXG2QYvHgQQ3MYy MINutBZLASFsyKnRhT4dShy9e9JHBIsnDYytNtgzXxVPJULGq0ypi0kXFh3+jCuckYps rDP7Xjq0ehMyZeT2eXWFoObjJNJn2iG704TlGzr7DBAVgSeiKZfsnMw2fDgzI8Qw7I6n OMXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=53B459eecvRty+a3wV9xVIaRrF5O7M+rhPq+rsdt49Q=; b=PZa4SjWrGgC/LdXYqGD0qM5STFFWos6dhLtXJe99EN6w1FcqjwwshdJFyV6GNB1y/j Fqw9kkUHRH4KkZBPegSArghPO920WcJWd5cK2JysQ6G9JZufk/ofgtaxbCxEbFMltQCm BFkCqRdtN9QMg/MUkRn45Su/8h9K7JjYCnUZsnglx6zCjpMjJN+TNho4a1eiOMKC2fBr jL/Eaa9+KcSEVTj2ruQVFd8wZ9USrUm35U0bQQiwm+jeIJp3/UVWEhdT2yD8U8uty/ky y88bmsUGBRkqmic2UXNUmGddKFIzm1DYqrRxmCEB8L7ah9gMlvSN2MISu157gSkeYERE YO4A== X-Gm-Message-State: APjAAAW0DDuZ9lI58w/rIVU3LjucL7nSK+2WkfXPRWF+kbxc4CJKBuTU XkhrySxGSkhN25tK+lAFnc2p1BdhgXZj6ai+WdDUcw== X-Received: by 2002:ab0:154e:: with SMTP id p14mr6334650uae.48.1557512931577; Fri, 10 May 2019 11:28:51 -0700 (PDT) MIME-Version: 1.0 References: <20190508145600.GA26843@centauri> <20190510091158.GA10284@e107155-lin> In-Reply-To: <20190510091158.GA10284@e107155-lin> From: Amit Kucheria Date: Fri, 10 May 2019 23:58:40 +0530 Message-ID: Subject: Re: [PATCH] arm64: dts: qcom: qcs404: Add PSCI cpuidle support To: Sudeep Holla 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 , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 10, 2019 at 2:54 PM Sudeep Holla wrote: > > 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. I don't see it being checked on arm32 either. > 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. Fair enough. Just want to make sure that it isn't some vestigial property that was never used. Do you know if another OS is actually using it? > > 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". Both enable-method and entry-method properties are currently only used (and documented) for ARM platforms. Hence this discussion about deprecation of one of them. > > 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. Only a couple of minor issues: 1. There is a trickle of DTs that need fixing up every now and then because they don't use entry-method in their idle-states node. Schema validation ought to fix that. 2. A property that isn't ready by any code is a bit confusing. Perhaps we can mention something to the effect in the documentation? Regards, Amit