Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756329AbZA3UoK (ORCPT ); Fri, 30 Jan 2009 15:44:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753640AbZA3Unx (ORCPT ); Fri, 30 Jan 2009 15:43:53 -0500 Received: from hera.kernel.org ([140.211.167.34]:48242 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752511AbZA3Unw (ORCPT ); Fri, 30 Jan 2009 15:43:52 -0500 Message-ID: <498365E7.5010609@kernel.org> Date: Fri, 30 Jan 2009 12:41:11 -0800 From: Yinghai Lu User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: Dave Jones , Ingo Molnar , Yinghai Lu , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , "Langsdorf, Mark" CC: Rusty Russell , "linux-kernel@vger.kernel.org" , Mike Travis Subject: [PATCH] x86/powernow: dont emit warning when acpi=off References: <498136FC.2020206@kernel.org> <200901301210.48352.rusty@rustcorp.com.au> <20090130151701.GD27549@elte.hu> <20090130160431.GA12130@redhat.com> In-Reply-To: <20090130160431.GA12130@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3725 Lines: 115 Impact: cleanup remove some wrong warning when acpi is disabled. and don't call exit_acpi if _PSS is not found. Signed-off-by: Yinghai Lu --- arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 53 ++++++++++++++++-------------- 1 file changed, 29 insertions(+), 24 deletions(-) Index: linux-2.6/arch/x86/kernel/cpu/cpufreq/powernow-k8.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ linux-2.6/arch/x86/kernel/cpu/cpufreq/powernow-k8.c @@ -1124,6 +1124,7 @@ static int powernowk8_verify(struct cpuf static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) { struct powernow_k8_data *data; + int k8_cpu_acpi_inited = 0; cpumask_t oldmask; int rc; @@ -1142,39 +1143,41 @@ static int __cpuinit powernowk8_cpu_init data->cpu = pol->cpu; data->currpstate = HW_PSTATE_INVALID; - if (powernow_k8_cpu_init_acpi(data)) { + if (!powernow_k8_cpu_init_acpi(data)) { + k8_cpu_acpi_inited = 1; + } else { /* * Use the PSB BIOS structure. This is only availabe on * an UP version, and is deprecated by AMD. */ if (num_online_cpus() != 1) { + if (!acpi_disabled) { #ifndef CONFIG_ACPI_PROCESSOR - printk(KERN_ERR PFX "ACPI Processor support is required " - "for SMP systems but is absent. Please load the " - "ACPI Processor module before starting this " - "driver.\n"); + printk(KERN_ERR PFX "ACPI Processor support is required " + "for SMP systems but is absent. Please load the " + "ACPI Processor module before starting this " + "driver.\n"); #else - printk(KERN_ERR FW_BUG PFX "Your BIOS does not provide" - " ACPI _PSS objects in a way that Linux " - "understands. Please report this to the Linux " - "ACPI maintainers and complain to your BIOS " - "vendor.\n"); + printk(KERN_ERR FW_BUG PFX "Your BIOS does not provide" + " ACPI _PSS objects in a way that Linux " + "understands. Please report this to the Linux " + "ACPI maintainers and complain to your BIOS " + "vendor.\n"); #endif - kfree(data); - return -ENODEV; + } + goto early_out; } if (pol->cpu != 0) { - printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " - "CPU other than CPU0. Complain to your BIOS " - "vendor.\n"); - kfree(data); - return -ENODEV; + if (!acpi_disabled) { + printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " + "CPU other than CPU0. Complain to your BIOS " + "vendor.\n"); + } + goto early_out; } rc = find_psb_table(data); - if (rc) { - kfree(data); - return -ENODEV; - } + if (rc) + goto early_out; } /* only run on specific CPU from here on */ @@ -1220,7 +1223,8 @@ static int __cpuinit powernowk8_cpu_init /* min/max the cpu is capable of */ if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) { printk(KERN_ERR FW_BUG PFX "invalid powernow_table\n"); - powernow_k8_cpu_exit_acpi(data); + if (k8_cpu_acpi_inited) + powernow_k8_cpu_exit_acpi(data); kfree(data->powernow_table); kfree(data); return -EINVAL; @@ -1240,8 +1244,9 @@ static int __cpuinit powernowk8_cpu_init err_out: set_cpus_allowed_ptr(current, &oldmask); - powernow_k8_cpu_exit_acpi(data); - + if (k8_cpu_acpi_inited) + powernow_k8_cpu_exit_acpi(data); +early_out: kfree(data); return -ENODEV; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/