Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1413248 > unrolled thread
| Started by | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| First post | 2016-06-03 15:40 +0200 |
| Last post | 2016-06-06 09:10 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH V3 4/9] cpufreq: exynos: Use 'index' only to index into policy->freq_table Viresh Kumar <viresh.kumar@linaro.org> - 2016-06-03 15:40 +0200
Re: [PATCH V3 4/9] cpufreq: exynos: Use 'index' only to index into policy->freq_table Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-06 09:10 +0200
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2016-06-03 15:40 +0200 |
| Subject | [PATCH V3 4/9] cpufreq: exynos: Use 'index' only to index into policy->freq_table |
| Message-ID | <rFXuq-3Iu-33@gated-at.bofh.it> |
Later patches would make changes in cpufreq core, after which
policy->freq_table may be reordered by cpufreq core and it wouldn't be
safe anymore to use 'index' for any other local arrays.
To prepare for that, use policy->freq_table[index].driver_data for other
driver specific usage of 'index'. The 'driver_data' fields are already
set properly by the driver.
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/exynos5440-cpufreq.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c
index 085f07d31ef0..6138cbb7594e 100644
--- a/drivers/cpufreq/exynos5440-cpufreq.c
+++ b/drivers/cpufreq/exynos5440-cpufreq.c
@@ -210,7 +210,7 @@ static void exynos_enable_dvfs(unsigned int cur_frequency)
static int exynos_target(struct cpufreq_policy *policy, unsigned int index)
{
- unsigned int tmp;
+ unsigned int tmp, rindex;
int i;
mutex_lock(&cpufreq_lock);
@@ -218,13 +218,19 @@ static int exynos_target(struct cpufreq_policy *policy, unsigned int index)
freqs.old = policy->cur;
freqs.new = policy->freq_table[index].frequency;
+ /*
+ * policy->freq_table may be sorted differently, get the index value we
+ * are concerned about.
+ */
+ rindex = policy->freq_table[index].driver_data;
+
cpufreq_freq_transition_begin(policy, &freqs);
/* Set the target frequency in all C0_3_PSTATE register */
for_each_cpu(i, policy->cpus) {
tmp = __raw_readl(dvfs_info->base + XMU_C0_3_PSTATE + i * 4);
tmp &= ~(P_VALUE_MASK << C0_3_PSTATE_NEW_SHIFT);
- tmp |= (index << C0_3_PSTATE_NEW_SHIFT);
+ tmp |= (rindex << C0_3_PSTATE_NEW_SHIFT);
__raw_writel(tmp, dvfs_info->base + XMU_C0_3_PSTATE + i * 4);
}
--
2.7.1.410.g6faf27b
[toc] | [next] | [standalone]
| From | Krzysztof Kozlowski <k.kozlowski@samsung.com> |
|---|---|
| Date | 2016-06-06 09:10 +0200 |
| Subject | Re: [PATCH V3 4/9] cpufreq: exynos: Use 'index' only to index into policy->freq_table |
| Message-ID | <rGWPD-1F4-1@gated-at.bofh.it> |
| In reply to | #1413248 |
On 06/03/2016 03:35 PM, Viresh Kumar wrote: > Later patches would make changes in cpufreq core, after which > policy->freq_table may be reordered by cpufreq core and it wouldn't be > safe anymore to use 'index' for any other local arrays. > > To prepare for that, use policy->freq_table[index].driver_data for other > driver specific usage of 'index'. The 'driver_data' fields are already > set properly by the driver. > > Cc: Kukjin Kim <kgene@kernel.org> > Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> > --- > drivers/cpufreq/exynos5440-cpufreq.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Best regards, Krzysztof
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web