From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Subject: Re: [PATCH v6 3/8] cpufreq:acpi:x86: Adjust the acpi-cpufreq.c code to work with common boost solution Date: Fri, 26 Jul 2013 10:09:40 +0200 Message-ID: <20130726100940.1974559e@amdc308.digital.local> References: <1370502472-7249-1-git-send-email-l.majewski@samsung.com> <1374770011-22171-1-git-send-email-l.majewski@samsung.com> <1374770011-22171-4-git-send-email-l.majewski@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from mailout2.samsung.com ([203.254.224.25]:13339 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756739Ab3GZIK0 (ORCPT ); Fri, 26 Jul 2013 04:10:26 -0400 In-reply-to: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Viresh Kumar Cc: "Rafael J. Wysocki" , Zhang Rui , Eduardo Valentin , "cpufreq@vger.kernel.org" , Linux PM list , Jonghwa Lee , Lukasz Majewski , linux-kernel , Bartlomiej Zolnierkiewicz , Daniel Lezcano , Kukjin Kim , Myungjoo Ham , durgadoss.r@intel.com On Fri, 26 Jul 2013 12:58:02 +0530 Viresh Kumar wrote, > On 25 July 2013 22:03, Lukasz Majewski wrote: > > diff --git a/drivers/cpufreq/acpi-cpufreq.c > > b/drivers/cpufreq/acpi-cpufreq.c > > > static void __init acpi_cpufreq_boost_init(void) > > { > > + acpi_cpufreq_driver.boost_supported = false; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [*] > > Would be better if we do this in else of below if. We need to set boost_supported = false at [*] for the case when: 1. msrs_alloc fails or 2. acpi_cpufreq is built as a module and can be inserted and removed several times. Without [*] we could end up with wrong (not false) initial state. > > > if (boot_cpu_has(X86_FEATURE_CPB) || > > boot_cpu_has(X86_FEATURE_IDA)) { msrs = msrs_alloc(); > > > > @@ -1021,12 +995,11 @@ static int __init acpi_cpufreq_init(void) > > *iter = &cpb; > > } > > #endif > > + acpi_cpufreq_boost_init(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [**] > > We are calling it before registering cpufreq driver. Will this have > any complications? When we call [**] after the cpufreq_register_driver [***] we end up with sysfs boost attribute not exported at x86. The boost attribute is exported at [***] only when acpi_cpufreq.boost_supported = true. However support for boost at x86 is evaluated at acpi_cpufreq_boost_init(). > > > ret = cpufreq_register_driver(&acpi_cpufreq_driver); > > if (ret) > > free_acpi_perf_data(); > > - else > > - acpi_cpufreq_boost_init(); > > > > return ret; -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group