Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp628129imm; Fri, 13 Jul 2018 03:41:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfiLFJSgUD2SfHYHt4fVTo2EybqwaAiw+VhC4IiKgLvvGQPqOnBpPPjXeEo6UpUXRtwL68R X-Received: by 2002:a62:9dcc:: with SMTP id a73-v6mr6310701pfk.249.1531478486567; Fri, 13 Jul 2018 03:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531478486; cv=none; d=google.com; s=arc-20160816; b=zFLQYU/JZLVJBODjM10g9UbEz1P9X06YIbMtwYEOwGIEPxCZjAbnGIEVqfTqb5k6ND Jb7inR2QagSyaa6Lab5yDUtnNwKr0TCLNPiEjMoAUcczryzYm8hX1988bPbu/TaxrFIb K4b4I635xm1mxfP/g7dA8+Ny8GZrriSAiaCxENXQq4q5ATLOush0wsDMINjzDnDQkIcq aMWeqGr96h9xSFrRRUTk9sH4nKeVwF7rnMOj9gmFX7c+KWpY0LOXXAJqPacTCv30AuFT 86k4iaw9rETrR37UCm0SFR6NBVPgwHeSrSUqficQpK/ETCCuhI7kg7J6fDhE2TE9qNCY 8juA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=Co+IrUsHHb1633GPt9/1/7O13e9EFJtI2G7LvpR3MK4=; b=ebkxB36l8DGe8/zFuuz2YiEFo0NE8YC7BFMBO56Q4bcCO/0aL/7A0hi+lWz9OayjCZ r2m+pPTc0Fw6NCNkI3YO1AJh9eax3WXu+3zjP7YLfezZrIc9v5bNLXO98ISgvBait2xT IXaoa7k7dOw05f/DnXzQYXLULBa4h7rKOwU4plUmN5sHtTbLCAwPT7jZZGvfEG7tgGFs vJrybai1Kiqq8dSbmI3ngHjl/+3dox6Jb1Jm+XvYtd3cEPrLzoN0gfgVBRkYM0Qg2jSO qNJB5bg9RCZHQrlJ3J7LVmRh9bXdPjDclFQ1GzWGek31BYPVr+XuZedYyHewQ/PucaEq ETzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=IFRInqXZ; 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 p33-v6si23355342pld.318.2018.07.13.03.41.11; Fri, 13 Jul 2018 03:41:26 -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=pass header.i=@agner.ch header.s=dkim header.b=IFRInqXZ; 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 S1728187AbeGMKxx (ORCPT + 99 others); Fri, 13 Jul 2018 06:53:53 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:41588 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727132AbeGMKxx (ORCPT ); Fri, 13 Jul 2018 06:53:53 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 729D85C168B; Fri, 13 Jul 2018 12:39:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1531478386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Co+IrUsHHb1633GPt9/1/7O13e9EFJtI2G7LvpR3MK4=; b=IFRInqXZum3hPZmzjaIdHLH5/TCK1Ic3aPkrzCYHOMCWlyW1C3nUgU0vKBzt5Rhdh7iHE2 fhVFviZPQ0c4bt3Yz+O6+FZAiKqgu6YEOBajXn5wYBHNPDqJRGsoxKSrrXIz9NAD7RwlLQ sasOMyatYK4RXRw/XJkj2db+DURJXnQ= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Fri, 13 Jul 2018 12:39:46 +0200 From: Stefan Agner To: Marek Vasut Cc: Anson Huang , airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, dl-linux-imx Subject: Re: [PATCH] drm: mxsfb: fix runtime PM handling In-Reply-To: <52c0153c-1810-2919-70b7-d57280c83c90@denx.de> References: <1531472085-25174-1-git-send-email-Anson.Huang@nxp.com> <90d16681-2a7a-4826-0411-478353d2afe3@denx.de> <00b5faf737efd1054eb4f0f0e6fc8369@agner.ch> <52c0153c-1810-2919-70b7-d57280c83c90@denx.de> Message-ID: X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 X-Spamd-Result: default: False [-0.85 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; ASN(0.00)[asn:29691, ipnet:2a02:418::/29, country:CH]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.75)[84.04%]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13.07.2018 12:36, Marek Vasut wrote: > On 07/13/2018 12:33 PM, Stefan Agner wrote: >> On 13.07.2018 11:12, Marek Vasut wrote: >>> On 07/13/2018 11:06 AM, Anson Huang wrote: >>> [...] >>>>> >>>>> On 07/13/2018 10:54 AM, Anson Huang wrote: >>>>>> As display power domain is combined with lcdif node on some i.MX >>>>>> platforms like i.MX6SL, when lcdif driver is enabled, the mxsfb_load >>>>>> is called to enable runtime pm, and a pair of pm_runtime_get_sync and >>>>>> pm_runtime_put_sync are also called, that will cause generic power >>>>>> domain driver to disable lcdif power domain and lcdif is no longer >>>>>> working, the lcdif power should ONLY be turned off when display is >>>>>> disabled, so move the pm_runtime_put_sync to mxsfb_unload and remove >>>>>> the pm_runtime_get_sync in mxsfb_unload as well, in this way, when >>>>>> display is enabled, the lcdif power will be always ON until the >>>>>> display is disabled. >>>>>> >>>>>> Signed-off-by: Anson Huang >>>>> >>>>> Doesn't this also mean the block will always be on, thus wasting power ? >>>> >>>> I think drm driver should have somewhere to implement the display >>>> disable case, like when fb0 is blank (echo 1 > /sys/class/graphics/fb0/blank), >>> >>> Isn't this just the fbdev emulation on top of drm/kms ? >>> I think this stuff can be compiled out completely. >>> >>>> then lcdif can be powered gated, and >>>> when display is back on (unblank), lcdif needs to be re-initialization and display will >>>> be on, current implementation is incorrect, with kernel booting up, lcdif >>>> is NOT working at all. >>> >>> It works fine on MX6SX , so I think this is isolated to MX6SL ? >>> I'm CCing Stefan, he might have some valuable feedback here. >>> >> >> Yeah not sure, but putting it in mxsfb_load seems wrong. >> >> MXSFB uses struct drm_simple_display_pipe_funcs which does have >> enable/disable callbacks, probably closer to what we want... > > Seems to me like this is not something that should be hacked around in > the mxsfb driver in the first place, but somewhere else. By somewhere else you mean in the DRM stack? Yeah not sure, currently pm seems to be handled on driver level only, see grep -r -e pm_runtime_get_sync drivers/gpu/drm -- Stefan