Received: by 10.213.65.68 with SMTP id h4csp2333975imn; Mon, 9 Apr 2018 01:30:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+s8owuuH1MFX1XB9w+FJ7663ZzKKBs1MeosHEAANIPzXwCg+89Fdd8bzy4PLUmg7HBBz9Z X-Received: by 2002:a17:902:2f03:: with SMTP id s3-v6mr39092096plb.274.1523262651240; Mon, 09 Apr 2018 01:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523262651; cv=none; d=google.com; s=arc-20160816; b=wPkJF79ZffL/nt6OojFwvq88PIxnARkrdGYmDQV9iHPcloIxFioRWhU3ghkvdMCzj/ 3m2DshRPNm+Zfcxkc2eAu+eeSDViBvDl8QnabnouYZyCxSglgjlEt9VVZ1A6mDerOBjQ ZsspBvs2EU/tx12LIwnXF+ZhFD3MhNaezjLLo2wI8Pt6GZHxvnaklqrXh/rZVloA/t/h J7IhM1M5jAK45CqMu/Ddx3jGJXHNWdVZpw2JgYDcufnV0KU7ss9t3ukfNMWl4l1rKSBM WWgjKoTYmR2Gv4QHfxVHABY5DFWCwVxHM3xe+UUYKmQUk96iEIxwVgoAssztrxXDZCt4 2p4Q== 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=P0bupqhrkjEuj/SivqHAtbDWNQnNHjY3e0v1w3X97XY=; b=ybk9vQ3bsZEEBrADEmn175O+xKtwkCCR4/bOidjzX5IEshddvIjNjI4/V55Pmmtcu/ DM7rJEwmJzDRYLpu2eS+0ipnv4f9qp6DOsevKC79v4tLKrMOjWwCbkZVqxCW0omyOPzJ WYpErBbXrKMq/QjUuRUygYePwLhCzXh+UAIv4Fu5HXf6OYXy+OOk6nR8ynB3y643wUfc chsOW+n2Us/0U3beRdz0NBNV1cCMRLgZNF5P49vS89iKKLM6lsP9dMGUpQ1Du7lfTDoQ vIRMfyQK0DMNtgpB8vgOEshnQc7iSTQ+FY28G8Yj+STEZb3tAvDijrhe8nyDSoyqrmkQ zx1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=BnAmFEF6; 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 y7-v6si14071611plh.583.2018.04.09.01.30.13; Mon, 09 Apr 2018 01:30:51 -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=BnAmFEF6; 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 S1752077AbeDIIXn (ORCPT + 99 others); Mon, 9 Apr 2018 04:23:43 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:50985 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750863AbeDIIXl (ORCPT ); Mon, 9 Apr 2018 04:23:41 -0400 Received: by mail-wm0-f65.google.com with SMTP id t67so17093586wmt.0 for ; Mon, 09 Apr 2018 01:23:40 -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=P0bupqhrkjEuj/SivqHAtbDWNQnNHjY3e0v1w3X97XY=; b=BnAmFEF64/0c5h/ghz7mfnd3BXMDXuU2MMt9mnjlA5ebycb0iRyfH2qCPMa6IWoxa5 pbPIIkRXaCyu3QHrNT2nb3r0IlmdgbZsllz/2zBWmU1UBosq9/86M7i3LIxDEQ9D2r1m dAU5wLFK9hXYsWYM0UJ/1dflvBTZl4nLUsARY= 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=P0bupqhrkjEuj/SivqHAtbDWNQnNHjY3e0v1w3X97XY=; b=k6JltLyDGrRCBEWyLpP0gw/qc86jR8/1902nEL4IMgcuCBVeC/sekRgddWTJlTwtm5 AASgoMEsMB1DStM/2EV25Wqixcp5xfuOkkY8YrRelhYK0Scev1SCzpK+WjV2hto2+RoS 5s8dfyBPtMzldbgxUg1y0JKyIqOUXicCY4tWIBY4ZC6fpQ8iIbLQFfuHnmy5R+RRfmcy GOEidyfzQ/skJ65z8gMb3A6KTf6KC35DfDT+N15vxzd9MpSzPS1sucre29EWm71SwYUs kVzup//OZAnl41vef14lD4DBJHhoTpRkNTcVVN6svE3iEHS1eyAi5ktztYm+SmCvtK6h 3cDw== X-Gm-Message-State: ALQs6tDd/oN7eFv9Z/GEfCOv3/ogyBZscGsmO4SytVQ8KF/elWVCI+3E GkK0bxVFU2e4sw6GLfbHMyNS6Q== X-Received: by 10.80.221.71 with SMTP id u7mr2288767edk.209.1523262220043; Mon, 09 Apr 2018 01:23:40 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id n8sm46964edi.69.2018.04.09.01.23.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 01:23:39 -0700 (PDT) Date: Mon, 9 Apr 2018 10:23:37 +0200 From: Daniel Vetter To: Ayan Halder Cc: Daniel Vetter , Liviu Dudau , Brian Starkey , Mali DP Maintainers , Dave Airlie , dri-devel , Linux Kernel Mailing List , nd Subject: Re: [PATCH 8/8] drm/arm/malidp: Added the late system pm functions Message-ID: <20180409082337.GG31310@phenom.ffwll.local> Mail-Followup-To: Ayan Halder , Liviu Dudau , Brian Starkey , Mali DP Maintainers , Dave Airlie , dri-devel , Linux Kernel Mailing List , nd References: <1522083800-30100-1-git-send-email-ayan.halder@arm.com> <1522083800-30100-9-git-send-email-ayan.halder@arm.com> <20180327082903.GS14155@phenom.ffwll.local> <20180327095907.GA18146@arm.com> <20180406190216.GA18433@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180406190216.GA18433@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 Fri, Apr 06, 2018 at 08:02:16PM +0100, Ayan Halder wrote: > On Tue, Mar 27, 2018 at 01:09:36PM +0200, Daniel Vetter wrote: > > On Tue, Mar 27, 2018 at 11:59 AM, Ayan Halder wrote: > > > On Tue, Mar 27, 2018 at 10:29:03AM +0200, Daniel Vetter wrote: > > >> On Mon, Mar 26, 2018 at 06:03:20PM +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. Subsequently, malidp_pm_resume_early will invoke > > >> > malidp_runtime_pm_resume which enables the clocks and the interrupts > > >> > (previously disabled) and sets the runtime status as active. > > >> > > > >> > Signed-off-by: Ayan Kumar Halder > > >> > Change-Id: I5f8c3d28f076314a1c9da2a46760a9c37039ccda > > >> > > >> Why exactly do you need late/early hooks? If you have dependencies with > > >> other devices, pls consider adding device_links instead. This here > > >> shouldn't be necessary. > > >> -Daniel > > > We need to late/early hooks to disable malidp interrupts and the > > > clocks. > > > > Yes, but why this ordering constraint? Why can't you just disable the > > interrupts/clocks in the normal suspend code. I see that the patch > > does this, I want to understand why it does it. > > -Daniel > Apologies for my delayed response on this. > > With reference to https://lwn.net/Articles/505683/ :- > 1. "suspend() should leave the device in a quiescent state." We invoke > drm_mode_config_helper_suspend() which deactivates the crtc. I > understand that this is the quiescent state. > > 2. "suspend_late() can often be the same as runtime_suspend()." We > invoke runtime suspend/resume calls in late/early hooks. This article is from 2012. That's not really recommended best practices anymore. device_links have only been added a few years ago, so ofc an article from 2012 can't tell you that you should use those instead :-) That's why I brought this up, we have much better ways to handle device dependencies now. Also, you still haven't explained what exactly the dependency is. -Daniel > > > >> > --- > > >> > 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 bd44a6d..f6124d8 100644 > > >> > --- a/drivers/gpu/drm/arm/malidp_drv.c > > >> > +++ b/drivers/gpu/drm/arm/malidp_drv.c > > >> > @@ -766,8 +766,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 > > >> _______________________________________________ > > >> dri-devel mailing list > > >> dri-devel@lists.freedesktop.org > > >> https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. > > > _______________________________________________ > > > dri-devel mailing list > > > dri-devel@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > > > > -- > > Daniel Vetter > > Software Engineer, Intel Corporation > > +41 (0) 79 365 57 48 - http://blog.ffwll.ch -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch