Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp549540imm; Fri, 13 Jul 2018 02:04:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdJtmLczl+mNt3ZyYZt7uYt6XY9+E4TRhXZ+Oehxn0/9/woqn/u7PBxfuvK/tjbZFZmU04s X-Received: by 2002:a65:428b:: with SMTP id j11-v6mr5213073pgp.200.1531472688821; Fri, 13 Jul 2018 02:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531472688; cv=none; d=google.com; s=arc-20160816; b=rDuKCAtGyrGiVvV1GbmJ4Wq8qpZz2hAUoHn8Q36ZPM5MUVKaGygWAXZrdy+gHgzaGq Cxn2nJp1c/P/qLxpqEoOaUJZypto6Z3fDuTgEoIcI+AGXG6DEUtbqEHdctT7DmdadXvV vbfwkJZr4fJm8pQCkH0QiqLM9lsSMrqddtV0dgEHP2hFP4nox0Md6joZ2HK1mcprZZ6i AXb/rOksK9b29F1SZGOBgGl1G5/L5guXJULYFKemBfy3rCmeYEbcL7uN5CXC9tRxaOLd EaFOW+FIi7utjnVl2ArOxFhQizTHElG3pPNHRAHx4IDrXdpV2/jg8KJSBVBs6dvfkZrZ Klow== 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=vA16NvXXgHGf3wOwGyDkdCKktS5ZgDTNut4eFsxOGk0=; b=0u/RARs+AszPs0lAjRMHBocZI7W211JFaSMHsuHWNgvIzc7FOsp0/vG0BzAiur1cnX cZHDkKQ24qZwzAq0l+4kz1b+/U83p1gySWz7koezIN7mMy3xfKvIvd2h8A3g6QqwBU6d oytNQE9OI4XhkDSU0r4yEr+1Q7L3hqPGd080BUS/eayiCls9yjs1JVHj/pARWeDwv4n8 jrA/YzKcr4Up+DuuPATnIOKg5Ynt3S4tHcIOaNyhnSgV0YDih1o0WiU5vwuUkz+sOX7W /muu+2BpKrxjSBv3lEAHRiqKu82AzVwB14qo9TaygPrmjN4613OcHkT+3kNSc5Fzoi60 4TRQ== 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 26-v6si22729818pgo.169.2018.07.13.02.04.33; Fri, 13 Jul 2018 02:04:48 -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 S1729617AbeGMJRC (ORCPT + 99 others); Fri, 13 Jul 2018 05:17:02 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:47496 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726309AbeGMJRC (ORCPT ); Fri, 13 Jul 2018 05:17:02 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 41Rn050LvFz1qvnJ; Fri, 13 Jul 2018 11:03:17 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 41Rn046wNfz1ttK6; Fri, 13 Jul 2018 11:03:16 +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 bIWZPoXoFmeB; Fri, 13 Jul 2018 11:03:16 +0200 (CEST) X-Auth-Info: jh4l3q0FhXogtRw3+WsnJjdtj99RFXsyjJhgBDlHe8Q= 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:03:16 +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: Linux-imx@nxp.com References: <1531472085-25174-1-git-send-email-Anson.Huang@nxp.com> From: Marek Vasut Message-ID: Date: Fri, 13 Jul 2018 11:03:15 +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: <1531472085-25174-1-git-send-email-Anson.Huang@nxp.com> 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 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 ? > --- > 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