PM / devfreq: Set the freq_table of devfreq device
Quoted 5 lines
This patch initialize the
freq_tablearray of each devfreq device by using
thedevfreq_set_freq_table(). Iffreq_tableis NULL, the devfreq framework is not able to support the frequency transtion information through sysfs.
Quoted 7 lines
The OPP core uses the integer type for the number of opps in the opp list and uses the 'unsigned long' type for each frequency. So, this patch modifies the type of some variable as following:
- the type offreq_table: unsigned int -> unsigned long
- the type ofmax_state: unsigned int -> intSigned-off-by Chanwoo Choi <[email protected]>
[]
Quoted 5 lines
(quoted diff) +1
-0+/** * devfreq_update_status() - Update statistics of devfreq behavior * @devfreq: the devfreq instance * @freq: the update target frequency
Review struct devfreq *devfreq_add_device(struct device *dev, · line 524
Quoted 9 lines
(quoted diff) +5
-0@@ -477,7 +516,12 @@ struct devfreq *devfreq_add_device(struct device *dev, devfreq->previous_freq = profile->initial_freq; devfreq->data = data; devfreq->nb.notifier_call = devfreq_notifier_call; + mutex_unlock(&devfreq->lock); + if (devfreq->profile->max_state <= 0 && !devfreq->profile->freq_table) + devfreq_set_freq_table(devfreq); + + mutex_lock(&devfreq->lock);
Anyway, what about modifying the block above as:
+ if (!devfreq->profile->max_state && !devfreq->profile->freq_table) {
+ mutex_unlock(&devfreq->lock);
devfreq_set_freq_table(devfreq);
+ mutex_lock(&devfreq->lock);
+ }
Review struct devfreq *devfreq_add_device(struct device *dev, · line 527
Quoted 3 lines
(quoted diff) +0
-0devfreq->trans_table = devm_kzalloc(dev, sizeof(unsigned int) * devfreq->profile->max_state * devfreq->profile->max_state,
[]
If that's not a problem, I'll squash
https://git.kernel.org/cgit/linux/kernel/git/mzx/devfreq.git/commit/?h=for-rafael&id=55df2b43cdb5ac82d26b64d739f3d758c9b7486c
with the given patch.
Quoted 36 lines · MyungJoo Ham
Quoted 5 lines
This patch initialize the
freq_tablearray of each devfreq device by using
thedevfreq_set_freq_table(). Iffreq_tableis NULL, the devfreq framework is not able to support the frequency transtion information through sysfs.Quoted 7 lines
The OPP core uses the integer type for the number of opps in the opp list and uses the 'unsigned long' type for each frequency. So, this patch modifies the type of some variable as following:
- the type offreq_table: unsigned int -> unsigned long
- the type ofmax_state: unsigned int -> intSigned-off-by Chanwoo Choi <[email protected]>[]
Quoted 5 lines
(quoted diff) +1
-0+/** * devfreq_update_status() - Update statistics of devfreq behavior * @devfreq: the devfreq instance * @freq: the update target frequencyReview struct devfreq *devfreq_add_device(struct device *dev, · line 524
Quoted 9 lines
(quoted diff) +5
-0@@ -477,7 +516,12 @@ struct devfreq *devfreq_add_device(struct device *dev, devfreq->previous_freq = profile->initial_freq; devfreq->data = data; devfreq->nb.notifier_call = devfreq_notifier_call; + mutex_unlock(&devfreq->lock); + if (devfreq->profile->max_state <= 0 && !devfreq->profile->freq_table) + devfreq_set_freq_table(devfreq); + + mutex_lock(&devfreq->lock);Anyway, what about modifying the block above as:
(quoted diff) +4
-0+ if (!devfreq->profile->max_state && !devfreq->profile->freq_table) { + mutex_unlock(&devfreq->lock); devfreq_set_freq_table(devfreq); + mutex_lock(&devfreq->lock); + }
Quoted 8 lines
Review struct devfreq *devfreq_add_device(struct device *dev, · line 527
Quoted 3 lines
(quoted diff) +0
-0devfreq->trans_table = devm_kzalloc(dev, sizeof(unsigned int) * devfreq->profile->max_state * devfreq->profile->max_state,[]
If that's not a problem, I'll squash
https://git.kernel.org/cgit/linux/kernel/git/mzx/devfreq.git/commit/?h=for-rafael&id=55df2b43cdb5ac82d26b64d739f3d758c9b7486c
with the given patch.
I agree. Thanks for fixing this.
Regards,
Chanwoo Choi