[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZbIQgnhstsdzk5/K@linux.intel.com>
Date: Thu, 25 Jan 2024 08:40:50 +0100
From: Stanislaw Gruszka <stanislaw.gruszka@...ux.intel.com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Linux PM <linux-pm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Ulf Hansson <ulf.hansson@...aro.org>
Subject: Re: [PATCH v1 02/12] PM: sleep: Relocate two device PM core functions
On Mon, Jan 22, 2024 at 12:24:21PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Move is_async() and dpm_async_fn() in the PM core to a more suitable
> place.
>
> No functional impact.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@...ux.intel.com>
> ---
> drivers/base/power/main.c | 58 +++++++++++++++++++++++-----------------------
> 1 file changed, 29 insertions(+), 29 deletions(-)
>
> Index: linux-pm/drivers/base/power/main.c
> ===================================================================
> --- linux-pm.orig/drivers/base/power/main.c
> +++ linux-pm/drivers/base/power/main.c
> @@ -578,6 +578,35 @@ bool dev_pm_skip_resume(struct device *d
> return !dev->power.must_resume;
> }
>
> +static bool is_async(struct device *dev)
> +{
> + return dev->power.async_suspend && pm_async_enabled
> + && !pm_trace_is_enabled();
> +}
> +
> +static bool dpm_async_fn(struct device *dev, async_func_t func)
> +{
> + reinit_completion(&dev->power.completion);
> +
> + if (is_async(dev)) {
> + dev->power.async_in_progress = true;
> +
> + get_device(dev);
> +
> + if (async_schedule_dev_nocall(func, dev))
> + return true;
> +
> + put_device(dev);
> + }
> + /*
> + * Because async_schedule_dev_nocall() above has returned false or it
> + * has not been called at all, func() is not running and it is safe to
> + * update the async_in_progress flag without extra synchronization.
> + */
> + dev->power.async_in_progress = false;
> + return false;
> +}
> +
> /**
> * device_resume_noirq - Execute a "noirq resume" callback for given device.
> * @dev: Device to handle.
> @@ -664,35 +693,6 @@ Out:
> }
> }
>
> -static bool is_async(struct device *dev)
> -{
> - return dev->power.async_suspend && pm_async_enabled
> - && !pm_trace_is_enabled();
> -}
> -
> -static bool dpm_async_fn(struct device *dev, async_func_t func)
> -{
> - reinit_completion(&dev->power.completion);
> -
> - if (is_async(dev)) {
> - dev->power.async_in_progress = true;
> -
> - get_device(dev);
> -
> - if (async_schedule_dev_nocall(func, dev))
> - return true;
> -
> - put_device(dev);
> - }
> - /*
> - * Because async_schedule_dev_nocall() above has returned false or it
> - * has not been called at all, func() is not running and it is safe to
> - * update the async_in_progress flag without extra synchronization.
> - */
> - dev->power.async_in_progress = false;
> - return false;
> -}
> -
> static void async_resume_noirq(void *data, async_cookie_t cookie)
> {
> struct device *dev = data;
>
>
>
>
Powered by blists - more mailing lists