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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160603051145.GK16176@vireshk-i7>
Date:	Fri, 3 Jun 2016 10:41:45 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	Javi Merino <javi.merino@....com>
Cc:	Rafael Wysocki <rjw@...ysocki.net>,
	Amit Daniel Kachhap <amit.kachhap@...il.com>,
	Zhang Rui <rui.zhang@...el.com>,
	Eduardo Valentin <edubezval@...il.com>,
	Linaro Kernel Mailman List <linaro-kernel@...ts.linaro.org>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V2 2/6] cpufreq: Remove cpufreq_frequency_get_table()

On 02-06-16, 19:02, Javi Merino wrote:
> On Thu, Jun 02, 2016 at 09:06:26PM +0530, Viresh Kumar wrote:
> > On 2 June 2016 at 20:29, Javi Merino <javi.merino@....com> wrote:
> > > In 5a31d594a973 ("cpufreq: Allow freq_table to be obtained for offline
> > > CPUs") you did the opposite: don't use cpufreq_cpu_get_raw() because
> > > it won't give you the policy of a cpu that is offline.  Now you are
> > > arguing that we should go back to cpufreq_cpu_get() which implicitly
> > > calls cpufreq_cpu_get_raw().  Won't we hit the same issue that
> > > 5a31d594a973 was trying to prevent: that we can't get a freq_table for
> > > a cpu that is offline?
> > 
> > Yes, that should be fixed. Thanks for letting me know about it :)
> 
> Ok, that was my only nit.  Other than that, it looks good to me.  For cpu_cooling.c 
> 
> Acked-by: Javi Merino <javi.merino@....com>

Thanks, I will be adding this to the original patch.

diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 63f760869651..4d678cfc81b1 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -792,10 +792,12 @@ __cpufreq_cooling_register(struct device_node *np,
        struct cpufreq_cooling_device *cpufreq_dev;
        char dev_name[THERMAL_NAME_LENGTH];
        struct cpufreq_frequency_table *pos, *table;
+       struct cpumask temp_mask;
        unsigned int freq, i, num_cpus;
        int ret;
 
-       policy = cpufreq_cpu_get(cpumask_first(clip_cpus));
+       cpumask_and(&temp_mask, clip_cpus, cpu_online_mask);
+       policy = cpufreq_cpu_get(cpumask_first(&temp_mask));
        if (!policy) {
                pr_debug("%s: CPUFreq policy not found\n", __func__);
                return ERR_PTR(-EPROBE_DEFER);


This will also make this problem clear, otherwise it was just hidden in the
function call which was really easy to miss, as I missed it as well :(

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ