From patchwork Tue Dec 12 09:12:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 121492 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3871031qgn; Tue, 12 Dec 2017 01:12:59 -0800 (PST) X-Google-Smtp-Source: ACJfBot7O0AYG75XuGpGfu19zY+/cut5seDB2W/o18J3yQjN6IbY2TCJ7aaOe1Rpr3P0Hr/aZdHD X-Received: by 10.101.66.66 with SMTP id d2mr1440863pgq.244.1513069979805; Tue, 12 Dec 2017 01:12:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513069979; cv=none; d=google.com; s=arc-20160816; b=I9+WGoilkmgke+p2C5q4dqPP0Uk0FMC86tP9RamB4rJZBPnHZ0cIUPcw11ra/lkGaU rOBBX0pYbweZTXWsWM0wPbowlwjbDta09fZJV8NFoAH3U4DHN1G3bP3SmkhC/J4LvXqf mzBSU9uU4t3Fh5qW1DHoUQpqLJuYWkY3vjpAWAe9BzkEiXdRzBRdR8i+xfZnnkzL+dDB Cv3k9tSQVNT/V8e3Cg76IZvTUNG2RW/cDTOFEGsBgS4vmwxGlNnEzkq4WYJVMA8heeM1 E+NsdOwYnuRuJoay6TOJoKO8YsudDFnPEfQI+8caMAWzqtQmcVwb5oLcnmtN4mHE65nW QvgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=1zZXK1Y0b5Hxwj47/AF6hOm3fieaVnzT7Aj3gzx5AzU=; b=y4xzvs/hK4qnb5TPMo6LEfTXSwK9JmoUmozGJsJcCtddjaySGKZDe+KiNrELabzHGY hIj8AujrY5LXkOwQdn/W9oNP5u3JmmZVN83dzsk90oUr1/WCfwkc8m1Kr9oyZD0i8ZJJ m3/ZRG6/5yOfZ19LOn/lAvAldeeVFuRMwgonxo/d7Zl8FLPO93Vut3Y7+6kVOGNPN4TH BGz1PeegLwE0A+NNT9DFKbnFkPvqTlsVTJEoW1bPcJcWLA7q16R80MXvM+dRByeLS4vA DCiiET3Z2L7ObbA3FFD+RtaRWb7QA2bO20CkuVkxdJixw7kqL9lKYL97M+v1jc8gedeN HrfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XZJ40yrX; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (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 a14si11264691pgv.479.2017.12.12.01.12.59; Tue, 12 Dec 2017 01:12:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XZJ40yrX; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752102AbdLLJM6 (ORCPT + 6 others); Tue, 12 Dec 2017 04:12:58 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:44258 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751542AbdLLJMz (ORCPT ); Tue, 12 Dec 2017 04:12:55 -0500 Received: by mail-pg0-f65.google.com with SMTP id j9so12994424pgc.11 for ; Tue, 12 Dec 2017 01:12:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=p0iwURK5OC1MCcMQ/PhLIh409Vm9hwlGsEcB+YL2iTA=; b=XZJ40yrXGanTQq7hG94bE7hI9c+KiH08zcPDoYw2Urud8NyjcXBbPandtt4K4of9GD Bo8YWDZD2aC1m8THRKlZGeHRTthVOP8P85ks+erZg4AbFH1tobaextfLoLJFhlOpQT2P 3RqTlRo2xA68Re+v6t+z+UN6Bn8f5MN60/F6Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=p0iwURK5OC1MCcMQ/PhLIh409Vm9hwlGsEcB+YL2iTA=; b=Dmoqysvn4J6h7ojm0LYkW4LC1iESy/nQ5kDbI0NNaPxWUxd3jNXQ6fMIL5vWkWSd1u v7NFxKwfU06f5cffFl5e+MuOQ+qJBTNUs5F+NMrM+BdTOzUVu8xnKKMgnExxqL/06hT8 ubkY6+VEitrS+cABStDMiJMJpbuCWDcmgzczSr9nYknenQRt3xVxpUIpGWPS7QWkwv4M 4QIcOXnbgtF1+ezEnON2262Xz1Q53JZ/lPjW+PfZfsHqcn8hCSelL4s5QnU8XYO9ev8K JsRE0Y+yZYEgFM6a5KRlgOUBm6pLiNlRyhQpbLl8r9XHepQdCg7zcce4UUEsKdxiitZj BuVw== X-Gm-Message-State: AKGB3mIX5OlT1OgjfqR2rtjZs1toAR31Pvhdo0CfWGrOrxFRAsrz2Tlf ifwUk+VvtAtWNdWkNd/OOwToLqVWHXw= X-Received: by 10.159.204.146 with SMTP id t18mr1641815plo.236.1513069974892; Tue, 12 Dec 2017 01:12:54 -0800 (PST) Received: from localhost.localdomain (li159-223.members.linode.com. [173.230.149.223]) by smtp.gmail.com with ESMTPSA id p126sm25334413pga.58.2017.12.12.01.12.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Dec 2017 01:12:53 -0800 (PST) From: Leo Yan To: Wei Xu , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan , Vincent Guittot , Daniel Lezcano , Sudeep Holla , Soby Mathew Subject: [PATCH v2] arm64: dts: Hi3660: Fix up psci state id Date: Tue, 12 Dec 2017 17:12:33 +0800 Message-Id: <1513069954-22827-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Thanks a lot for Vincent Guittot careful work to find bug for 'CPU_NAP' idle state. From ftrace log we can observe CA73 CPUs can be easily waken up from 'CPU_NAP' state but the 'waken up' CPUs doesn't handle anything and sleep again; so there have tons of trace events for CA73 CPUs entering and exiting idle state. On Hi3660 CA73 has retention state 'CPU_NAP' for CPU idle, this state we set its psci parameter as '0x0000001' and from this parameter it can calculate state id is 1. Unfortunately ARM trusted firmware (ARM-TF) takes 1 as a invalid value for state id, so the CPU cannot enter idle state and directly bail out to kernel. We want to create good practice for psci parameters platform definition, so review the psci specification. The spec "ARM Power State Coordination Interface - Platform Design Document (ARM DEN 0022D)" recommends state ID in chapter "6.5 Recommended StateID Encoding". The recommended power state IDs can be presented by below listed values; and it divides into three fields, every field can use 4 bits to present power states corresponding to core level, cluster level and system level: 0: Run 1: Standby 2: Retention 3: Powerdown This commit changes psci parameter to compliance with the suggested state ID in the doc. Except we change 'CPU_NAP' state psci parameter to '0x0000002', this commit also changes 'CPU_SLEEP' and 'CLUSTER_SLEEP' state parameters to '0x0010003' and '0x1010033' respectively. Credits to Daniel, Sudeep and Soby for suggestion and consolidation. Cc: Vincent Guittot Cc: Daniel Lezcano Cc: Sudeep Holla Cc: Soby Mathew Signed-off-by: Leo Yan --- arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi index ab0b95b..99d5a46 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi +++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi @@ -147,7 +147,7 @@ CPU_NAP: cpu-nap { compatible = "arm,idle-state"; - arm,psci-suspend-param = <0x0000001>; + arm,psci-suspend-param = <0x0000002>; entry-latency-us = <7>; exit-latency-us = <2>; min-residency-us = <15>; @@ -156,7 +156,7 @@ CPU_SLEEP: cpu-sleep { compatible = "arm,idle-state"; local-timer-stop; - arm,psci-suspend-param = <0x0010000>; + arm,psci-suspend-param = <0x0010003>; entry-latency-us = <40>; exit-latency-us = <70>; min-residency-us = <3000>; @@ -165,7 +165,7 @@ CLUSTER_SLEEP_0: cluster-sleep-0 { compatible = "arm,idle-state"; local-timer-stop; - arm,psci-suspend-param = <0x1010000>; + arm,psci-suspend-param = <0x1010033>; entry-latency-us = <500>; exit-latency-us = <5000>; min-residency-us = <20000>; @@ -174,7 +174,7 @@ CLUSTER_SLEEP_1: cluster-sleep-1 { compatible = "arm,idle-state"; local-timer-stop; - arm,psci-suspend-param = <0x1010000>; + arm,psci-suspend-param = <0x1010033>; entry-latency-us = <1000>; exit-latency-us = <5000>; min-residency-us = <20000>;