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: 57026 Delivered-To: patches@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp3255903lbb; Thu, 19 Nov 2015 07:40:16 -0800 (PST) X-Received: by 10.140.29.33 with SMTP id a30mr7378702qga.88.1447947614615; Thu, 19 Nov 2015 07:40:14 -0800 (PST) Return-Path: Received: from mail-qk0-x22c.google.com (mail-qk0-x22c.google.com. [2607:f8b0:400d:c09::22c]) by mx.google.com with ESMTPS id n94si7149208qgd.127.2015.11.19.07.40.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Nov 2015 07:40:14 -0800 (PST) Received-SPF: pass (google.com: domain of ashwin.chaugule@linaro.org designates 2607:f8b0:400d:c09::22c as permitted sender) client-ip=2607:f8b0:400d:c09::22c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ashwin.chaugule@linaro.org designates 2607:f8b0:400d:c09::22c as permitted sender) smtp.mailfrom=ashwin.chaugule@linaro.org; dkim=pass header.i=@linaro-org.20150623.gappssmtp.com Received: by qkao63 with SMTP id o63so26714097qka.2 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=KfIZxDV3YVSVcQyupY3vyt1zDQdwQAE/OuDEneW7vF8gOFfPO+wtZ4Bf51HMuze2LK YIYdp89ip9oeZZh/2C16HlPg7vEum7EQIHPHZ3ZznNrdhC6SEEsOpk9nFggWTdcBqwks 1REDWiP6K01+ZQdbSbRpgwRrGeOaJCrkdihEErW75RHQ1GteW9dC1zZtpGtM9KIOGidU gMMlDAV/nZ5tUc/K1LF6YL7ETSR/EIMfipCmFNEiINGphFsTvOnvPHyMPMpA/3kTMCbM qNfHsCEo1POLk9TTHmbavxNnqkShGLgBOIsKxm/KYO22kaQWSSy8NxG5HTycvKyXBJbg tDzg== X-Gm-Message-State: ALoCoQko5HTtd/mkH2/LimzHRdQrxumJvdFvqffmWTaDfbiLan68S8imgAiCfTw2FoCRHJoxfmFQ X-Received: by 10.55.52.142 with SMTP id b136mr7791135qka.100.1447947614248; Thu, 19 Nov 2015 07:40:14 -0800 (PST) Return-Path: 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: 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(-) -- 1.9.1 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;