Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1585650ybg; Thu, 4 Jun 2020 13:38:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6Hk1o/0zbfLuoIYVw0QIvrGz/u4Al1zrfFum3hh49OCG4l6bfyckJ8o0X1ucuyTw0lX8W X-Received: by 2002:a50:ee8f:: with SMTP id f15mr6116126edr.168.1591303118604; Thu, 04 Jun 2020 13:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591303118; cv=none; d=google.com; s=arc-20160816; b=0xvUlsjHV71ICcbaa/AD9ZDTlkbo0b/pKJ683fahf8VMiHsf+6GMe64EAGMAyUuHCC XbcKjqYvW0HAFwW2yN+OOZ+eSkJGNv1U6/Ew6OPKBmC1s/x4I+ohu5yUGgB3mOIlG2lp 4f0v+epow0dCmp1WuA6PoxglV83E1tC7ieQzRlfVv1LPPlUIdT/SRXLVr0s2YKa8w95d Wglk3Q4CC7+wbmVcvPgW5tMRQqOjoNUgF/4Hvhd3qeUVkpBtBeu09lcVlqfy53c75Jn7 1N8tpJXhWnlsmAgDqigctt/9G839UFUaLoe1BTesbwn6KzNvX0JrQB2j100CzeFoaczN 9cpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QccmPOAwdRsqU+gseuKb7TceQ37JHCZ0c4E7yU4KiQA=; b=l4iuJBkjK/Fkk8KakJCHZnofAaIQuHAG8vbGzJg7edCRJJGhqf8/TtX0MoofGkZA6n 6Qb2AIbOoMdhmsejMXQpGd5HioyoR/eHM7ANGuzzfeoYHulxmZqA3AnGCpoHA/s02EIv UymPpMZ7juOyhN8QtC2s8rSXcUI3cqtmj0GxFHUuSpDErdUxMXtilxDjM8hoWsfhGaZK BPsS/r/oIo+2ZsVR05G0c9ReKUJ2Rw+prfsit1o8lOn/mKf4wPZGnWsH3mxUKH7BYD9z 7m2GwyPVmA83rMW8f+cuUiqC9kgrd5ZxYpV5SQvNrg+5JE6/LoWyvtW/9e+Yh4eLUo+Q aT8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ctMItyku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q15si2127079edi.367.2020.06.04.13.38.15; Thu, 04 Jun 2020 13:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ctMItyku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729073AbgFDUeV (ORCPT + 99 others); Thu, 4 Jun 2020 16:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728800AbgFDUeV (ORCPT ); Thu, 4 Jun 2020 16:34:21 -0400 Received: from mail-vs1-xe42.google.com (mail-vs1-xe42.google.com [IPv6:2607:f8b0:4864:20::e42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDB7DC08C5C0 for ; Thu, 4 Jun 2020 13:34:20 -0700 (PDT) Received: by mail-vs1-xe42.google.com with SMTP id c1so4310444vsc.11 for ; Thu, 04 Jun 2020 13:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QccmPOAwdRsqU+gseuKb7TceQ37JHCZ0c4E7yU4KiQA=; b=ctMItykuizT2FjCtlj3c7yeA8hejo1Eu0YvNGbgfHWNvUAZmSu1iqvjTuxpl6Rm/XM /bOQT4clHDMwkaa7CQpWJ+/aULE1pYzv7SNXe1g+1d4Jvdus2Zf/u2kDn//UPtypAuEw ce+XSToUwc8hZkd4Z5GjQqIAIMzFGI0iD70BY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QccmPOAwdRsqU+gseuKb7TceQ37JHCZ0c4E7yU4KiQA=; b=ZlTt8w/uc/F4hgfV2N7HroOdWxba0VgbGS6iKaZ2bZu+YaoBcihRxrjaaZ6OBY0YdR Vb8LNbm+aSC62SzCnhaVHpVcPzUiUlvT/jHpGnsLt/aAkua2QfyvZDKPQyCU1xYFXTVs ah0G5HQnl9fW/kcBfxfIFY/295BHHU2NrUfcLAtloWR7mnuekVt2WIjlmGAnzo4wgC+e ibbhQtkxN1Og/7Qvq717YwhM1TPF9yxofNaIKiakxYyS1YuE/+6mUVpVnGl/lNNuuSUv 9u9RWe7ca8+6pooUFCPpznHGew2A/RMuNkHfJwH+A+MD1kMccdh1+rnpxdc4GaNoqdM7 yHeQ== X-Gm-Message-State: AOAM5324FyF3Ut7PWZ8NbSSyQagIiqnICGPOtp/AUH5cUjhIoDhi7cqx 4lEmSt5btb3OLNaJtFbDjvXAB1E/ncw= X-Received: by 2002:a67:d381:: with SMTP id b1mr4724561vsj.148.1591302859591; Thu, 04 Jun 2020 13:34:19 -0700 (PDT) Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com. [209.85.217.48]) by smtp.gmail.com with ESMTPSA id l14sm850014vkl.47.2020.06.04.13.34.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jun 2020 13:34:18 -0700 (PDT) Received: by mail-vs1-f48.google.com with SMTP id r11so4337248vsj.5 for ; Thu, 04 Jun 2020 13:34:17 -0700 (PDT) X-Received: by 2002:a67:8881:: with SMTP id k123mr5087675vsd.198.1591302857244; Thu, 04 Jun 2020 13:34:17 -0700 (PDT) MIME-Version: 1.0 References: <1591276775-13949-1-git-send-email-kalyan_t@codeaurora.org> In-Reply-To: <1591276775-13949-1-git-send-email-kalyan_t@codeaurora.org> From: Doug Anderson Date: Thu, 4 Jun 2020 13:34:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6] drm/msm/dpu: ensure device suspend happens during PM sleep To: Kalyan Thota Cc: dri-devel , linux-arm-msm , freedreno , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , Rob Clark , Sean Paul , "Kristian H. Kristensen" , Jeykumar Sankaran , mkrishn@codeaurora.org, travitej@codeaurora.org, nganji@codeaurora.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Jun 4, 2020 at 6:20 AM Kalyan Thota 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