cpufreq/opp: Turbo/boost mode support
Subsystems (6)
Viresh Kumar
maintainercover cpufreq/opp: Turbo/boost mode support
Hi Rafael,
This is based of my opp-v2 series and so is sent as reply to that one.
Bartlomiej had few patches that he wanted to get into 4.3. I have picked two of those and dropped one (the one that adds another field to platform data). The dropped one is replaced with two patches from me. There are minor modifications done in first two patches, based on the review comments I gave to him earlier.
Completely Untested.
@Bartlomiej: Can you please give them some testing ?
Bartlomiej Zolnierkiewicz (2):
opp: add dev_pm_opp_is_turbo() helper
cpufreq: Update boost flag while initializing freq table from OPPs
Viresh Kumar (2):
cpufreq: Allow drivers to enable boost support after registering
driver
cpufreq: dt: Add support for turbo/boost mode
drivers/base/power/opp.c | 30 ++++++++++++++++++++ drivers/cpufreq/cpufreq-dt.c | 8 ++++++ drivers/cpufreq/cpufreq.c | 66 ++++++++++++++++++++++++++++++------------- drivers/cpufreq/cpufreq_opp.c | 4 +++ drivers/cpufreq/freq_table.c | 15 ++++++++++ include/linux/cpufreq.h | 12 ++++++++ include/linux/pm_opp.h | 7 +++++ 7 files changed, 122 insertions(+), 20 deletions(-)
Signature · 1 line
2.4.0
Viresh Kumar
maintainerPATCH 1/4 opp: add dev_pm_opp_is_turbo() helper
From: Bartlomiej Zolnierkiewicz <[email protected]>
Add dev_pm_opp_is_turbo() helper to verify if an opp is to be used only for turbo mode or not.
--- drivers/base/power/opp.c | 30 ++++++++++++++++++++++++++++++ include/linux/pm_opp.h | 7 +++++++ 2 files changed, 37 insertions(+)
drivers/base/power/opp.c +30 -0
@@ -281,6 +281,36 @@ unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)EXPORT_SYMBOL_GPL (dev_pm_opp_get_freq);/** +* dev_pm_opp_is_turbo() - Returns true if opp was trubo OPP +* @opp: opp for which turbo mode is being verified +* +* Return: true if opp is turbo opp, else false. +* +* Locking: This function must be called under rcu_read_lock(). opp is a rcu +* protected pointer. This means that opp which could have been fetched by +* opp_find_freq_{exact,ceil,floor} functions is valid as long as we are +* under RCU lock. The pointer returned by the opp_find_freq family must be +* used in the same section as the usage of this function with the pointer +* prior to unlocking with rcu_read_unlock() to maintain the integrity of the +* pointer. +*/ +bool dev_pm_opp_is_turbo (struct dev_pm_opp *opp) +{ +struct dev_pm_opp *tmp_opp; + +opp_rcu_lockdep_assert (); + + tmp_opp =rcu_dereference (opp); +if (unlikely (IS_ERR_OR_NULL (tmp_opp)) || !tmp_opp->available) { +pr_err ("%s: Invalid parameters\n" , __func__); +return false; + } + +return tmp_opp->turbo; +} +EXPORT_SYMBOL_GPL (dev_pm_opp_is_turbo); + +/** * dev_pm_opp_get_max_clock_latency() - Get max clock latency in nanoseconds * @dev: device for which we do this operation *
include/linux/pm_opp.h +7 -0
@@ -30,6 +30,8 @@ unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp);unsigned long dev_pm_opp_get_freq (struct dev_pm_opp *opp); +bool dev_pm_opp_is_turbo (struct dev_pm_opp *opp); +int dev_pm_opp_get_opp_count (struct device *dev);unsigned long dev_pm_opp_get_max_clock_latency (struct device *dev);
@@ -63,6 +65,11 @@ static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)return 0 ; } +static inline bool dev_pm_opp_is_turbo (struct dev_pm_opp *opp) +{ +return false; +} +static inline int dev_pm_opp_get_opp_count (struct device *dev) {return 0 ;
Signature · 1 line
2.4.0
Re: [PATCH 1/4] opp: add dev_pm_opp_is_turbo() helper
Quoted 21 lines · Viresh Kumar
From: Bartlomiej Zolnierkiewicz <[email protected]>
Add
dev_pm_opp_is_turbo()helper to verify if an opp is to be used only for turbo mode or not.Cc Tomasz Figa <[email protected]>Cc Michael Turquette <[email protected]>Cc Javier Martinez Canillas <[email protected]>Cc Thomas Abraham <[email protected]>Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>Signed-off-by Viresh Kumar <[email protected]>--- drivers/base/power/opp.c | 30 ++++++++++++++++++++++++++++++ include/linux/pm_opp.h | 7 +++++++ 2 files changed, 37 insertions(+)drivers/base/power/opp.c +0
-0
drivers/base/power/opp.c unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp) · line 284
Quoted 4 lines
drivers/base/power/opp.c +1
-0@@ -281,6 +281,36 @@ unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)EXPORT_SYMBOL_GPL (dev_pm_opp_get_freq);/** +* dev_pm_opp_is_turbo() - Returns true if opp was trubo OPP
Typo.
And this is not exactly most helpful comment. opp is turbo... returns if opp was turbo. Explanation what "turbo" means in this context would be nice. I'm pretty sure it is not about air compression :-).
drivers/base/power/opp.c unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp) · line 287
Quoted 1 line
drivers/base/power/opp.c +1
-0+* Return: true if opp is turbo opp, else false.
Duplicate from above.
Best regards,
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Viresh Kumar
maintainerRe: [PATCH 1/4] opp: add dev_pm_opp_is_turbo() helper
Quoted 5 lines · Pavel Machek
Typo.
And this is not exactly most helpful comment. opp is turbo... returns if opp was turbo. Explanation what "turbo" means in this context would be nice. I'm pretty sure it is not about air compression :-).
Does this make it any better:
drivers/base/power/opp.c +5 -1
@@ -281,9 +281,13 @@ unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)EXPORT_SYMBOL_GPL (dev_pm_opp_get_freq);/** -* dev_pm_opp_is_turbo() - Returns true if opp was trubo OPP +* dev_pm_opp_is_turbo() - Returns if opp is turbo OPP or not * @opp: opp for which turbo mode is being verified * +* Turbo OPPs are not for normal use, and can be enabled (under certain +* conditions) for short duration of times to finish high throughput work +* quickly. Running on them for longer times may overheat the chip. +* * Return: true if opp is turbo opp, else false. * * Locking: This function must be called under rcu_read_lock(). opp is a rcu
Signature · 1 line
viresh
Re: [PATCH 1/4] opp: add dev_pm_opp_is_turbo() helper
Quoted 8 lines · Viresh Kumar
Quoted 5 lines · Pavel Machek
Typo.
And this is not exactly most helpful comment. opp is turbo... returns if opp was turbo. Explanation what "turbo" means in this context would be nice. I'm pretty sure it is not about air compression :-).
Does this make it any better:
Yes.
So any combination of normal OPPs can be sustained for arbitrary time within the temperature range?
And as soon as any turbo OPP is enabled, we produce more heat than TDP?
Thanks,
Pavel
Quoted 21 lines
drivers/base/power/opp.c +5
-1@@ -281,9 +281,13 @@ unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)EXPORT_SYMBOL_GPL (dev_pm_opp_get_freq);/** -* dev_pm_opp_is_turbo() - Returns true if opp was trubo OPP +* dev_pm_opp_is_turbo() - Returns if opp is turbo OPP or not * @opp: opp for which turbo mode is being verified * +* Turbo OPPs are not for normal use, and can be enabled (under certain +* conditions) for short duration of times to finish high throughput work +* quickly. Running on them for longer times may overheat the chip. +* * Return: true if opp is turbo opp, else false. * * Locking: This function must be called under rcu_read_lock(). opp is a rcu
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Viresh Kumar
maintainerRe: [PATCH 1/4] opp: add dev_pm_opp_is_turbo() helper
Quoted 2 lines · Pavel Machek
So any combination of normal OPPs can be sustained for arbitrary time within the temperature range?
Maybe not. That's why we user thermal framework to sense such situations and react accordingly.
Quoted 2 lines
And as soon as any turbo OPP is enabled, we produce more heat than TDP?
But yeah, this will cross all limits. Shall generate more heat or may consume lots of power for very small benefit in performance. And so very short duration bursts of this are used by very few platforms.
Signature · 1 line
viresh
Viresh Kumar
maintainerPATCH 2/4 cpufreq: Update boost flag while initializing freq table from OPPs
In reply to Viresh KumarFrom: Bartlomiej Zolnierkiewicz <[email protected]>
cpufreq table entries for OPPs with turbo modes enabled, should be marked with CPUFREQ_BOOST_FREQ flag. This ensures that these states are only used while operating in boost or turbo mode.
--- drivers/cpufreq/cpufreq_opp.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/cpufreq/cpufreq_opp.c +4 -0
@@ -75,6 +75,10 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev, } freq_table[i].driver_data = i; freq_table[i].frequency = rate /1000 ; + +/* Is Boost/turbo opp ? */ +if (dev_pm_opp_is_turbo (opp)) + freq_table[i].flags =CPUFREQ_BOOST_FREQ ; } freq_table[i].driver_data = i;
Signature · 1 line
2.4.0
Viresh Kumar
maintainerPATCH 3/4 cpufreq: Allow drivers to enable boost support after registering driver
In reply to Viresh KumarIn some cases it wouldn't be known at time of driver registration, if the driver needs to support boost/turbo frequencies.
For example, while getting boost information from DT with opp-v2 bindings, we need to parse the bindings for all the CPUs to know if turbo/boost OPPs are supported or not.
One way out to do that efficiently is to delay supporting boost mode (i.e. creating /sys/devices/system/cpu/cpufreq/boost file), until the time OPP bindings are parsed.
At that point, the driver can enable boost support. This can be done at ->init(), where the frequency table is created.
To do that, the driver requires few APIs from cpufreq core. This patch provides these APIs.
--- drivers/cpufreq/cpufreq.c | 66 ++++++++++++++++++++++++++++++-------------- drivers/cpufreq/freq_table.c | 15 ++++++++++ include/linux/cpufreq.h | 12 ++++++++ 3 files changed, 73 insertions(+), 20 deletions(-)
drivers/cpufreq/cpufreq.c +46 -20
@@ -2459,6 +2459,47 @@ int cpufreq_boost_supported(void) }EXPORT_SYMBOL_GPL (cpufreq_boost_supported); +static int create_boost_sysfs_file (void ) +{ +int ret; + +if (!cpufreq_boost_supported ()) +return 0 ; + +/* +* Check if driver provides function to enable boost - +* if not, use cpufreq_boost_set_sw as default +*/ +if (!cpufreq_driver->set_boost) + cpufreq_driver->set_boost = cpufreq_boost_set_sw; + + ret =cpufreq_sysfs_create_file (&boost.attr); +if (ret) +pr_err ("%s: cannot register global BOOST sysfs file\n" , + __func__); + +return ret; +} + +static void remove_boost_sysfs_file (void ) +{ +if (cpufreq_boost_supported ()) +cpufreq_sysfs_remove_file (&boost.attr); +} + +int cpufreq_enable_boost_support (void ) +{ +if (!cpufreq_driver) +return -EINVAL ; + +if (cpufreq_boost_supported ()) +return 0 ; + +/* This will get removed on driver unregister */ +return create_boost_sysfs_file (); +} +EXPORT_SYMBOL_GPL (cpufreq_enable_boost_support); +int cpufreq_boost_enabled (void ) {return cpufreq_driver->boost_enabled;
@@ -2508,21 +2549,9 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)if (driver_data->setpolicy) driver_data->flags |=CPUFREQ_CONST_LOOPS ; -if (cpufreq_boost_supported ()) { -/* -* Check if driver provides function to enable boost - -* if not, use cpufreq_boost_set_sw as default -*/ -if (!cpufreq_driver->set_boost) - cpufreq_driver->set_boost = cpufreq_boost_set_sw; - - ret =cpufreq_sysfs_create_file (&boost.attr); -if (ret) { -pr_err ("%s: cannot register global BOOST sysfs file\n" , - __func__); - goto err_null_driver; - } - } + ret =create_boost_sysfs_file (); +if (ret) + goto err_null_driver; ret =subsys_interface_register (&cpufreq_interface);if (ret)
@@ -2543,8 +2572,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) err_if_unreg:subsys_interface_unregister (&cpufreq_interface); err_boost_unreg: -if (cpufreq_boost_supported ()) -cpufreq_sysfs_remove_file (&boost.attr); +remove_boost_sysfs_file (); err_null_driver:write_lock_irqsave (&cpufreq_driver_lock, flags); cpufreq_driver =NULL ;
@@ -2573,9 +2601,7 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)/* Protect against concurrent cpu hotplug */ get_online_cpus ();subsys_interface_unregister (&cpufreq_interface); -if (cpufreq_boost_supported ()) -cpufreq_sysfs_remove_file (&boost.attr); - +remove_boost_sysfs_file ();unregister_hotcpu_notifier (&cpufreq_cpu_notifier);write_lock_irqsave (&cpufreq_driver_lock, flags);
drivers/cpufreq/freq_table.c +15 -0
@@ -18,6 +18,21 @@* FREQUENCY TABLE HELPERS * *********************************************************************/ +bool policy_has_boost_freq (struct cpufreq_policy *policy) +{ +struct cpufreq_frequency_table *pos, *table = policy->freq_table; + +if (!table) +return false; + +cpufreq_for_each_valid_entry (pos, table) +if (pos->flags &CPUFREQ_BOOST_FREQ ) +return true; + +return false; +} +EXPORT_SYMBOL_GPL (policy_has_boost_freq); +int cpufreq_frequency_table_cpuinfo (struct cpufreq_policy *policy,struct cpufreq_frequency_table *table) {
include/linux/cpufreq.h +12 -0
@@ -578,6 +578,8 @@ ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);int cpufreq_boost_trigger_state (int state);int cpufreq_boost_supported (void );int cpufreq_boost_enabled (void ); +int cpufreq_enable_boost_support (void ); +bool policy_has_boost_freq (struct cpufreq_policy *policy);#else static inline int cpufreq_boost_trigger_state (int state) {
@@ -591,6 +593,16 @@ static inline int cpufreq_boost_enabled(void) {return 0 ; } + +static inline int cpufreq_enable_boost_support (void ) +{ +return -EINVAL ; +} + +static inline bool policy_has_boost_freq (struct cpufreq_policy *policy) +{ +return false; +}#endif /* the following funtion is for cpufreq core use only */ struct cpufreq_frequency_table *cpufreq_frequency_get_table (unsigned int cpu);
Signature · 1 line
2.4.0
Viresh Kumar
maintainerRe: [PATCH 3/4] cpufreq: Allow drivers to enable boost support after registering driver
Quoted 17 lines · Viresh Kumar
In some cases it wouldn't be known at time of driver registration, if the driver needs to support boost/turbo frequencies.
For example, while getting boost information from DT with opp-v2 bindings, we need to parse the bindings for all the CPUs to know if turbo/boost OPPs are supported or not.
One way out to do that efficiently is to delay supporting boost mode (i.e. creating
/sys/devices/system/cpu/cpufreq/boostfile), until the time OPP bindings are parsed.At that point, the driver can enable boost support. This can be done at ->init(), where the frequency table is created.
To do that, the driver requires few APIs from cpufreq core. This patch provides these APIs.
Quoted 6 lines
Signed-off-by Viresh Kumar <[email protected]>--- drivers/cpufreq/cpufreq.c | 66 ++++++++++++++++++++++++++++++-------------- drivers/cpufreq/freq_table.c | 15 ++++++++++ include/linux/cpufreq.h | 12 ++++++++ 3 files changed, 73 insertions(+), 20 deletions(-)
Minor update that will make this patch work again :)
----------------------8<------------------------
Message-Id: <6c5b3d3f93adf53e5ba83e94fcc3df5b1abfc132.1438091239.git.viresh.kumar@linaro.org>
From: Viresh Kumar <[email protected]>
Date: Tue, 28 Jul 2015 16:14:02 +0530
Subject: [PATCH] cpufreq: Allow drivers to enable boost support after
registering driver
In some cases it wouldn't be known at time of driver registration, if the driver needs to support boost frequencies.
For example, while getting boost information from DT with opp-v2 bindings, we need to parse the bindings for all the CPUs to know if turbo/boost OPPs are supported or not.
One way out to do that efficiently is to delay supporting boost mode (i.e. creating /sys/devices/system/cpu/cpufreq/boost file), until the time OPP bindings are parsed.
At that point, the driver can enable boost support. This can be done at ->init(), where the frequency table is created.
To do that, the driver requires few APIs from cpufreq core that let him do this. This patch provides these APIs.
--- drivers/cpufreq/cpufreq.c | 68 +++++++++++++++++++++++++++++++------------- drivers/cpufreq/freq_table.c | 15 ++++++++++ include/linux/cpufreq.h | 12 ++++++++ 3 files changed, 75 insertions(+), 20 deletions(-)
drivers/cpufreq/cpufreq.c +48 -20
@@ -2459,6 +2459,49 @@ int cpufreq_boost_supported(void) }EXPORT_SYMBOL_GPL (cpufreq_boost_supported); +static int create_boost_sysfs_file (void ) +{ +int ret; + +if (!cpufreq_boost_supported ()) +return 0 ; + +/* +* Check if driver provides function to enable boost - +* if not, use cpufreq_boost_set_sw as default +*/ +if (!cpufreq_driver->set_boost) + cpufreq_driver->set_boost = cpufreq_boost_set_sw; + + ret =cpufreq_sysfs_create_file (&boost.attr); +if (ret) +pr_err ("%s: cannot register global BOOST sysfs file\n" , + __func__); + +return ret; +} + +static void remove_boost_sysfs_file (void ) +{ +if (cpufreq_boost_supported ()) +cpufreq_sysfs_remove_file (&boost.attr); +} + +int cpufreq_enable_boost_support (void ) +{ +if (!cpufreq_driver) +return -EINVAL ; + +if (cpufreq_boost_supported ()) +return 0 ; + + cpufreq_driver->boost_supported = true; + +/* This will get removed on driver unregister */ +return create_boost_sysfs_file (); +} +EXPORT_SYMBOL_GPL (cpufreq_enable_boost_support); +int cpufreq_boost_enabled (void ) {return cpufreq_driver->boost_enabled;
@@ -2508,21 +2551,9 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)if (driver_data->setpolicy) driver_data->flags |=CPUFREQ_CONST_LOOPS ; -if (cpufreq_boost_supported ()) { -/* -* Check if driver provides function to enable boost - -* if not, use cpufreq_boost_set_sw as default -*/ -if (!cpufreq_driver->set_boost) - cpufreq_driver->set_boost = cpufreq_boost_set_sw; - - ret =cpufreq_sysfs_create_file (&boost.attr); -if (ret) { -pr_err ("%s: cannot register global BOOST sysfs file\n" , - __func__); - goto err_null_driver; - } - } + ret =create_boost_sysfs_file (); +if (ret) + goto err_null_driver; ret =subsys_interface_register (&cpufreq_interface);if (ret)
@@ -2543,8 +2574,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) err_if_unreg:subsys_interface_unregister (&cpufreq_interface); err_boost_unreg: -if (cpufreq_boost_supported ()) -cpufreq_sysfs_remove_file (&boost.attr); +remove_boost_sysfs_file (); err_null_driver:write_lock_irqsave (&cpufreq_driver_lock, flags); cpufreq_driver =NULL ;
@@ -2573,9 +2603,7 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)/* Protect against concurrent cpu hotplug */ get_online_cpus ();subsys_interface_unregister (&cpufreq_interface); -if (cpufreq_boost_supported ()) -cpufreq_sysfs_remove_file (&boost.attr); - +remove_boost_sysfs_file ();unregister_hotcpu_notifier (&cpufreq_cpu_notifier);write_lock_irqsave (&cpufreq_driver_lock, flags);
drivers/cpufreq/freq_table.c +15 -0
@@ -18,6 +18,21 @@* FREQUENCY TABLE HELPERS * *********************************************************************/ +bool policy_has_boost_freq (struct cpufreq_policy *policy) +{ +struct cpufreq_frequency_table *pos, *table = policy->freq_table; + +if (!table) +return false; + +cpufreq_for_each_valid_entry (pos, table) +if (pos->flags &CPUFREQ_BOOST_FREQ ) +return true; + +return false; +} +EXPORT_SYMBOL_GPL (policy_has_boost_freq); +int cpufreq_frequency_table_cpuinfo (struct cpufreq_policy *policy,struct cpufreq_frequency_table *table) {
include/linux/cpufreq.h +12 -0
@@ -578,6 +578,8 @@ ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);int cpufreq_boost_trigger_state (int state);int cpufreq_boost_supported (void );int cpufreq_boost_enabled (void ); +int cpufreq_enable_boost_support (void ); +bool policy_has_boost_freq (struct cpufreq_policy *policy);#else static inline int cpufreq_boost_trigger_state (int state) {
@@ -591,6 +593,16 @@ static inline int cpufreq_boost_enabled(void) {return 0 ; } + +static inline int cpufreq_enable_boost_support (void ) +{ +return -EINVAL ; +} + +static inline bool policy_has_boost_freq (struct cpufreq_policy *policy) +{ +return false; +}#endif /* the following funtion is for cpufreq core use only */ struct cpufreq_frequency_table *cpufreq_frequency_get_table (unsigned int cpu);
Viresh Kumar
maintainerPATCH 4/4 cpufreq: dt: Add support for turbo/boost mode
In reply to Viresh KumarWith opp-v2 DT bindings, few OPPs can be used only for the boost mode. But using such OPPs require the boost mode to be supported by cpufreq driver.
We will parse DT bindings only during ->init() and so can enable boost support only after registering cpufreq driver.
This enables boost support as soon as any policy has boost/turbo OPPs for its CPUs.
We don't need to disable boost support as that is done by the core, when the driver is unregistered.
--- drivers/cpufreq/cpufreq-dt.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/cpufreq/cpufreq-dt.c +8 -0
@@ -330,6 +330,14 @@ static int cpufreq_init(struct cpufreq_policy *policy) goto out_free_cpufreq_table; } +/* Support turbo/boost mode */ +if (policy_has_boost_freq (policy)) { +/* This gets disabled by core on driver unregister */ + ret =cpufreq_enable_boost_support (); +if (ret) + goto out_free_cpufreq_table; + } + policy->cpuinfo.transition_latency = transition_latency;of_node_put (np);
Signature · 1 line
2.4.0
Viresh Kumar
maintainerQuoted 3 lines · Viresh Kumar
Hi Rafael,
This is based of my opp-v2 series and so is sent as reply to that one.
Forgot to add --in-reply-to, here is the series I was talking about:
http://marc.info/?l=linux-pm&m=143797340316115&w=2
Signature · 1 line
viresh
Hi,
Quoted 9 lines · Viresh Kumar
Hi Rafael,
This is based of my opp-v2 series and so is sent as reply to that one.
Bartlomiej had few patches that he wanted to get into 4.3. I have picked two of those and dropped one (the one that adds another field to platform data). The dropped one is replaced with two patches from me. There are minor modifications done in first two patches, based on the review comments I gave to him earlier.
Thanks for working on this.
Quoted 3 lines
Completely Untested.
@Bartlomiej: Can you please give them some testing ?
Could you please tell me first how do you want me to fix the issue with setting boost_supported flag in cpufreq driver structure?
For exynos-cpufreq driver we currently have:
#ifdef CONFIG_ARM_EXYNOS_CPU_FREQ_BOOST_SW
.boost_supported = true,
#endif
With my original patches the config option stayed the same and the flag was enabled if necessary in Exynos platform code and passed through platform data to cpufreq-dt driver. This is no longer possible with your changes.
Should I enable it unconditionally in cpufreq-dt driver or add new config option for cpufreq-dt driver (CONFIG_CPUFREQ_DT_BOOST_SW?) for enabling boost_supported flag if necessary?
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Quoted 17 lines
Bartlomiej Zolnierkiewicz (2):
opp: adddev_pm_opp_is_turbo()helper
cpufreq: Update boost flag while initializing freq table from OPPsViresh Kumar (2):
cpufreq: Allow drivers to enable boost support after registering
driver
cpufreq: dt: Add support for turbo/boost modedrivers/base/power/opp.c | 30 ++++++++++++++++++++ drivers/cpufreq/cpufreq-dt.c | 8 ++++++ drivers/cpufreq/cpufreq.c | 66 ++++++++++++++++++++++++++++++------------- drivers/cpufreq/cpufreq_opp.c | 4 +++ drivers/cpufreq/freq_table.c | 15 ++++++++++ include/linux/cpufreq.h | 12 ++++++++ include/linux/pm_opp.h | 7 +++++ 7 files changed, 122 insertions(+), 20 deletions(-)
Viresh Kumar
maintainerQuoted 9 lines · Bartlomiej Zolnierkiewicz
Could you please tell me first how do you want me to fix the issue with setting
boost_supportedflag in cpufreq driver structure?For exynos-cpufreq driver we currently have:
#ifdef
CONFIG_ARM_EXYNOS_CPU_FREQ_BOOST_SW
.boost_supported = true,
#endif
Quoted 8 lines
With my original patches the config option stayed the same and the flag was enabled if necessary in Exynos platform code and passed through platform data to cpufreq-dt driver. This is no longer possible with your changes.
Should I enable it unconditionally in cpufreq-dt driver or add new config option for cpufreq-dt driver (
CONFIG_CPUFREQ_DT_BOOST_SW?) for enablingboost_supportedflag if necessary?
Look at my implementation, last two patches are already doing that. You don't need another change to get this working for you, neither are those config options required. Get rid of them :)
Signature · 1 line
viresh
Quoted 15 lines · Viresh Kumar
Quoted 14 lines · Bartlomiej Zolnierkiewicz
Could you please tell me first how do you want me to fix the issue with setting
boost_supportedflag in cpufreq driver structure?For exynos-cpufreq driver we currently have:
#ifdef
CONFIG_ARM_EXYNOS_CPU_FREQ_BOOST_SW
.boost_supported = true,
#endifWith my original patches the config option stayed the same and the flag was enabled if necessary in Exynos platform code and passed through platform data to cpufreq-dt driver. This is no longer possible with your changes.
Quoted 6 lines
Quoted 3 lines
Should I enable it unconditionally in cpufreq-dt driver or add new config option for cpufreq-dt driver (
CONFIG_CPUFREQ_DT_BOOST_SW?) for enablingboost_supportedflag if necessary?Look at my implementation, last two patches are already doing that. You don't need another change to get this working for you, neither are
I did look a them and they are lacking enabling of boost support flag in cpufreq_dt driver structure.
There is also CONFIG_CPU_FREQ_BOOST_SW which needs to be enabled to have boost frequencies in sysfs (code for that is in freq_table.c).
Quoted 1 line
those config options required. Get rid of them :)
Do you mean that we should now depend only on dts info for enabling boost support and that CONFIG_CPU_FREQ_BOOST_SW should be removed (together with CONFIG_ARM_EXYNOS_CPU_FREQ_BOOST_SW)?
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Viresh Kumar
maintainerQuoted 2 lines · Bartlomiej Zolnierkiewicz
I did look a them and they are lacking enabling of boost support flag in
cpufreq_dtdriver structure.
That's insulting now, I forgot to add this:
drivers/cpufreq/cpufreq.c +2 -0
@@ -2495,6 +2495,8 @@ int cpufreq_enable_boost_support(void)if (cpufreq_boost_supported ())return 0 ; + cpufreq_driver->boost_supported = true; +/* This will get removed on driver unregister */ return create_boost_sysfs_file (); }
So that is done from the above routine now.
Quoted 2 lines
There is also
CONFIG_CPU_FREQ_BOOST_SWwhich needs to be enabled to have boost frequencies in sysfs (code for that is infreq_table.c).
Yeah, we should get rid of that as well..
Quoted 5 lines
Quoted 1 line
those config options required. Get rid of them :)
Do you mean that we should now depend only on dts info for enabling boost support and that
CONFIG_CPU_FREQ_BOOST_SWshould be removed (together withCONFIG_ARM_EXYNOS_CPU_FREQ_BOOST_SW)?
Yes.
Signature · 1 line
viresh