From patchwork Fri Sep 20 17:43:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 2919951 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1434E9F1BF for ; Fri, 20 Sep 2013 17:44:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 173B4201CB for ; Fri, 20 Sep 2013 17:44:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F006D2037A for ; Fri, 20 Sep 2013 17:44:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753355Ab3ITRoM (ORCPT ); Fri, 20 Sep 2013 13:44:12 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:49961 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753297Ab3ITRoK (ORCPT ); Fri, 20 Sep 2013 13:44:10 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r8KHi21k022239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 20 Sep 2013 17:44:04 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8KHhxtf010681 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Sep 2013 17:44:00 GMT Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8KHhxAD010671; Fri, 20 Sep 2013 17:43:59 GMT Received: from linux-siqj.site (/10.132.126.191) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 20 Sep 2013 10:43:59 -0700 From: Yinghai Lu To: "Rafael J. Wysocki" , Viresh Kumar Cc: cpufreq@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Yinghai Lu Subject: [PATCH -v2] cpufreq: skip loading acpi_cpufreq after intel_pstate Date: Fri, 20 Sep 2013 10:43:56 -0700 Message-Id: <1379699036-7380-1-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.1.4 X-Source-IP: acsinet22.oracle.com [141.146.126.238] 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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 If the hw support intel_pstate and acpi_cpufreq, intel_pstate will get loaded first. acpi_cpufreq_init will call acpi_cpufreq_early_init() and that will allocate perf data and init those perf data in ACPI core, (that will cover all cpus). But later it will free them as cpufreq_register_driver(acpi_cpufreq) will fail as init_pstate is already registered Use cpufreq_get_current_driver() to check if we can skip the acpi_cpufreq loading. -v2: update changelog and separate second part to another patch, according to Viresh. Signed-off-by: Yinghai Lu --- drivers/cpufreq/acpi-cpufreq.c | 4 ++++ 1 file changed, 4 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/cpufreq/acpi-cpufreq.c =================================================================== --- linux-2.6.orig/drivers/cpufreq/acpi-cpufreq.c +++ linux-2.6/drivers/cpufreq/acpi-cpufreq.c @@ -986,6 +986,10 @@ static int __init acpi_cpufreq_init(void { int ret; + /* don't keep reloading if cpufreq_driver exists */ + if (cpufreq_get_current_driver()) + return 0; + if (acpi_disabled) return 0;