lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 6 Dec 2019 15:15:54 +0100
From:   Daniel Lezcano <daniel.lezcano@...aro.org>
To:     Martin Kepplinger <martin.kepplinger@...i.sm>, edubezval@...il.com,
        rui.zhang@...el.com
Cc:     rjw@...ysocki.net, linux-pm@...r.kernel.org,
        viresh.kumar@...aro.org, amit.kucheria@...aro.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH V4 4/4] thermal/drivers/cpu_cooling: Rename to
 cpufreq_cooling

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 <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/cpu_cooling.h>
 #include <linux/of.h>
 #include <linux/of_device.h>

@@ -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.


> ---
>  drivers/cpuidle/cpuidle-psci.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c
> index f3c1a2396f98..de6e7f444a66 100644
> --- a/drivers/cpuidle/cpuidle-psci.c
> +++ b/drivers/cpuidle/cpuidle-psci.c
> @@ -8,6 +8,7 @@
>  
>  #define pr_fmt(fmt) "CPUidle PSCI: " fmt
>  
> +#include <linux/cpu_cooling.h>
>  #include <linux/cpuidle.h>
>  #include <linux/cpumask.h>
>  #include <linux/cpu_pm.h>
> @@ -195,6 +196,8 @@ static int __init psci_idle_init_cpu(int cpu)
>  	if (ret)
>  		goto out_kfree_drv;
>  
> +	cpuidle_cooling_register(drv);
> +
>  	return 0;
>  
>  out_kfree_drv:
> 


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ