Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1621654imj; Sun, 17 Feb 2019 10:06:26 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaz71uEmjbCeJS51aV8mm7r5l1y76Z5eL+R3d4kcV5Ox0AAVAxBvzmoPcm1VVF3SJw53iqf X-Received: by 2002:a62:4254:: with SMTP id p81mr20140348pfa.185.1550426786814; Sun, 17 Feb 2019 10:06:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550426786; cv=none; d=google.com; s=arc-20160816; b=NwiRFghTb0ovyMgRf9eClAQd4PK/POn0lN9joZhlfbTi1yDkfpfNP92vg/7Cc9kZBx cL8Pi1JxM1kGQsi2rI+iur+1UR3EvDcLkPG41o2wap7TrJstlNbFz9ZhtDAdFroiBmBg g5Z0vEQvwyQzq8VGpx6OqLWBVMBtRng0/h4yfz6B/oCIr4st9Ski4/zOnJALDUbPd7Sf kdbhsGig0Sls0WRefDD5jYuFrkIAwIULITvh+/95eopHFB55O9gGk9/zlZ8BsZVrcbu8 sMNpVqYW9IJgqEtK8UxveHJ/DreSWpSwzCH7fAWODlbMKavQkOnex2CtSzxoxvJvpVPh edDw== 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=KoqIo9qVci7Fr14maI1o0dWrQxbnZ3dOSXtkch7SjK0=; b=kFkZYVNJXa1PwMTS6VhaHYGYthiCpMzE8hFzT1+m72/r2R0jaHjX3eaG1tW/ueVw8X YIzN7vfpTG1gg51AW5+P8hAoLrzdGr5KcqdTeVOOmATFfuMJcfRN0jB5Knsxy5cA2OGR ADZZ8/hrbiCPxWM9p2ZLKbeLcvqcyJor7V1YkjaKiEymn6mzLzWFVBj0F1tv/H7/BuwB yn/L5M5PIK5PuMwDTXTOTs0t7dYHh1lncdUIWFSW1vC+naaGZoBueAhboKZ1DRtpPj+B ZbHAhtW7cB+CNvGll5fUbkHTNvmPYw73e4BMpPkcMSfNZa8DJvq2CJg5iwaZdQ+qpY1v /JHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MTFPrkKZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn8si11513063plb.321.2019.02.17.10.05.39; Sun, 17 Feb 2019 10:06:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MTFPrkKZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727550AbfBQRkm (ORCPT + 99 others); Sun, 17 Feb 2019 12:40:42 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:39639 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbfBQRkm (ORCPT ); Sun, 17 Feb 2019 12:40:42 -0500 Received: by mail-it1-f193.google.com with SMTP id l15so22863894iti.4; Sun, 17 Feb 2019 09:40:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KoqIo9qVci7Fr14maI1o0dWrQxbnZ3dOSXtkch7SjK0=; b=MTFPrkKZRaHAUIAPl6Cw304AYsY5bJxNwmnHpLqwTLyjtoNJvjUV40Z/tVmZoZ4jwu 4PRBcuwxSKYkifB0cCWzcVGd9fCVNdafOJPfmy0Ts8nJvNgU3p8wPQmG1rL/KAJoU5Ap TQXKZYQdbSOBy3SwnwD62bfv4UKJAifFEPFa32Jg6Qnes3b/VqsYS4oPc9ZL2jNLMPMu OmIZMeaRtXnECS7T7xQ2KkhDfiUfRFn1my/zDJs3JvrPr5hv3iJft5aa7hLkQjaZXVKt 4tW52eEvTe5+9XRc5Sqg7cjcaHG0x80JyifJn7zTwujvWGMUQpvrtH1BuELeqlY4D5/5 /4jA== 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=KoqIo9qVci7Fr14maI1o0dWrQxbnZ3dOSXtkch7SjK0=; b=e3WiGxc18gGpvnTPw+OQnFk358S4dmTlCxPg3EhWpehl8W8LSUR+/aP7BFpBErOP50 wvPjMKYQuL/JxLEgQ1pwpq4mcUOCqKiT6wNCfOdtFJKRxUajuUHLlKFpC7HdGqZ3jA9B K1/DdhO6QzxeXj5eIFPC3zDVrMhnCS5iWAF3iAn6sIzO0PvplF7hMrWHZ8xdFE9VBWhZ JgNovVw18RGvU8MMxBDXE0jCOsN8x26CcHtXgF9C4KDb/nme9oVpWe0sVT83DjDn9n7T nwipxSwqgluc0V9wUokTQAT11cPY8Jphw5NiEbc/saMYy2Q1Q+9Mr6FyNvuztU5WSgWo cCXQ== X-Gm-Message-State: AHQUAuburjTI1gGIy4JCTGM5AtJXTK7VkcyExj0HbiHbYqbth6iqx5fK z/lAw3UcBjwkQYHtfRWyR3Ip65VF8hmRzRA3PHU= X-Received: by 2002:a6b:dd04:: with SMTP id f4mr11071044ioc.248.1550425240858; Sun, 17 Feb 2019 09:40:40 -0800 (PST) MIME-Version: 1.0 References: <1548241960-7412-1-git-send-email-jshekhar@codeaurora.org> In-Reply-To: <1548241960-7412-1-git-send-email-jshekhar@codeaurora.org> From: Rob Clark Date: Sun, 17 Feb 2019 12:40:27 -0500 Message-ID: Subject: Re: [v1] drm/msm: Remove clock and bandwidth votes in mdss pm suspend To: Jayant Shekhar Cc: dri-devel , linux-arm-msm , freedreno , devicetree@vger.kernel.org, Linux Kernel Mailing List , Sean Paul , "Kristian H. Kristensen" , Abhinav Kumar , Jeykumar Sankaran , chandanu@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 On Wed, Jan 23, 2019 at 6:12 AM Jayant Shekhar wrote: > > MDSS PM suspend is dependent on runtime suspend for disabling > clocks and removing bandwidth votes. In case of pm_suspend > triggered, dpm_prepare hold a refcount on power usage of device > and hence runtime suspend is never triggered during pm_suspend. > As runtime suspend is not triggered, clocks and bandwidth votes > remain. Hence explicitly trigger mdss disable in msm_pm_suspend > to disable clocks and remove the votes. > > Signed-off-by: Jayant Shekhar > --- > drivers/gpu/drm/msm/msm_drv.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c > index 5c60bb3..ffe3a25 100644 > --- a/drivers/gpu/drm/msm/msm_drv.c > +++ b/drivers/gpu/drm/msm/msm_drv.c > @@ -1068,12 +1068,16 @@ 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; > > if (!IS_ERR_OR_NULL(priv->pm_state)) > return 0; > > priv->pm_state = drm_atomic_helper_suspend(ddev); > > + if (mdss && mdss->funcs) > + mdss->funcs->disable(mdss); > + This patch doesn't actually seem to apply, I guess it has a dependency on some other missing patch? That said, shouldn't the refcount aquired in _prepare() be dropped somewhere? It seems like if all planes/crtcs/etc are disabled, we should also disable power (or at least as much as we can while still having hotplug work), so ideally drm_atomic_helper_suspend() should be enough. BR. -R > return IS_ERR(priv->pm_state) ? PTR_ERR(priv->pm_state) : 0; > } > > @@ -1081,11 +1085,15 @@ static int msm_pm_resume(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; > int ret; > > if (IS_ERR_OR_NULL(priv->pm_state)) > return 0; > > + if (mdss && mdss->funcs) > + mdss->funcs->enable(mdss); > + > ret = drm_atomic_helper_resume(ddev, priv->pm_state); > if (ret == 0) > priv->pm_state = NULL; > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >