UPSTREAM: PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is...
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 23 Jun 2016 02:18:43 +0000 (11:18 +0900)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 10 Aug 2016 10:32:27 +0000 (18:32 +0800)
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)
Change-Id: I571fcc0ba95da6f7533d20818dfbd5f628c2f3ee
Reported-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 0d37189e80163c653771916afe28fae1a8d14daa)

drivers/devfreq/devfreq.c

index 3fa315b46c1aedb0466456b086b55d66eebd37b6..ffd35e327615dfa734cc13a25c831c9024c6963c 100644 (file)
@@ -228,8 +228,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);