lkml.org 
[lkml]   [2020]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] PM / devfreq: passive: Update frequency when start governor
Date
If the parent device changes the their frequency before registering
the passive device, the passive device cannot receive the notification
from parent device and then the passive device cannot be able to
set the proper frequency according to the frequency of parent device.

So, when start the passive governor, update the frequency
according to the frequency of parent device.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
drivers/devfreq/governor_passive.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c
index 63332e4a65ae..375aa636027c 100644
--- a/drivers/devfreq/governor_passive.c
+++ b/drivers/devfreq/governor_passive.c
@@ -141,6 +141,21 @@ static int devfreq_passive_event_handler(struct devfreq *devfreq,
if (!p_data->this)
p_data->this = devfreq;

+ /*
+ * If the parent device changes the their frequency before
+ * registering the passive device, the passive device cannot
+ * receive the notification from parent device and then the
+ * passive device cannot be able to set the proper frequency
+ * according to the frequency of parent device.
+ *
+ * When start the passive governor, update the frequency
+ * according to the frequency of parent device.
+ */
+ ret = devfreq_update_target(devfreq, parent->previous_freq);
+ if (ret < 0)
+ dev_warn(&devfreq->dev,
+ "failed to update devfreq using passive governor\n");
+
nb->notifier_call = devfreq_passive_notifier_call;
ret = devfreq_register_notifier(parent, nb,
DEVFREQ_TRANSITION_NOTIFIER);
--
2.17.1
\
 
 \ /
  Last update: 2020-11-03 07:54    [W:0.540 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site