From patchwork Thu Jul 26 12:28:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1242441 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5C7D9DFFC0 for ; Thu, 26 Jul 2012 12:29:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752189Ab2GZM3C (ORCPT ); Thu, 26 Jul 2012 08:29:02 -0400 Received: from co1ehsobe005.messaging.microsoft.com ([216.32.180.188]:39762 "EHLO co1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751266Ab2GZM27 (ORCPT ); Thu, 26 Jul 2012 08:28:59 -0400 Received: from mail160-co1-R.bigfish.com (10.243.78.229) by CO1EHSOBE015.bigfish.com (10.243.66.78) with Microsoft SMTP Server id 14.1.225.23; Thu, 26 Jul 2012 12:28:58 +0000 Received: from mail160-co1 (localhost [127.0.0.1]) by mail160-co1-R.bigfish.com (Postfix) with ESMTP id A37E21A012A; Thu, 26 Jul 2012 12:28:58 +0000 (UTC) X-Forefront-Antispam-Report: CIP:163.181.249.108; KIP:(null); UIP:(null); IPV:NLI; H:ausb3twp01.amd.com; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VPS0(zzzz1202hzz8275bhz2dh668h839hd24he5bhf0ah107ah) Received: from mail160-co1 (localhost.localdomain [127.0.0.1]) by mail160-co1 (MessageSwitch) id 134330573791906_11854; Thu, 26 Jul 2012 12:28:57 +0000 (UTC) Received: from CO1EHSMHS010.bigfish.com (unknown [10.243.78.234]) by mail160-co1.bigfish.com (Postfix) with ESMTP id 0A19DB4004E; Thu, 26 Jul 2012 12:28:57 +0000 (UTC) Received: from ausb3twp01.amd.com (163.181.249.108) by CO1EHSMHS010.bigfish.com (10.243.66.20) with Microsoft SMTP Server id 14.1.225.23; Thu, 26 Jul 2012 12:28:56 +0000 X-WSS-ID: 0M7RPC5-01-D1A-02 X-M-MSG: Received: from sausexedgep01.amd.com (sausexedgep01-ext.amd.com [163.181.249.72]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Axway MailGate 3.8.1) with ESMTP id 2E619102809D; Thu, 26 Jul 2012 07:28:52 -0500 (CDT) Received: from SAUSEXDAG02.amd.com (163.181.55.2) by sausexedgep01.amd.com (163.181.36.54) with Microsoft SMTP Server (TLS) id 8.3.192.1; Thu, 26 Jul 2012 07:29:09 -0500 Received: from storexhtp01.amd.com (172.24.4.3) by sausexdag02.amd.com (163.181.55.2) with Microsoft SMTP Server (TLS) id 14.1.323.3; Thu, 26 Jul 2012 07:28:53 -0500 Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp01.amd.com (172.24.4.3) with Microsoft SMTP Server id 8.3.213.0; Thu, 26 Jul 2012 08:28:52 -0400 Received: from dosorca.osrc.amd.com (dosorca.osrc.amd.com [165.204.15.106]) by gwo.osrc.amd.com (Postfix) with ESMTP id 40DE249C69F; Thu, 26 Jul 2012 13:28:51 +0100 (BST) From: Andre Przywara To: , "Rafael J. Wysocki" CC: Matthew Garrett , Andreas Herrmann , Thomas Renninger , , , Andre Przywara Subject: [PATCH 2/8] acpi-cpufreq: Add quirk to disable _PSD usage on all AMD CPUs Date: Thu, 26 Jul 2012 14:28:38 +0200 Message-ID: <1343305724-2809-3-git-send-email-andre.przywara@amd.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1343305724-2809-1-git-send-email-andre.przywara@amd.com> References: <1343305724-2809-1-git-send-email-andre.przywara@amd.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org To workaround some Windows specific behavior, the ACPI _PSD table on AMD desktop boards advertises all cores as dependent, meaning that they all can only use the same P-state. acpi-cpufreq strictly obeys this description, instantiating one CPU only and symlinking the others. But the hardware can have distinct frequencies for each core and powernow-k8 did it that way. So, in order to use the hardware to its full potential and keep the original powernow-k8 behavior, lets override the _PSD table setting on AMD hardware. We use the siblings table, as it matches the current hardware behavior. Signed-off-by: Andre Przywara --- drivers/cpufreq/acpi-cpufreq.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 067a61f..ea949b8 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -586,6 +586,14 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) policy->shared_type = CPUFREQ_SHARED_TYPE_ALL; cpumask_copy(policy->cpus, cpu_core_mask(cpu)); } + + if (check_amd_hwpstate_cpu(cpu) && !acpi_pstate_strict) { + cpumask_clear(policy->cpus); + cpumask_set_cpu(cpu, policy->cpus); + cpumask_copy(policy->related_cpus, cpu_sibling_mask(cpu)); + policy->shared_type = CPUFREQ_SHARED_TYPE_HW; + pr_info_once("overriding _PSD data for CPU %d\n", cpu); + } #endif /* capability check */