All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: set value of CPUFREQ_BOOST_FREQ to 0xABABABAB
@ 2014-03-24  6:48 Viresh Kumar
  2014-03-24  8:21 ` Lukasz Majewski
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Viresh Kumar @ 2014-03-24  6:48 UTC (permalink / raw)
  To: rjw
  Cc: linaro-kernel, cpufreq, linux-pm, linux-kernel, srivatsa.bhat,
	ego, svaidy, l.majewski, Viresh Kumar

Ideally, .driver_data field of struct cpufreq_frequency_table must not be used
by core at all. But during a recent change if its value is same as
CPUFREQ_BOOST_FREQ macro, then it is treated specially by core.

The value of this macro was set to ~2 earlier, i.e. 0xFFFFFFFD. In case some
driver is using this field for its own data and sets this field to -3, then with
two's complement that value will also become 0xFFFFFFFD.

To fix this issue, lets change value of this flag to a very uncommon value which
shouldn't be used by any driver unless they want to use BOOST feature.

Along with this update comments to make this more clear.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---

Gautham/Vaidy: I hope this fixes the problem we discussed for your patchset.

 include/linux/cpufreq.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c48e595..9f25d9d 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -455,12 +455,18 @@ extern struct cpufreq_governor cpufreq_gov_conservative;
  *                     FREQUENCY TABLE HELPERS                       *
  *********************************************************************/
 
+/* Special Values of .frequency field */
 #define CPUFREQ_ENTRY_INVALID ~0
 #define CPUFREQ_TABLE_END     ~1
-#define CPUFREQ_BOOST_FREQ    ~2
+/* Special Values of .driver_data field */
+#define CPUFREQ_BOOST_FREQ    0xABABABAB
 
 struct cpufreq_frequency_table {
-	unsigned int	driver_data; /* driver specific data, not used by core */
+	/*
+	 * driver specific data, not used by core unless it is set to
+	 * CPUFREQ_BOOST_FREQ.
+	 */
+	unsigned int	driver_data;
 	unsigned int	frequency; /* kHz - doesn't need to be in ascending
 				    * order */
 };
-- 
1.7.12.rc2.18.g61b472e


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-03-28 13:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-24  6:48 [PATCH] cpufreq: set value of CPUFREQ_BOOST_FREQ to 0xABABABAB Viresh Kumar
2014-03-24  8:21 ` Lukasz Majewski
2014-03-24  8:33   ` Viresh Kumar
2014-03-24  8:52 ` Gautham R Shenoy
2014-03-28  8:53 ` [PATCH] cpufreq: create another field .flags in cpufreq_frequency_table Viresh Kumar
2014-03-28 10:14   ` [PATCH] cpufreq: use kzalloc() to allocate memory for cpufreq_frequency_table Viresh Kumar
2014-03-28 10:44     ` Gautham R Shenoy
2014-03-28 13:29     ` Joe Perches
2014-03-28 13:32       ` Viresh Kumar
2014-03-28 10:19   ` [PATCH] cpufreq: create another field .flags in cpufreq_frequency_table Lukasz Majewski
2014-03-28 10:33     ` Viresh Kumar
2014-03-28 10:43   ` Gautham R Shenoy
2014-03-28  8:55 ` [PATCH] cpufreq: set value of CPUFREQ_BOOST_FREQ to 0xABABABAB Viresh Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.