Re: [PATCH] PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is failed

From: Rafael J. Wysocki
Date: Thu Jun 23 2016 - 09:40:43 EST


On Thu, Jun 23, 2016 at 4:18 AM, Chanwoo Choi <cw00.choi@xxxxxxxxxxx> wrote:
> 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@xxxxxxxxxxxxxx>
> Signed-off-by: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>
> ---
> 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);
> --

This looks like a fix for a recent regression, so I can apply it directly.

Do you want me to do that?

Thanks,
Rafael