Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp863103pxb; Wed, 1 Sep 2021 11:33:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTgECZ+Vbwxg185kBNJ2qlozFcfYrS8pGIZ5pTD7cX9Ms6e1knNPujN4btab90NlXL1aJx X-Received: by 2002:a92:d9c2:: with SMTP id n2mr615382ilq.214.1630521219164; Wed, 01 Sep 2021 11:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630521219; cv=none; d=google.com; s=arc-20160816; b=jCVJVN3nuEEt78PTNbUTSnfk/ftGHWC/Rr4Qxq2AJstzRd4egnwMjsFQte2ZrYciVx pzIeckou/ZOMKIOSNr8tEWmITM0alPN7rbqpomMyNK7C/16UbMYBDF1gWcEh1C5Q11uL 4POtOTrsG2de5miLSbb4ZtwABfFJauq6NeR4qV+Uf0tmy9BuwdHCaH3u2UZKaOqYNNHo 0E01luSGP3j087FHzyRLzY687K1o9C3AytJhjpnjwPbpbjtn0gHuCMdwvYuKHwzDKTFW HlknGA4Xicc8samuu0NxcApVmVeqEkV3NmLn2BxmUzEB8pf6lsbmHN2ms51eTTto3Lst FyIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2PEqSI/LB/RtsZM/DY+xZdLAE7IHqT/Sg3PnxqJqLVI=; b=EfG7E42Vz5MSydkzpTH72stn4yCciaYwgfesokGOPor9Rvp6ETl869bjimmuzIvXUM tzl6f7toBig1dXX6CYMp1RBkC6LJxwPcl0a+jXhgOEwAW69T6mfhFwNfxTzcqCkT0DYq nIzx2jknK5LgjWJjti7SiecoH80oij0+FPMWAZBhB4kxd0I8AOtPtnyu75SEdmPzNQPz swEcQ9jBAYw2/OROR0Dj8zicwDr+OFKZGqAsgk+kXjOjQEUO7ln5SzWr5AGtAzAgQNsW 1KvkQF0iytmF4IeXxW0Kj+ezvahGoINSjDeC/gi3afrXM9FyyJdZUK0gxDQGhPC6dtPv 337g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b4si391834ile.87.2021.09.01.11.33.27; Wed, 01 Sep 2021 11:33:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234164AbhIAScb (ORCPT + 99 others); Wed, 1 Sep 2021 14:32:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232127AbhIAScY (ORCPT ); Wed, 1 Sep 2021 14:32:24 -0400 Received: from m-r1.th.seeweb.it (m-r1.th.seeweb.it [IPv6:2001:4b7a:2000:18::170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61EC7C061760 for ; Wed, 1 Sep 2021 11:31:27 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (unknown [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id 8717D20157; Wed, 1 Sep 2021 20:31:25 +0200 (CEST) From: AngeloGioacchino Del Regno To: bjorn.andersson@linaro.org Cc: agross@kernel.org, robh+dt@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, konrad.dybcio@somainline.org, marijn.suijten@somainline.org, martin.botka@somainline.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, paul.bouchara@somainline.org, jeffrey.l.hugo@gmail.com, AngeloGioacchino Del Regno Subject: [PATCH 3/5] arm64: dts: msm8998: Fix CPU/L2 idle state latency and residency Date: Wed, 1 Sep 2021 20:31:21 +0200 Message-Id: <20210901183123.1087392-3-angelogioacchino.delregno@somainline.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210901183123.1087392-1-angelogioacchino.delregno@somainline.org> References: <20210901183123.1087392-1-angelogioacchino.delregno@somainline.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The entry/exit latency and minimum residency in state for the idle states of MSM8998 were ..bad: first of all, for all of them the timings were written for CPU sleep but the min-residency-us param was miscalculated (supposedly, while porting this from downstream); Then, the power collapse states are setting PC on both the CPU cluster *and* the L2 cache, which have different timings: in the specific case of L2 the times are higher so these ones should be taken into account instead of the CPU ones. This parameter misconfiguration was not giving particular issues because on MSM8998 there was no CPU scaling at all, so cluster/L2 power collapse was rarely (if ever) hit. When CPU scaling is enabled, though, the wrong timings will produce SoC unstability shown to the user as random, apparently error-less, sudden reboots and/or lockups. This set of parameters are stabilizing the SoC when CPU scaling is ON and when power collapse is frequently hit. Signed-off-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/qcom/msm8998.dtsi | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi index c83e54a84bca..625d0fd7e33d 100644 --- a/arch/arm64/boot/dts/qcom/msm8998.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi @@ -309,38 +309,42 @@ idle-states { LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 { compatible = "arm,idle-state"; idle-state-name = "little-retention"; + /* CPU Retention (C2D), L2 Active */ arm,psci-suspend-param = <0x00000002>; entry-latency-us = <81>; exit-latency-us = <86>; - min-residency-us = <200>; + min-residency-us = <504>; }; LITTLE_CPU_SLEEP_1: cpu-sleep-0-1 { compatible = "arm,idle-state"; idle-state-name = "little-power-collapse"; + /* CPU + L2 Power Collapse (C3, D4) */ arm,psci-suspend-param = <0x40000003>; - entry-latency-us = <273>; - exit-latency-us = <612>; - min-residency-us = <1000>; + entry-latency-us = <814>; + exit-latency-us = <4562>; + min-residency-us = <9183>; local-timer-stop; }; BIG_CPU_SLEEP_0: cpu-sleep-1-0 { compatible = "arm,idle-state"; idle-state-name = "big-retention"; + /* CPU Retention (C2D), L2 Active */ arm,psci-suspend-param = <0x00000002>; entry-latency-us = <79>; exit-latency-us = <82>; - min-residency-us = <200>; + min-residency-us = <1302>; }; BIG_CPU_SLEEP_1: cpu-sleep-1-1 { compatible = "arm,idle-state"; idle-state-name = "big-power-collapse"; + /* CPU + L2 Power Collapse (C3, D4) */ arm,psci-suspend-param = <0x40000003>; - entry-latency-us = <336>; - exit-latency-us = <525>; - min-residency-us = <1000>; + entry-latency-us = <724>; + exit-latency-us = <2027>; + min-residency-us = <9419>; local-timer-stop; }; }; -- 2.32.0