From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751393AbcFCFLv (ORCPT ); Fri, 3 Jun 2016 01:11:51 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:32993 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750824AbcFCFLt (ORCPT ); Fri, 3 Jun 2016 01:11:49 -0400 Date: Fri, 3 Jun 2016 10:41:45 +0530 From: Viresh Kumar To: Javi Merino Cc: Rafael Wysocki , Amit Daniel Kachhap , Zhang Rui , Eduardo Valentin , Linaro Kernel Mailman List , "linux-pm@vger.kernel.org" , Linux Kernel Mailing List Subject: Re: [PATCH V2 2/6] cpufreq: Remove cpufreq_frequency_get_table() Message-ID: <20160603051145.GK16176@vireshk-i7> References: <13d43ddfe208a9b387fe0fd247de069ba0332308.1464876229.git.viresh.kumar@linaro.org> <20160602145903.GA2966@e104805> <20160602180250.GC2966@e104805> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160602180250.GC2966@e104805> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 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