PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is failed
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 23 Jun 2016 02:18:43 +0000 (11:18 +0900)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 23 Jun 2016 21:15:12 +0000 (23:15 +0200)
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>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/devfreq/devfreq.c

index c7f47e34807b6c86e51c8ae14c2996325bec06b6..e92418facc92ae133f6d00553501c8b1ce8d6292 100644 (file)
@@ -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);