From: Chanwoo Choi Date: Thu, 23 Jun 2016 02:18:43 +0000 (+0900) Subject: UPSTREAM: PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is... X-Git-Tag: firefly_0821_release~1939 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c8076165ac390d4feb5ba49740bddb6517329d11;p=firefly-linux-kernel-4.4.55.git UPSTREAM: PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is failed 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 Signed-off-by: Chanwoo Choi Signed-off-by: Rafael J. Wysocki (cherry picked from commit 0d37189e80163c653771916afe28fae1a8d14daa) --- diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 3fa315b46c1a..ffd35e327615 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -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);