From patchwork Wed Jul 1 04:13:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "pi-cheng.chen" X-Patchwork-Id: 50506 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 31B79218E4 for ; Wed, 1 Jul 2015 04:13:39 +0000 (UTC) Received: by lbcui10 with SMTP id ui10sf2356187lbc.0 for ; Tue, 30 Jun 2015 21:13:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=5HzdMT3f2+/UhMTwvYgepuMOuqNkWuG4076ja0dELKw=; b=iA5J5DGQPCIxxZt3g5OQM3eww/fdsFSY378lqEr8LUptxVoL3qyBHIYfu2sVrQ/+lc ehttsfUB7NIrZY7SoMfn2F3Elh3n60EhRxo+K9xELGdzl5GNKNZUVQoKD9J9EQZR4mEw MkOWJ2arYlQoDkYxuupkpRjbbnMlJIfwLvi4oM0alHK/Cs01TqOlojYo7PBrVZ8FgcsY nBLYllETpkbIuiet/uLn827shzuqmObNrpZh0HFHsx/nbW1IbU//+htlJcRubYf3TipB GrwgiPia9huQVU52TckF/3jYL7N6nw1FNZprLUmCYBtQz805tQnrfy610qS1MQ4Ow13B XUfg== X-Gm-Message-State: ALoCoQmyJaStfy21BnE6vqsULw3+eveoknR/WuVVrFDRS4g+3/tlrMOT07DxH94D/jucXw2YyBkM X-Received: by 10.152.27.130 with SMTP id t2mr15993779lag.2.1435724018444; Tue, 30 Jun 2015 21:13:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.36 with SMTP id t4ls129785lal.99.gmail; Tue, 30 Jun 2015 21:13:38 -0700 (PDT) X-Received: by 10.152.115.199 with SMTP id jq7mr22826563lab.113.1435724018261; Tue, 30 Jun 2015 21:13:38 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id k5si536557lag.54.2015.06.30.21.13.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jun 2015 21:13:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbnk3 with SMTP id k3so5377204lbn.1 for ; Tue, 30 Jun 2015 21:13:38 -0700 (PDT) X-Received: by 10.152.26.163 with SMTP id m3mr23005115lag.86.1435724018163; Tue, 30 Jun 2015 21:13:38 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp329020lbb; Tue, 30 Jun 2015 21:13:37 -0700 (PDT) X-Received: by 10.70.123.136 with SMTP id ma8mr50489290pdb.33.1435724016451; Tue, 30 Jun 2015 21:13:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dc4si1146230pdb.35.2015.06.30.21.13.35; Tue, 30 Jun 2015 21:13:36 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753472AbbGAEN2 (ORCPT + 29 others); Wed, 1 Jul 2015 00:13:28 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:36356 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751081AbbGAENW (ORCPT ); Wed, 1 Jul 2015 00:13:22 -0400 Received: by pdcu2 with SMTP id u2so18267372pdc.3 for ; Tue, 30 Jun 2015 21:13:21 -0700 (PDT) X-Received: by 10.66.221.39 with SMTP id qb7mr43263244pac.59.1435724001829; Tue, 30 Jun 2015 21:13:21 -0700 (PDT) Received: from localhost.localdomain ([124.219.30.17]) by mx.google.com with ESMTPSA id i5sm478539pat.42.2015.06.30.21.13.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jun 2015 21:13:21 -0700 (PDT) From: Pi-Cheng Chen To: Zhang Rui , Eduardo Valentin Cc: linux-pm@vger.kernel.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] thermal: cpu_cooling: Iterate over all CPUs in clip_cpu mask to get frequency table Date: Wed, 1 Jul 2015 12:13:14 +0800 Message-Id: <1435723994-3882-1-git-send-email-pi-cheng.chen@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435723647-3354-1-git-send-email-pi-cheng.chen@linaro.org> References: <1435723647-3354-1-git-send-email-pi-cheng.chen@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pi-cheng.chen@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Sorry for the mistake I made when cherry-picking the patch. Fix and resend again. __cpufreq_cooling_register() might fail if some CPU other than first one in clip_cpu mask is present earlier e.g. CPU hotplug. Iterate all CPUs in the mask to handle this case. Signed-off-by: Pi-Cheng Chen --- drivers/thermal/cpu_cooling.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 6509c61..5e90eb6 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -776,9 +776,14 @@ __cpufreq_cooling_register(struct device_node *np, char dev_name[THERMAL_NAME_LENGTH]; struct cpufreq_frequency_table *pos, *table; unsigned int freq, i, num_cpus; - int ret; + int ret, cpu; + + for_each_cpu(cpu, clip_cpus) { + table = cpufreq_frequency_get_table(cpu); + if (table) + break; + } - table = cpufreq_frequency_get_table(cpumask_first(clip_cpus)); if (!table) { pr_debug("%s: CPUFreq table not found\n", __func__); return ERR_PTR(-EPROBE_DEFER);