Skip to contentSkip to conversation

PM / devfreq: comments for get_dev_status usage updated

PATCH In review MyungJoo Ham 2 participants 2 messages Aug 18, 2015 – Aug 19, 2015 Device frequency (devfreq)

lore
Share & tools
lore

MyungJoo Ham

author maintainer
#0 lore raw

PATCH 1/1 PM / devfreq: comments for get_dev_status usage updated

With the introduction of devfreq_update_stats(), governors are not recommended to use get_dev_status() directly.

---
 include/linux/devfreq.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
include/linux/devfreq.h +8 -1
index 70a1c60..68030e2 100644
@@ -65,7 +65,10 @@ struct devfreq_dev_status {
  *			The "flags" parameter's possible values are
  *			explained above with "DEVFREQ_FLAG_*" macros.
  * @get_dev_status:	The device should provide the current performance
- *			status to devfreq, which is used by governors.
+ *			status to devfreq. Governors are recommended not to
+ *			use this directly. Instead, governors are recommended
+ *			to use devfreq_update_stats() along with
+ *			devfreq.last_status.
  * @get_cur_freq:	The device should provide the current frequency
  *			at which it is operating.
  * @exit:		An optional callback that is called when devfreq
@@ -208,6 +211,10 @@ extern void devm_devfreq_unregister_opp_notifier(struct device *dev,
 /**
  * devfreq_update_stats() - update the last_status pointer in struct devfreq
  * @df:		the devfreq instance whose status needs updating
+ *
+ *  Governors are recommended to use this function along with last_status,
+ * which allows other entities to reuse the last_status without affecting
+ * the values fetched later by governors.
  */
 static inline int devfreq_update_stats(struct devfreq *df)
 {
Signature · 1 line
1.9.1