Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5142328ybl; Tue, 10 Dec 2019 00:58:40 -0800 (PST) X-Google-Smtp-Source: APXvYqyvvXV7EDkdiKHoaqeGVToDnCdCN91KBHzoM49XDpKMJp6EoGxxfkxiq744MNKXkoLfs9hB X-Received: by 2002:aca:b1d4:: with SMTP id a203mr3032983oif.150.1575968320568; Tue, 10 Dec 2019 00:58:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575968320; cv=none; d=google.com; s=arc-20160816; b=FAvSiILH4qEqmIlp6PzZj09X5mEFUvZyd9uzbsnxa9TBMdJdW3N++7YVO55nVJWSNv 9gh7AmnwCCv4a1/eGZ4rZgjyduD2aNKCqr6SiBvn4XsRwx1YV1EQKCIh9udXLjyqBJlF CuebMZ9jJiy0+M2WRHZnI7zhje8xNEpeo8gjBxp5vDOhPQWNgYAZX3bSRIV7E1JLUgpv ZOFKAqYp++7A8AqKvnanx/EM+p9/lMYzexO5tVJLmCW64CclD0fxgmVTT29r0HnKzV1r DvUnP48+4j/wG1PwuOY8WPF2fkPBSlaPa3Np6EriJlaKnxv5i6FEAtA6E+w3AcdM1UDo 8EdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:autocrypt :from:references:cc:to:subject; bh=ULx+kwPhh3jxHpz8lFKy0PkIg0VJ7+HY86so5HMBY58=; b=kw/0PVw5ZbysbTs+mHfBP6Fmng7rbGkA8GewSIPxAiO9cuw4HQFUm0P5KNtryc05IN fksDNvf3Eoghl/IPpSw7He+Y5PWOp1rydm+kizkWJiBAWeeu5OWJk2OCBlBGBZ0TIZEr heInH+FIgaJ88XMbgeQg7+Tb/Az72FHxil/K2wiptCRHYxA7nSfMh6UPeJub/9nHauvm VqVebE++PCfs5m4pRWeeDkHwcualLWheYNFsTEPcQ9rflGHL3qgPmkqUArrWXik0A/X+ +fwmMXyndrWkgw21Yu6lFiVPKEiu3uhyTdJktJzbQX+LGP4FGg6yRpo9X52XQ2AiRzE2 auvA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l16si1541003otr.106.2019.12.10.00.58.28; Tue, 10 Dec 2019 00:58:40 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727003AbfLJI5m (ORCPT + 99 others); Tue, 10 Dec 2019 03:57:42 -0500 Received: from comms.puri.sm ([159.203.221.185]:53830 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726847AbfLJI5m (ORCPT ); Tue, 10 Dec 2019 03:57:42 -0500 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 7331CE10EC; Tue, 10 Dec 2019 00:57:40 -0800 (PST) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1EBEY-GFNoox; Tue, 10 Dec 2019 00:57:39 -0800 (PST) Subject: Re: [PATCH V4 4/4] thermal/drivers/cpu_cooling: Rename to cpufreq_cooling To: Daniel Lezcano , edubezval@gmail.com, rui.zhang@intel.com Cc: rjw@rjwysocki.net, linux-pm@vger.kernel.org, viresh.kumar@linaro.org, amit.kucheria@linaro.org, linux-kernel@vger.kernel.org References: <20191204153930.9128-4-daniel.lezcano@linaro.org> <20191206113315.18954-1-martin.kepplinger@puri.sm> <7ae753bd-8330-6652-0207-0c884d722a6c@puri.sm> <2beb4758-d66d-e8d9-a64d-86ce361aa57f@linaro.org> <45b69f61-3a1f-be1f-ece9-4d1b79389353@linaro.org> From: Martin Kepplinger Autocrypt: addr=martin.kepplinger@puri.sm; keydata= mQINBFULfZABEADRxJqDOYAHfrp1w8Egcv88qoru37k1x0Ugy8S6qYtKLAAt7boZW+q5gPv3 Sj2KjfkWA7gotXpASN21OIfE/puKGwhDLAySY1DGNMQ0gIVakUO0ji5GJPjeB9JlmN5hbA87 Si9k3yKQQfv7Cf9Lr1iZaV4A4yjLP/JQMImaCVdC5KyqJ98Luwci1GbsLIGX3EEjfg1+MceO dnJTKZpBAKd1J7S2Ib3dRwvALdiD7zqMGqkw5xrtwasatS7pc6o/BFgA9GxbeIzKmvW/hc3Q amS/sB12BojyzdUJ3TnIoAqvwKTGcv5VYo2Z+3FV+/MJVXPo8cj2vmfxQx1WG4n6X0pK4X8A BkCKw2N/evMZblNqAzzGVtoJvqQYkzQ20Fm+d3wFl6lS1db4MB+kU13G8kEIE22Q3i6kx4NA N49FLlPeDabGfJUyDaZp5pmKdcd7/FIGH/HjShjx7g+LKSwWNMkDygr4WARAP4h8zYDZuNqe ofPvMLqJxHeexBPIGF/+OwMyTvM7otP5ODuFmq6OqjNPf1irJmkiFv3yEa+Ip0vZzwl4XvrZ U0IKjSy2rbRLg22NsJT0XVZJbutIXYSvIHGqSxzzfiOOLnRjR++fbeEoVlRJ4NZHDKCh3pJv LNd+j03jXr4Rm058YLgO7164yr7FhMZniBJw6z648rk8/8gGPQARAQABtC1NYXJ0aW4gS2Vw cGxpbmdlciA8bWFydGluLmtlcHBsaW5nZXJAcHVyaS5zbT6JAk4EEwEIADgWIQTyCCuID55C OTRobj9QA5jfWrOH0wUCXPSlkwIbAwULCQg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SKmJjlWpfkPKzyzjhGQVZrTZYnKAu471hRv8/6Dx5JuZJgDCnYanNx3DDreRMu/nq6TfaO ekMtxgNYb/8oDry09UFHbGHLsWn6oBo= Message-ID: <6599c416-e4c3-e87e-0952-3dd1c412f212@puri.sm> Date: Tue, 10 Dec 2019 09:57:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 In-Reply-To: <45b69f61-3a1f-be1f-ece9-4d1b79389353@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.12.19 20:29, Daniel Lezcano wrote: > On 09/12/2019 13:03, Daniel Lezcano wrote: >> On 09/12/2019 10:54, Martin Kepplinger wrote: >>> >>> >>> On 06.12.19 15:15, Daniel Lezcano wrote: >>>> On 06/12/2019 12:33, Martin Kepplinger wrote: >>>>> I tested this on the librem5-devkit and see the >>>>> cooling devices in sysfs. I configure ARM_PSCI_CPUIDLE, not ARM_CPUIDLE and >>>>> add the patch below in register the cooling device there. "psci_idle" >>>>> is listed as the cpuidle_driver. >>>>> >>>>> That's what I'm running, in case you want to see it all: >>>>> https://source.puri.sm/martin.kepplinger/linux-next/commits/next-20191205/librem5_cpuidle_mainline_atf >>>>> >>>>> so I add a trip temperature description like this: >>>>> https://source.puri.sm/martin.kepplinger/linux-next/commit/361f49f93ae2c477fd012790831cabd0ed976660 >>>>> >>>>> When I let the SoC heat up, cpuidle cooling won't kick it. In sysfs: >>>>> >>>>> catting the relevant files in /sys/class/thermal after heating up, >>>>> if that makes sense: >>>>> >>>>> 87000 >>>>> 85000 >>>>> 85000 >>>>> thermal-cpufreq-0 >>>>> 1 >>>>> thermal-idle-0 >>>>> 0 >>>>> thermal-idle-1 >>>>> 0 >>>>> thermal-idle-2 >>>>> 0 >>>>> thermal-idle-3 >>>>> 0 >>>>> >>>>> with ARM_CPUIDLE instead of ARM_PSCI_CPUIDLE (and registering the cooling dev >>>>> during cpuidle-arm.c init) I won't have a cpuidle driver and thus no cpu-sleep >>>>> state at all. >>>>> >>>>> Can you see where the problem here lies? >>>> >>>> Yes, I removed the registration via the DT. >>>> >>>> Can you try the following: >>>> >>>> diff --git a/drivers/cpuidle/dt_idle_states.c >>>> b/drivers/cpuidle/dt_idle_states.c >>>> index d06d21a9525d..01367ddec49a 100644 >>>> --- a/drivers/cpuidle/dt_idle_states.c >>>> +++ b/drivers/cpuidle/dt_idle_states.c >>>> @@ -13,6 +13,7 @@ >>>> #include >>>> #include >>>> #include >>>> +#include >>>> #include >>>> #include >>>> >>>> @@ -205,6 +206,9 @@ int dt_init_idle_driver(struct cpuidle_driver *drv, >>>> err = -EINVAL; >>>> break; >>>> } >>>> + >>>> + cpuidle_of_cooling_register(state_node, drv); >>>> + >>>> of_node_put(state_node); >>>> } >>>> >>>> That's a hack for the moment. >>>> >>> >>> thanks. I could test that successfully. The only question would be: Is >>> is intentional how "non-aggressive" the cooling driver cools? I would >>> have expected it to basically inject more idle cycles earlier. I'd set >>> 75 degrees as trip point and at 85 degress is would only inject about 30 >>> (of 100). > > By the way, how many CPUs are injecting idle cycle when the mitigation > happens ? all 4 are injecting the same. > >>> You describe the "config values" in question in the documentation, but >>> I'm not sure what's the correct way to change them. >> >> That is difficult to say without knowing the board behavior. Are you >> able to profile the temperature with the load? How fast the temperature >> increases? The aggressive behavior of the cooling device will depend on >> the governor which depends on the slope of the temperature increase and >> the sampling. >> >> Can you give the pointer to the git tree with the DT definition of your >> board? https://source.puri.sm/martin.kepplinger/linux-next/blob/next-20191205/librem5_cpuidle_mainline_atf/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts you can browse in that branch. >> >> You can try by changing the idle duration to 10ms instead of the default >> 4ms. where is that set? >> >> You can also change the cooling states in the DT <&state 20 70>, so it >> will begin to mitigate at state 20. But I wouldn't recommend that. where would we assign that? I'm not sure who reads that -.- it's still something to consider, but a longer idle duration makes more sense, yes. >> >> Do you have the energy power model, so we can try with the IPA governor? >> >> thanks for the reminder. I'd look at that later. martin