Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp557256imm; Fri, 13 Jul 2018 02:14:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfDd7x3BkJXhVloDlP7ZxP+FGmmQOQ8MDfBfuBYJzLiJ0pRUO6HReU9FUc77NHUmkt+o79g X-Received: by 2002:a65:448a:: with SMTP id l10-v6mr5336104pgq.382.1531473263912; Fri, 13 Jul 2018 02:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531473263; cv=none; d=google.com; s=arc-20160816; b=E41Krc0AodU4F2WMoODy2unWSSTSN/gVhxhH1kFAznixgxAwoY3YS/nkMscrYpuoUg Jp0JjVWHT0JCcQ5P1nFKP9Hd85uU8VrIKW3QYwTg8WjMjQVNDh3qETcZ/z71h3rLoIoc +SyagPk71UAE5t4n7Aq4gYKJiJaR0MtbGuJyrf7Tpp8nJNqVr0UJfVGdZxIfUHpJxhRS z+NMq7gdaTHiBgjrul23Y+feM+rGkBKYHLXW38FnChr+UxVqiulyCgZJCx25XH17QBJl UobynKWPWqADGI917dTS5ajfiLLsLJnG7Aljgzz1Jp76b5qwuuqkan8g+ZErdEXnD3Dr XuCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=5Tpr/gIW86u12JaYB5JS/MK7mJkomeJf5Kyjg4tCAtQ=; b=PAAs7XHyVTWiELQrX+jSady45ShbjcM9zXpDMUjFlCYbhnENQO+MT7MU73ZWZHHP44 t1sE4jtE9K1qKsKMXVzeFGrZHLoPmzcVgA9M0OdQlncxZyl9v0VT9Zx3chJABd5lFdXF vy5e8fd7eel+dZlBfMNaZ5DZlThQ/dPqTBOq7N2KbeBAg0WmWm8HGOj4w7ES7bQzHWbo /SQHzzAjHkbyYFAF0k0GPCnCvCy+wvBAVG17vPz1hLlAfnjeQ/7Y73hPSBgPyJUEgqi1 Jm5L5hdcA53gQ5HEbC22Cd+oNmMl1vdp0gqQ56Kpge/bJrazu2N2gaTRk4vFuqs6F4lC Ed4w== ARC-Authentication-Results: i=1; mx.google.com; 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 80-v6si22419265pgf.604.2018.07.13.02.14.08; Fri, 13 Jul 2018 02:14:23 -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; 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 S1727434AbeGMJ0j (ORCPT + 99 others); Fri, 13 Jul 2018 05:26:39 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:57130 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726389AbeGMJ0j (ORCPT ); Fri, 13 Jul 2018 05:26:39 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 41RnC66rNQz1qxDD; Fri, 13 Jul 2018 11:12:50 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 41RnC65xqTz1wj80; Fri, 13 Jul 2018 11:12:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id nNigbCoDp03G; Fri, 13 Jul 2018 11:12:49 +0200 (CEST) X-Auth-Info: sbtMl29f1Tj+haHQNqtX68tcR5nsmbUH9gm86/TBdI8= Received: from [IPv6:::1] (unknown [195.140.253.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 13 Jul 2018 11:12:49 +0200 (CEST) Subject: Re: [PATCH] drm: mxsfb: fix runtime PM handling To: Anson Huang , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Cc: dl-linux-imx , Stefan Agner References: <1531472085-25174-1-git-send-email-Anson.Huang@nxp.com> From: Marek Vasut Message-ID: <90d16681-2a7a-4826-0411-478353d2afe3@denx.de> Date: Fri, 13 Jul 2018 11:12:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > The runtime power gating case can be implemented later to save power, > need lcdif experts to do it. Thanks. > > Anson. > >> >>> --- >>> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +-- >>> 1 file changed, 1 insertion(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c >>> b/drivers/gpu/drm/mxsfb/mxsfb_drv.c >>> index ffe5137..1ba179b 100644 >>> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c >>> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c >>> @@ -235,7 +235,6 @@ static int mxsfb_load(struct drm_device *drm, >>> unsigned long flags) >>> >>> pm_runtime_get_sync(drm->dev); >>> ret = drm_irq_install(drm, platform_get_irq(pdev, 0)); >>> - pm_runtime_put_sync(drm->dev); >>> >>> if (ret < 0) { >>> dev_err(drm->dev, "Failed to install IRQ handler\n"); @@ -264,6 >>> +263,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long >>> flags) >>> err_irq: >>> drm_panel_detach(mxsfb->panel); >>> err_vblank: >>> + pm_runtime_put_sync(drm->dev); >>> pm_runtime_disable(drm->dev); >>> >>> return ret; >>> @@ -279,7 +279,6 @@ static void mxsfb_unload(struct drm_device *drm) >>> drm_kms_helper_poll_fini(drm); >>> drm_mode_config_cleanup(drm); >>> >>> - pm_runtime_get_sync(drm->dev); >>> drm_irq_uninstall(drm); >>> pm_runtime_put_sync(drm->dev); >>> >>> >> >> >> -- >> Best regards, >> Marek Vasut -- Best regards, Marek Vasut