From patchwork Wed Jul 1 04:07:27 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: 6699881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 039C3C05AC for ; Wed, 1 Jul 2015 04:11:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 780C12066C for ; Wed, 1 Jul 2015 04:11:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94FA020666 for ; Wed, 1 Jul 2015 04:11:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZA9JX-0003U7-LR; Wed, 01 Jul 2015 04:07:59 +0000 Received: from mail-pa0-f43.google.com ([209.85.220.43]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZA9JV-0003Qy-1R for linux-arm-kernel@lists.infradead.org; Wed, 01 Jul 2015 04:07:57 +0000 Received: by pactm7 with SMTP id tm7so15991136pac.2 for ; Tue, 30 Jun 2015 21:07:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fXbJFQCKgIK9jorl6y+TDg08LlaMW9qGJSMJ5vg+Xbg=; b=Sd7rFnZ19XNunygSHfPhvCwq7wegvLzWEfdF55wjnoKJDBm4HrFC5HMDO5vwulS4Sl 0UIRAOD+EP3RLrxyynb4oKrSepYEQb8rUw5E4mYHuofCjYDiYUG6NUQfD4Y2QWKAgDXL uRJLok0msJk9NLPjCBEhI9u1G9KXq5ZLzll4GUxEhSiJteNqWhINJRnXYzS+/wFR/k+U oTCYBrQt996I969Qfje2XqzCp0oXPebqJLJeL87MYMMqLr3ok20UAC/lXwxm6JLFJv4W QTvWmYJiyvSUiLWAOsG0foaZoo5Uhy6b6XEL3A1ZnJlbCjyG8hhLQOz0m28aBsosKzOE +Gaw== X-Gm-Message-State: ALoCoQlW6n61XDfbBj2IV8VtO165Ue7Yw4pfJVi9OTnWRkZE2MAigL3Ou8CDGqpVvH9CifNLGFIF X-Received: by 10.67.7.162 with SMTP id dd2mr49317169pad.151.1435723655167; Tue, 30 Jun 2015 21:07:35 -0700 (PDT) Received: from localhost.localdomain ([124.219.30.17]) by mx.google.com with ESMTPSA id nb10sm465564pdb.76.2015.06.30.21.07.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jun 2015 21:07:34 -0700 (PDT) From: Pi-Cheng Chen To: Zhang Rui , Eduardo Valentin Subject: [PATCH] thermal: cpu_cooling: Iterate over all CPUs in clip_cpu mask to get frequency table Date: Wed, 1 Jul 2015 12:07:27 +0800 Message-Id: <1435723647-3354-1-git-send-email-pi-cheng.chen@linaro.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150630_210757_111916_E0471B47 X-CRM114-Status: GOOD ( 12.10 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 6509c61..d5e4ea8 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -776,7 +776,13 @@ __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) {