From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BFEEC001B3 for ; Fri, 23 Jun 2023 15:34:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232128AbjFWPea (ORCPT ); Fri, 23 Jun 2023 11:34:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232560AbjFWPe2 (ORCPT ); Fri, 23 Jun 2023 11:34:28 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C13F01FC0; Fri, 23 Jun 2023 08:34:27 -0700 (PDT) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CABB2838; Fri, 23 Jun 2023 17:33:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1687534430; bh=Lkq4FXI4Zx7ehHOm06R2q1AjaZcAkQ4pUJeFbYnNjgw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZhOVG6gdVVJMNBEAjOH08MEo2syxQ27VbmXUeiXe7eNwUI0vkepXtGO3YKi//qT3n 5a0PRggHwJ8Tx39nnOFMEqcKRJMaBMtTmFpU8YGQxz2x7Qv7VKOnhfbpoN3lbfueoi mwSLnm6e3Hj/uCTRuQkLDI4iybYLmzd2h9IPXGtE= Date: Fri, 23 Jun 2023 18:34:25 +0300 From: Laurent Pinchart To: Geert Uytterhoeven Cc: Kieran Bingham , David Airlie , Daniel Vetter , Thomas Zimmermann , Magnus Damm , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/39] drm: renesas: shmobile: Add support for Runtime PM Message-ID: <20230623153425.GQ2112@pendragon.ideasonboard.com> References: <742b3351c1aed1f546ac2dcc1de15e0d04cc24d4.1687423204.git.geert+renesas@glider.be> <20230623150742.GK2112@pendragon.ideasonboard.com> <20230623151109.GL2112@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org On Fri, Jun 23, 2023 at 05:22:45PM +0200, Geert Uytterhoeven wrote: > On Fri, Jun 23, 2023 at 5:11 PM Laurent Pinchart wrote: > > On Fri, Jun 23, 2023 at 06:07:44PM +0300, Laurent Pinchart wrote: > > > On Thu, Jun 22, 2023 at 11:21:18AM +0200, Geert Uytterhoeven wrote: > > > > The SH-Mobile LCD Controller is part of a PM Domain on all relevant SoCs > > > > (clock domain on all, power domain on some). Hence it may not be > > > > sufficient to manage the LCDC module clock explicitly (e.g. if the > > > > selected clock source differs from SHMOB_DRM_CLK_BUS). > > > > > > > > Fix this by using Runtime PM instead. > > > > > > > > Signed-off-by: Geert Uytterhoeven > > > > --- > > > > drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 11 ++++++++++- > > > > drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 5 +++++ > > > > 2 files changed, 15 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c > > > > index fbfd906844da490c..84dbf35025d7be63 100644 > > > > --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c > > > > +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c > > > > @@ -9,6 +9,7 @@ > > > > > > > > #include > > > > #include > > > > +#include > > > > > > > > #include > > > > #include > > > > @@ -170,10 +171,16 @@ static void shmob_drm_crtc_start(struct shmob_drm_crtc *scrtc) > > > > if (WARN_ON(format == NULL)) > > > > return; > > > > > > > > + ret = pm_runtime_resume_and_get(sdev->dev); > > > > + if (ret) > > > > + return; > > > > + > > > > /* Enable clocks before accessing the hardware. */ > > > > ret = shmob_drm_clk_on(sdev); > > > > > > This would be best located in the runtime PM resume handler. Same for > > > disabling clocks in the runtime PM suspend handler. > > > > The driver should then depend on CONFIG_PM. There's no indirect > > dependency through CONFIG_DRM as far as I can tell, but there's one > > through ARCH_SHMOBILE. This then got me puzzled, as ARCH_SHMOBILE is > > defined in arch/sh/Kconfig, and this driver depends on ARM. Am I missing > > something ? > > Vommit 4bd65789ba847f39 ("drm: shmobile: Make DRM_SHMOBILE visible on > Renesas SoC platforms") in drm-next: > > - depends on DRM && ARM > - depends on ARCH_SHMOBILE || COMPILE_TEST > + depends on DRM > + depends on ARCH_RENESAS || ARCH_SHMOBILE || COMPILE_TEST That's better indeed :-) A dependency on CONFIG_PM is still needed as ARCH_RENESAS doesn't depend on it. -- Regards, Laurent Pinchart