All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is failed
@ 2016-06-23  2:18 Chanwoo Choi
  2016-06-23 13:40 ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Chanwoo Choi @ 2016-06-23  2:18 UTC (permalink / raw)
  To: myungjoo.ham
  Cc: kyungmin.park, hl, rafael.j.wysocki, linux-kernel, linux-pm,
	Chanwoo Choi

This patch sends the DEVFREQ_POSTCHANGE notification when
devfreq->profile->targer() is failed. The PRECHANGE/POSTCHANGE
should be paired.

Fixes: 0fe3a66410a3 ("PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier")
Reported-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/devfreq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 1d6c803804d5..387799fec4c3 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -268,8 +268,11 @@ int update_devfreq(struct devfreq *devfreq)
 	devfreq_notify_transition(devfreq, &freqs, DEVFREQ_PRECHANGE);
 
 	err = devfreq->profile->target(devfreq->dev.parent, &freq, flags);
-	if (err)
+	if (err) {
+		freqs.new = cur_freq;
+		devfreq_notify_transition(devfreq, &freqs, DEVFREQ_POSTCHANGE);
 		return err;
+	}
 
 	freqs.new = freq;
 	devfreq_notify_transition(devfreq, &freqs, DEVFREQ_POSTCHANGE);
-- 
1.9.1

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

end of thread, other threads:[~2016-06-24 13:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-23  2:18 [PATCH] PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is failed Chanwoo Choi
2016-06-23 13:40 ` Rafael J. Wysocki
2016-06-23 14:24   ` Chanwoo Choi
     [not found]   ` <CGME20160623142439epcas1p445e53890a3f909f08de100dfedb9bd04@epcas1p4.samsung.com>
2016-06-24  0:28     ` MyungJoo Ham
2016-06-24 13:39       ` Rafael J. Wysocki

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.