lkml.org 
[lkml]   [2020]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6] drm/msm/dpu: ensure device suspend happens during PM sleep
Hi,

On Thu, Jun 4, 2020 at 6:20 AM Kalyan Thota <kalyan_t@codeaurora.org> wrote:
>
> -#ifdef CONFIG_PM
> -static int msm_runtime_suspend(struct device *dev)
> +#ifdef CONFIG_PM_SLEEP
> +static int msm_pm_suspend(struct device *dev)
> {
> - struct drm_device *ddev = dev_get_drvdata(dev);
> - struct msm_drm_private *priv = ddev->dev_private;
> - struct msm_mdss *mdss = priv->mdss;
>

nit: remove blank line at the start of this function

> static const struct dev_pm_ops msm_pm_ops = {
> SET_SYSTEM_SLEEP_PM_OPS(msm_pm_suspend, msm_pm_resume)
> SET_RUNTIME_PM_OPS(msm_runtime_suspend, msm_runtime_resume, NULL)
> + .prepare = msm_pm_prepare,
> + .complete = msm_pm_complete,

Presumably you will get a compile failure if someone compiles without
CONFIG_PM_SLEEP since msm_pm_prepare() and msm_pm_complete() won't be
defined but you refer to them unconditionally. Probably the best
solution is to just add "__maybe_unused" to your prepare/complete
function and then always define them.


I can't say I've thought through every corner case but at least this
change no longer raises alarm bells in my mind when I look at it. ;-)
If it works for you and nobody else has objections then it seems good
enough and we can always make more improvements later. Feel free to
add my Reviewed-by tag when my nit is fixed and you make sure it
compiles even if CONFIG_PM_SLEEP isn't defined.

-Doug

\
 
 \ /
  Last update: 2020-06-04 22:35    [W:1.038 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site