Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754861Ab3GPJl5 (ORCPT ); Tue, 16 Jul 2013 05:41:57 -0400 Received: from mail-ob0-f178.google.com ([209.85.214.178]:36163 "EHLO mail-ob0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754430Ab3GPJlz (ORCPT ); Tue, 16 Jul 2013 05:41:55 -0400 MIME-Version: 1.0 In-Reply-To: <1372927830-2949-3-git-send-email-l.majewski@samsung.com> References: <1370502472-7249-1-git-send-email-l.majewski@samsung.com> <1372927830-2949-1-git-send-email-l.majewski@samsung.com> <1372927830-2949-3-git-send-email-l.majewski@samsung.com> Date: Tue, 16 Jul 2013 15:11:54 +0530 Message-ID: Subject: Re: [PATCH v5 2/7] cpufreq: Add boost frequency support in core From: Viresh Kumar To: Lukasz Majewski Cc: "Rafael J. Wysocki" , Zhang Rui , Eduardo Valentin , "cpufreq@vger.kernel.org" , Linux PM list , Jonghwa Lee , l.majewski@majess.pl, linux-kernel , Andre Przywara , Daniel Lezcano , Kukjin Kim , Myungjoo Ham Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2422 Lines: 75 On 4 July 2013 14:20, Lukasz Majewski wrote: > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > +int cpufreq_boost_trigger_state(int state) > +{ > + unsigned long flags; > + int ret = 0; > + > + if (boost_enabled != state) { > + write_lock_irqsave(&cpufreq_driver_lock, flags); > + boost_enabled = state; > + > + ret = cpufreq_driver->enable_boost(state); > + if (ret) > + boost_enabled = 0; > + > + write_unlock_irqrestore(&cpufreq_driver_lock, flags); > + > + if (ret) > + pr_err("%s: BOOST cannot enable (%d)\n", Who said we are enabling it? > + __func__, ret); > + } > + > + return ret; > +} > + > +int cpufreq_boost_supported(void) > +{ > + if (cpufreq_driver) > + return cpufreq_driver->boost_supported; > + > + return 0; > +} > +EXPORT_SYMBOL_GPL(cpufreq_boost_supported); > + > +int cpufreq_boost_enabled(void) > +{ > + return boost_enabled; > +} > +EXPORT_SYMBOL_GPL(cpufreq_boost_enabled); > + > +void cpufreq_set_boost_enabled(int state) Maybe cpufreq_block_boost? As suggested by Rafael. > +{ > + boost_enabled = state; > +} > +EXPORT_SYMBOL_GPL(cpufreq_set_boost_enabled); > + > +/********************************************************************* > * REGISTER / UNREGISTER CPUFREQ DRIVER * > *********************************************************************/ > > @@ -2001,6 +2094,22 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) > cpufreq_driver = driver_data; > write_unlock_irqrestore(&cpufreq_driver_lock, flags); > > + if (cpufreq_driver->boost_supported) { > + /* > + * Check if boost driver provides function to enable boost - > + * if not, use cpufreq_boost_enable_sw as default > + */ > + if (!cpufreq_driver->enable_boost) > + cpufreq_driver->enable_boost = &cpufreq_boost_enable_sw; & is redundant. -- 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/