Received: by 10.192.165.148 with SMTP id m20csp364823imm; Wed, 25 Apr 2018 00:19:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx48ybCm1BY84DCkTNwmtTD9xE17oyhBDYezLAHQ2bXj7u5mqwWwPKQorlP/E80H08Q1a0OBA X-Received: by 2002:a17:902:1682:: with SMTP id h2-v6mr23050719plh.127.1524640749034; Wed, 25 Apr 2018 00:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524640748; cv=none; d=google.com; s=arc-20160816; b=a/LvzDO0X/+G27ZriFLqcDETr+Sz2eGW4R+uAQ9zijnbYiEfOWOOupyv+FDMlvo2PK HeWtuCgNR5KD926waECftA67TJUakf+KhBu19wHbgppIJWr6GvbwhHuKwcOLn6DxvXYN 74qQZ17PW7z4VoWIjGOXga1Jw6n/UWI+4ZKWX70khizeeyaYd6q0O5D5BA0X/CVvHYwT 1k0aERQ3FuoYODz7PYdAsOKynVc/lg7Fx7kqcyz/Zb2I4I8Otct78rN3zxgo49Di+M/t V6pzkZ9x6xgp+q6AYkyKvMURrUIds/BcMdSEi0sfpqcYgnoRc1DbjNRSw3fedi/fbgMk /7Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=6G8yfGf98+zC7NcoDBVkgx76OzZC5vzKm5AEJdV1VCc=; b=F78EdEz1zqWc7mIZqb7dzZHSRDKLZ/Vq3gr/Rs5cB3D9yCl/9TOOIe5RnJpX/thymA E9i2a2QTCOr8Rl3sJaaYiRGEgtcA1cPJeOVq2TeZkxmqqFFrlehfMDWHN/0GxGBRMm9b LLz8vK1I/Sha3assUaT7pryeW05DxxnpECI+jzhv5ndKYHJjmxnY/wMCITP3GW15c1UA PYOirrJfU/+WLqahcxS6bWwhEE5HKpe/aI49AUsMLLE88h1yKy3imHrJK7ZC7KcNpSVO KBvasyhgajJOCulDXL3OC2AJNo2iEs+Y6SnApfdvD/eqO9X4N0ccPAq90y9OqSlBNvBc 7/dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=g1ZkMPHR; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si13027581pgn.233.2018.04.25.00.18.54; Wed, 25 Apr 2018 00:19:08 -0700 (PDT) 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=fail header.i=@ffwll.ch header.s=google header.b=g1ZkMPHR; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751559AbeDYHR1 (ORCPT + 99 others); Wed, 25 Apr 2018 03:17:27 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:53057 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751525AbeDYHR0 (ORCPT ); Wed, 25 Apr 2018 03:17:26 -0400 Received: by mail-wm0-f51.google.com with SMTP id w195so5309776wmw.2 for ; Wed, 25 Apr 2018 00:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=6G8yfGf98+zC7NcoDBVkgx76OzZC5vzKm5AEJdV1VCc=; b=g1ZkMPHR85Dy8OkDc5HG9cwFvWJziwjnBteFZlUup1iEXhKt1KUfWsIwtvb3oAWt6q 7tian8AkcmbCdQ22PlLcUgQKOXVUrWHzydZeBWJ+3IroZBoC+dcY4iodCLKAhbVq+C0f wHcVtZDC20zG5XaHPD82o/Fn5+HTj01Mczo54= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=6G8yfGf98+zC7NcoDBVkgx76OzZC5vzKm5AEJdV1VCc=; b=bIttBO2noXkdnev2MMrtr7vr9H6Bf6z8XLntly2j21QgCbnVR5ViE8Y1Mx4b07xQnP bXTKtsDdD9gAaTi9SSAjIJ0WU4h8BvniRnOImDkWdGdoXMcgx8D92GwaQVHcqlrwcj+Z tKXI58skNtoysTad4mO3uKhi2Gz9ZZ1Nx5k7jOGexGavDwesW/UNQy/bsajrhP45vHRT 3RFewkhmpXQYznOocnCoZTrYCevmXrzzj2FJFFht6OcDDhoZxgVfLWzDM3FjFoNjJ935 rYYVwIGQnNKEhL1srMOegJiF3kF1UG25qbq3rXkbJz1XN0RedQsB2uzUqJfnAVMCvqC8 X+iQ== X-Gm-Message-State: ALQs6tCDl/7hqdfd0jlTa+xjx0JkDV8GjFTZwqw9wbZ4rPN1aSBGeJ4O Pz54g0L95OrbwUzGCNTRKL4JpQ== X-Received: by 10.80.204.143 with SMTP id q15mr37981493edi.71.1524640644746; Wed, 25 Apr 2018 00:17:24 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id o6sm10009558edj.31.2018.04.25.00.17.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Apr 2018 00:17:24 -0700 (PDT) Date: Wed, 25 Apr 2018 09:17:22 +0200 From: Daniel Vetter To: Ayan Kumar Halder Cc: liviu.dudau@arm.com, brian.starkey@arm.com, malidp@foss.arm.com, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, nd@arm.com Subject: Re: [PATCH v3 5/5] drm/arm/malidp: Added the late system pm functions Message-ID: <20180425071722.GN25142@phenom.ffwll.local> Mail-Followup-To: Ayan Kumar Halder , liviu.dudau@arm.com, brian.starkey@arm.com, malidp@foss.arm.com, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, nd@arm.com References: <1524593567-5559-1-git-send-email-ayan.halder@arm.com> <1524593567-5559-6-git-send-email-ayan.halder@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524593567-5559-6-git-send-email-ayan.halder@arm.com> X-Operating-System: Linux phenom 4.15.0-1-amd64 User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 24, 2018 at 07:12:47PM +0100, Ayan Kumar Halder wrote: > malidp_pm_suspend_late checks if the runtime status is not suspended > and if so, invokes malidp_runtime_pm_suspend which disables the > display engine/core interrupts and the clocks. It sets the runtime status > as suspended. > > The difference between suspend() and suspend_late() is as follows:- > 1. suspend() makes the device quiescent. In our case, we invoke the DRM > helper which disables the CRTC. This would have invoked runtime pm > suspend but the system suspend process disables runtime pm. > 2. suspend_late() It continues the suspend operations of the drm device > which was started by suspend(). In our case, it performs the same functionality > as runtime_suspend(). > > The complimentary functions are resume() and resume_early(). In the case of > resume_early(), we invoke malidp_runtime_pm_resume() which enables the clocks > and the interrupts. It sets the runtime status as active. If the device was > in runtime suspend mode before system suspend was called, pm_runtime_work() > will put the device back in runtime suspended mode( after the complete system > has been resumed). > > Signed-off-by: Ayan Kumar Halder > Afaiui we still haven't bottomed out on the discussion on v1. Did you get hold of Rafael? -Daniel > --- > Changes in v3:- > - Rebased on top of earlier v3 patches, > > Changes in v2:- > - Removed the change id and modified the commit message > --- > drivers/gpu/drm/arm/malidp_drv.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c > index 82221ea..c53b46a 100644 > --- a/drivers/gpu/drm/arm/malidp_drv.c > +++ b/drivers/gpu/drm/arm/malidp_drv.c > @@ -768,8 +768,25 @@ static int __maybe_unused malidp_pm_resume(struct device *dev) > return 0; > } > > +static int __maybe_unused malidp_pm_suspend_late(struct device *dev) > +{ > + if (!pm_runtime_status_suspended(dev)) { > + malidp_runtime_pm_suspend(dev); > + pm_runtime_set_suspended(dev); > + } > + return 0; > +} > + > +static int __maybe_unused malidp_pm_resume_early(struct device *dev) > +{ > + malidp_runtime_pm_resume(dev); > + pm_runtime_set_active(dev); > + return 0; > +} > + > static const struct dev_pm_ops malidp_pm_ops = { > SET_SYSTEM_SLEEP_PM_OPS(malidp_pm_suspend, malidp_pm_resume) \ > + SET_LATE_SYSTEM_SLEEP_PM_OPS(malidp_pm_suspend_late, malidp_pm_resume_early) \ > SET_RUNTIME_PM_OPS(malidp_runtime_pm_suspend, malidp_runtime_pm_resume, NULL) > }; > > -- > 2.7.4 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch