Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12852122rwd; Fri, 23 Jun 2023 11:34:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4j2Be7wNg+Tpnhk42ClkC8lZnI1427uWeZIlV0MkArX0Fy27hlRFsu348BLiOikMpQmoN1 X-Received: by 2002:a17:902:f688:b0:1ac:6b92:70c8 with SMTP id l8-20020a170902f68800b001ac6b9270c8mr27472942plg.48.1687545248992; Fri, 23 Jun 2023 11:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687545248; cv=none; d=google.com; s=arc-20160816; b=QIkFA1ZlT6rC+uLbnyg1crhzEot0sUUNdBXg784vJfo/+yPsAsoG0iMIBAc2OsryeV YdRsGMgx+qhS4TFsBWmFYJD7Bn+omLDh24EEsSck1KhT7VE/JXGHEtmO9+Jbp6z7BxD1 k372vqJZFh61FP/w67SkwyeYv8JMH493/3IHeU8xvFhmuGjPPWTUq+H/tp9SWyEoTPph XlAr74wiCW92Zrutf7Npwmde+hyBibdbIsnIleFmS9cAwXsHpwNVSDOBBLiEy8yPCxZQ e6PI14S13WVkHMXAsUxHBWYoDg6uRi7x8sN90ffCTJcP5ppjorUDU3XtYj02PaLqSTVK Q51g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=A390cPtb1gq3TWFUg2HKxFr4tV9e1CAv7cGL1dByLyE=; b=odq+Ig+EPWLk4b0r4X74N4Wgs4aDCdEbtcgDxD21sfuEO6mF+A3LijsdqQfV/EHDfc QCVvBDcn9tYecbGcuZppPiYskKySyuBQWjhD9fzMGk08oh/Tk9WhI+drwiSKqKdsVF4R UytwAmXsbXmM86EUCOeoJejExDMb6QtGB79TaNwxzpztNd4+67OeJuQP2ZoMlqLlH62l 87Mfkaoi9Eltva8f/FQMrZMZu3/+NWtkmvMaEPlwmn+FcKJFFweDQP++e1IaQQEKKufu R5Mqg4Hvtq/5yX7FyYaNfckNFfQg8OjKllSb7Mz9guZLZI8+a3hyHiPhDCET4++zAEYq sCXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=OPb5chPn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a170902b68900b001b22f31cce9si8790533pls.179.2023.06.23.11.33.55; Fri, 23 Jun 2023 11:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=OPb5chPn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232026AbjFWRwf (ORCPT + 99 others); Fri, 23 Jun 2023 13:52:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231356AbjFWRwb (ORCPT ); Fri, 23 Jun 2023 13:52:31 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDD2526AF; Fri, 23 Jun 2023 10:52:30 -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 0E53D838; Fri, 23 Jun 2023 19:51:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1687542712; bh=6rT+n6mijf4+BiTWtjg5ainxi9bp14qGHZoBtspMrmA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OPb5chPnpf4jYQBzGlpPUlVg8zmUuRTOqy7IqqaVgYGXk6H2vkvu8AROWnGE7zvim dABdk2AhBa6Y7SSL3O2GwIZTvyRLerqVGBVYqUgr+5DPXY0HMRPTWBZUW2mMVDQKxZ SNXQTYNOtAGP/wfDxBfmWdRXjvkyQGGT9e37Hh+8= Date: Fri, 23 Jun 2023 20:52:27 +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: <20230623175227.GP2112@pendragon.ideasonboard.com> References: <742b3351c1aed1f546ac2dcc1de15e0d04cc24d4.1687423204.git.geert+renesas@glider.be> <20230623150742.GK2112@pendragon.ideasonboard.com> <20230623151109.GL2112@pendragon.ideasonboard.com> <20230623153425.GQ2112@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, On Fri, Jun 23, 2023 at 07:41:36PM +0200, Geert Uytterhoeven wrote: > On Fri, Jun 23, 2023 at 5:34 PM Laurent Pinchart wrote: > > 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. > > ARCH_RMOBILE selects PM, so PM will be enabled on affected platforms. Which also means that you will never test compilation without CONFIG_PM, while bots will. There's a risk of introducing compilation warnings. -- Regards, Laurent Pinchart