From patchwork Thu Nov 19 15:40:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashwin Chaugule X-Patchwork-Id: 7658371 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-acpi@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 45B92BF90C for ; Thu, 19 Nov 2015 15:40:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F1B32066A for ; Thu, 19 Nov 2015 15:40:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 993C820651 for ; Thu, 19 Nov 2015 15:40:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758837AbbKSPkR (ORCPT ); Thu, 19 Nov 2015 10:40:17 -0500 Received: from mail-qk0-f172.google.com ([209.85.220.172]:34230 "EHLO mail-qk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758331AbbKSPkP (ORCPT ); Thu, 19 Nov 2015 10:40:15 -0500 Received: by qkfo3 with SMTP id o3so26750733qkf.1 for ; Thu, 19 Nov 2015 07:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uB5MYlW9KC7+ZUzJqRe1ucjVLuDyXqfoniszX0MNKws=; b=Gw4b82+uJshFK5hIazW1l84qxe1hg9hwIYo4ZpbITmwGOSNf/dmMHRQDFu+GtMUnsn Yyp5jKOc/O0pCkSMLqEvQ/WS3QPUIPet3NWZh6fvE3KkpLUImHoTg9NhmVM5MjsagnI2 2yVa3sxjTPfGB5q+SC7WVlROA+US/b6VIf1YKEY8bQIchO0eaLhgVHoXKzEOC9yIwabl j/08dNnrkXpIBtTz6apfpnF0UnKRdXAEQ72yaRVHnKTP7E3hYoPJYQ0O5iH77Q5V6J5f yLVKANxB/hntesF2E0JsoZG1ZwaZNGBz8QuuNGTc9MnTYLtltPUJJvklamPGRVnb4PHt nLdA== 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:in-reply-to :references; bh=uB5MYlW9KC7+ZUzJqRe1ucjVLuDyXqfoniszX0MNKws=; b=IVb4FZEjJCcQABwKjFOUnlT5SSVKqDdxr6YulR+CR/3GDxMCmvPoSI2/EtNYaeiO0M OpUWo9KrOPX5Uu+cWnVSw+8OV6V+8mTJwUR4G67hUB3++HZzgQRYGNZUm1KR6KfpS1CE l+oyJ+fxVeAt34f+EVY8iFS9sqXLWxBgutCrixKKC/AfJUzfObxVhJsvICwPd7EJpoRp t56EsNhfx1RyEuwqHm5V/fX/3ZWM4ldq0FkhwRV7ARhdDIk0FJyf5S/z9wto8FblGRrH b3TK2DIoXxN3e94wNqcDzGW/SuCayN4zrL5QGGL/dOyZJqEGH1+cA4N/p/R2V72Z07UE dabw== X-Gm-Message-State: ALoCoQl1V9mgWx4E/iYquqtUfyu/bhGLbbtgEePLbyqgVToEH5W/bcQb2dz+ie149neB+xe4hqcX X-Received: by 10.55.52.142 with SMTP id b136mr7791135qka.100.1447947614248; Thu, 19 Nov 2015 07:40:14 -0800 (PST) Received: from esagroth.lan ([98.122.160.202]) by smtp.gmail.com with ESMTPSA id p82sm2473727qha.17.2015.11.19.07.40.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Nov 2015 07:40:12 -0800 (PST) From: Ashwin Chaugule To: rjw@rjwysocki.net Cc: rafael@kernel.org, linux-acpi@vger.kernel.org, linaro-acpi@lists.linaro.org, patches@linaro.org, Ashwin Chaugule Subject: [PATCH] CPPC: Initialize and check CPUFreq CPU co-ord type correctly Date: Thu, 19 Nov 2015 10:40:07 -0500 Message-Id: <1447947607-10822-1-git-send-email-ashwin.chaugule@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 The CPU policy struct indicates the co-ordination type for all CPUs of a common freq domain. Initialize it correctly using the CPU specific data gathered from CPPC ACPI lib via acpi_get_psd_map(). The PSD object is optional, so the cpu->shared_type can also be 0. So instead of assuming any value other than SW_ANY(0xFD) is unsupported, explictly check if shared_type is SW_ALL and then bail. Signed-off-by: Ashwin Chaugule --- drivers/cpufreq/cppc_cpufreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index e8cb334..7c0bdfb 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -98,10 +98,11 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) policy->max = cpu->perf_caps.highest_perf; policy->cpuinfo.min_freq = policy->min; policy->cpuinfo.max_freq = policy->max; + policy->shared_type = cpu->shared_type; if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) cpumask_copy(policy->cpus, cpu->shared_cpu_map); - else { + else if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL) { /* Support only SW_ANY for now. */ pr_debug("Unsupported CPU co-ord type\n"); return -EFAULT;