From: Chanwoo Choi <cw00.choi@samsung•com>
To: Leonard Crestez <leonard.crestez@nxp•com>,
MyungJoo Ham <myungjoo.ham@samsung•com>,
Kyungmin Park <kyungmin.park@samsung•com>,
"Rafael J. Wysocki" <rjw@rjwysocki•net>
Cc: "Artur Świgoń" <a.swigon@partner•samsung.com>,
"Abel Vesa" <abel.vesa@nxp•com>,
"Saravana Kannan" <saravanak@google•com>,
linux-pm@vger•kernel.org,
"Viresh Kumar" <viresh.kumar@linaro•org>,
"NXP Linux Team" <linux-imx@nxp•com>,
"Krzysztof Kozlowski" <krzk@kernel•org>,
"Matthias Kaehlcke" <mka@chromium•org>,
"Alexandre Bailon" <abailon@baylibre•com>,
"Georgi Djakov" <georgi.djakov@linaro•org>,
linux-arm-kernel@lists•infradead.org,
"Jacky Bai" <ping.bai@nxp•com>
Subject: Re: [PATCH v10 01/11] PM / devfreq: Fix devfreq_notifier_call returning errno
Date: Mon, 11 Nov 2019 14:55:25 +0900 [thread overview]
Message-ID: <3e31fce5-97ec-5f69-d352-d45a7cf0eb75@samsung.com> (raw)
In-Reply-To: <b13007563e6c1e29e2d9b31c9881693fc2bf167a.1572556786.git.leonard.crestez@nxp.com>
On 11/1/19 6:34 AM, Leonard Crestez wrote:
> Notifier callbacks shouldn't return negative errno but one of the
> NOTIFY_OK/DONE/BAD values.
>
> The OPP core will ignore return values from notifiers but returning a
> value that matches NOTIFY_STOP_MASK will stop the notification chain.
>
> Fix by always returning NOTIFY_OK.
>
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp•com>
> Reviewed-by: Matthias Kaehlcke <mka@chromium•org>
> Reviewed-by: Chanwoo Choi <cw00.choi@samsung•com>
> ---
> drivers/devfreq/devfreq.c | 24 +++++++++++++-----------
> 1 file changed, 13 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 323d43315d1e..b65faa1a2baa 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -548,30 +548,32 @@ EXPORT_SYMBOL(devfreq_interval_update);
> */
> static int devfreq_notifier_call(struct notifier_block *nb, unsigned long type,
> void *devp)
> {
> struct devfreq *devfreq = container_of(nb, struct devfreq, nb);
> - int ret;
> + int err = -EINVAL;
>
> mutex_lock(&devfreq->lock);
>
> devfreq->scaling_min_freq = find_available_min_freq(devfreq);
> - if (!devfreq->scaling_min_freq) {
> - mutex_unlock(&devfreq->lock);
> - return -EINVAL;
> - }
> + if (!devfreq->scaling_min_freq)
> + goto out;
>
> devfreq->scaling_max_freq = find_available_max_freq(devfreq);
> - if (!devfreq->scaling_max_freq) {
> - mutex_unlock(&devfreq->lock);
> - return -EINVAL;
> - }
> + if (!devfreq->scaling_max_freq)
> + goto out;
> +
> + err = update_devfreq(devfreq);
>
> - ret = update_devfreq(devfreq);
> +out:
> mutex_unlock(&devfreq->lock);
> + if (err)
> + dev_err(devfreq->dev.parent,
> + "failed to update frequency from OPP notifier (%d)\n",
> + err);
>
> - return ret;
> + return NOTIFY_OK;
> }
>
> /**
> * devfreq_dev_release() - Callback for struct device to release the device.
> * @dev: the devfreq device
>
Applied it because it doesn't depend on the pm_qos feature.
--
Best Regards,
Chanwoo Choi
Samsung Electronics
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-11-11 5:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-31 21:34 [PATCH v10] PM / devfreq: Add dev_pm_qos support Leonard Crestez
2019-10-31 21:34 ` [PATCH v10 01/11] PM / devfreq: Fix devfreq_notifier_call returning errno Leonard Crestez
2019-11-11 5:55 ` Chanwoo Choi [this message]
2019-10-31 21:34 ` [PATCH v10 02/11] PM / devfreq: Set scaling_max_freq to max on OPP notifier error Leonard Crestez
2019-11-11 5:55 ` Chanwoo Choi
2019-10-31 21:34 ` [PATCH v10 03/11] PM / devfreq: Split device_register usage Leonard Crestez
2019-10-31 21:34 ` [PATCH v10 04/11] PM / devfreq: Move more initialization before registration Leonard Crestez
2019-10-31 21:34 ` [PATCH v10 05/11] PM / devfreq: Don't take lock in devfreq_add_device Leonard Crestez
2019-10-31 21:34 ` [PATCH v10 06/11] PM / QoS: Reorder pm_qos/freq_qos/dev_pm_qos structs Leonard Crestez
2019-11-01 2:13 ` Chanwoo Choi
2019-11-01 14:45 ` Leonard Crestez
2019-11-11 5:52 ` Chanwoo Choi
2019-10-31 21:34 ` [PATCH v10 07/11] PM / QoS: Export _freq_qos_apply Leonard Crestez
2019-10-31 21:34 ` [PATCH v10 08/11] PM / QoS: Restore DEV_PM_QOS_MIN/MAX_FREQUENCY Leonard Crestez
2019-10-31 21:34 ` [PATCH v10 09/11] PM / devfreq: Introduce get_freq_range helper Leonard Crestez
2019-11-11 5:56 ` Chanwoo Choi
2019-11-11 14:37 ` Leonard Crestez
2019-10-31 21:34 ` [PATCH v10 10/11] PM / devfreq: Add PM QoS support Leonard Crestez
2019-10-31 21:34 ` [PATCH v10 11/11] PM / devfreq: Use PM QoS for sysfs min/max_freq Leonard Crestez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3e31fce5-97ec-5f69-d352-d45a7cf0eb75@samsung.com \
--to=cw00.choi@samsung$(echo .)com \
--cc=a.swigon@partner$(echo .)samsung.com \
--cc=abailon@baylibre$(echo .)com \
--cc=abel.vesa@nxp$(echo .)com \
--cc=georgi.djakov@linaro$(echo .)org \
--cc=krzk@kernel$(echo .)org \
--cc=kyungmin.park@samsung$(echo .)com \
--cc=leonard.crestez@nxp$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-imx@nxp$(echo .)com \
--cc=linux-pm@vger$(echo .)kernel.org \
--cc=mka@chromium$(echo .)org \
--cc=myungjoo.ham@samsung$(echo .)com \
--cc=ping.bai@nxp$(echo .)com \
--cc=rjw@rjwysocki$(echo .)net \
--cc=saravanak@google$(echo .)com \
--cc=viresh.kumar@linaro$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox