Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp601873ybz; Wed, 15 Apr 2020 14:56:53 -0700 (PDT) X-Google-Smtp-Source: APiQypLHaM1SXdJvEeeKxCkot+xNW3/wlS6Nbl4d/RYOwdIcoQhYjEiNB7memCX/lOhaR3oAg5sD X-Received: by 2002:a05:6402:793:: with SMTP id d19mr26930638edy.106.1586987813616; Wed, 15 Apr 2020 14:56:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586987813; cv=none; d=google.com; s=arc-20160816; b=yQRXZJRRwNbGLabRDYC/OLMKqpIwmT75S0IduoNxhPPFqzOJn1Y9oCNTKYq5xI5tm7 pERx4AqAAe3fFZwo+LXVJ9l1Rvfuu2T+5qCu0GBqnvukohhcf85MicC43F2giIhqUjqD OpOsPUPEsyQnFZEUvhrLLMTrZvsYyya64N27JyHEbIhR3/7Y9S+hWEcl/H1BUXgepQfx sEHKNjLN5M1GolCJoqH7B/bWkKRQxEU6AX8VJqU4+qstwnCJ6ROW8yQGonO3Je6DiJd5 EvK7EwJsZz6oF/eEV22atyt5s5zbchqhzx4WYHnSoII29y/rmClDWX0c3XLMkhFUm6yo BNKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Sboir7J5JHHfuv/8YRcQs3g/UUpyT0f4+O+wIPjxg8M=; b=UOG3DmhrWU9qjsXeCK+eQx8C6LcGBIfzdgo9CCgXNjZIvci3wRftPQBni+h3PXrFw9 8HyHpymqifBWkl9+BsVOY81fM1jM7cpbG30f+u+OUDUKQEu0nGWoipQfwV0W6sX6ktrP K2Syfqvr1xAnmOVZGVEftaJxReEIhKJOMP4/HtiGJYXu7CCPM5MqZsKxaJkraTdS6kQi kTll/gPANhqEy3E4pu57C0A70TttGMQKnF2LRxnCr2mjIMrgKGSkjBs8RTyLF2TYAw7g Okgyc1bCDwfRRhR4wD3jDpq5mZY3EVczu4ZqA8cbV+nigTCK55ZyF7eV6dmM1JgBYSLB IUfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si9983398eds.295.2020.04.15.14.56.29; Wed, 15 Apr 2020 14:56:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633715AbgDNVKf (ORCPT + 99 others); Tue, 14 Apr 2020 17:10:35 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:35569 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733025AbgDNVKa (ORCPT ); Tue, 14 Apr 2020 17:10:30 -0400 Received: from mail-qt1-f172.google.com ([209.85.160.172]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPSA (Nemesis) id 1M2w0K-1jPZHx48w0-003MvL; Tue, 14 Apr 2020 23:10:26 +0200 Received: by mail-qt1-f172.google.com with SMTP id s30so11570542qth.2; Tue, 14 Apr 2020 14:10:25 -0700 (PDT) X-Gm-Message-State: AGi0PuZy+Fwkk0wHRtar9vwfFhqYovV5Kvg1DUcY4CACvSE1JrRFNg29 d2qfkznoikgUdl4ttQJMMmFAOfzxo4yEJBpElyI= X-Received: by 2002:ac8:296f:: with SMTP id z44mr16506720qtz.18.1586898624486; Tue, 14 Apr 2020 14:10:24 -0700 (PDT) MIME-Version: 1.0 References: <20200408202711.1198966-1-arnd@arndb.de> <20200408202711.1198966-6-arnd@arndb.de> <20200414201739.GJ19819@pendragon.ideasonboard.com> <20200414205158.GM19819@pendragon.ideasonboard.com> In-Reply-To: <20200414205158.GM19819@pendragon.ideasonboard.com> From: Arnd Bergmann Date: Tue, 14 Apr 2020 23:10:08 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 5/6] drm/rcar-du: fix selection of CMM driver To: Laurent Pinchart Cc: "linux-kernel@vger.kernel.org" , Masahiro Yamada , Nicolas Pitre , Andrzej Hajda , Neil Armstrong , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Kieran Bingham , "David S. Miller" , Saeed Mahameed , Leon Romanovsky , dri-devel , Linux-Renesas , Networking , linux-rdma Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:a8WGAT5AJthQDNS/7Nj8B52n5j60+HG2fzoN+gb2gdj3gP/Jmmx 3SE3HImIDUxg7ZE5314iDoJa4HnsHCm+jX7iNq+huSyITSd/qpiuOFo7h5hTPrGWgaCQoN/ +TIlnb6SmdPVP7uRMde1hCk5woxeuOxJ0LJUI/K/pdwDM5Dp2Xd96PLSmuNPbuKkbm7sCgI Yh1HKrL1EdCRzhDOCBtkw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:vc+0jWPD8GU=:t2YtIX2F85uzHoov9/daVy v5bwqmf6AOehFpMLBYwjQ93cDcnxd4zTvNXPtZd0SLoye9GuzUnnd3chRS7JOXz9f443p+ktf yT+qjz0LykHBIbsiUMAxsU5zVvxHaOyEjeJfyCBuQZTXFwzKCR7Fu25//EN0cdI/0qnw7kjM0 fArbEUmn3vqOeGEE0sdWkTHDNPMwjAg612sLh2r0rYq1Z7enWAcwrQNFNXoecxibFxdDJz9kf Qjd5r7vMgCBOSEGmNhMk/Wgn5QtPP9+Ue2sDu3qqz2V1u4U9s3lEjbm6aBIun4t9nyzoL6yfu hcRYQg8ozaqRg77WnDZCY7nMtY2dhi9VKl7Hoxdq66uDGCjxL+DTKpfWcf8p6j6Obyw7apSak VFmdQx3/4FKuu9xLS/efchZ14z06X/XN0EQTILjFSGCGs/tuMMK+m6cQ1fuiyzADlKz8klwk+ aaZB1oXNY97dGROFHGyZBAX+ObIdzSsjyDuh4i01sWMRVfsAUF06Dz7bTUS4OKKgq2Gcs09Az EY+WEf95JvIKPLOGNKf2eS55NUixc3LmL9p+78gBs2XOpIe9dvyUjZpmrQUzNAOf5LBD/TuaI tFBwz5ejlY3exAdXOrEM4H3A5+h8p+Y5SFhyCnsW2CgppPC9ce79IeDfmAJ1BKOBxRnzKZP9R dzOY2qsbNQgMAIPk91JJVcqIjLD5uJHFPkZ76/u4pVdMO8LCgTg/2JRir8xFKXcxKfqqLKjbO sxE/uolwifZ90Pr7GvegjjiGlOPJ0lOMP88Tyz2/HVMCFO81H9KxV6fZS+7npfpdfFPOi89RL tmM2VWADXOEZeTQXW71eaYACIoF04ObCEwAeh9DOT1jKZuNLb8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 14, 2020 at 10:52 PM Laurent Pinchart wrote: > > Hi Arnd, > > On Tue, Apr 14, 2020 at 10:38:27PM +0200, Arnd Bergmann wrote: > > On Tue, Apr 14, 2020 at 10:17 PM Laurent Pinchart wrote: > > > On Wed, Apr 08, 2020 at 10:27:10PM +0200, Arnd Bergmann wrote: > > > > The 'imply' statement does not seem to have an effect, as it's > > > > still possible to turn the CMM code into a loadable module > > > > in a randconfig build, leading to a link error: > > > > > > > > arm-linux-gnueabi-ld: drivers/gpu/drm/rcar-du/rcar_du_crtc.o: in function `rcar_du_crtc_atomic_enable': > > > > rcar_du_crtc.c:(.text+0xad4): undefined reference to `rcar_lvds_clk_enable' > > > > arm-linux-gnueabi-ld: drivers/gpu/drm/rcar-du/rcar_du_crtc.o: in function `rcar_du_crtc_atomic_disable': > > > > rcar_du_crtc.c:(.text+0xd7c): undefined reference to `rcar_lvds_clk_disable' > > > > arm-linux-gnueabi-ld: drivers/gpu/drm/rcar-du/rcar_du_drv.o: in function `rcar_du_init': > > > > rcar_du_drv.c:(.init.text+0x4): undefined reference to `rcar_du_of_init' > > > > arm-linux-gnueabi-ld: drivers/gpu/drm/rcar-du/rcar_du_encoder.o: in function `rcar_du_encoder_init': > > > > > > > > Remove the 'imply', and instead use a silent symbol that defaults > > > > to the correct setting. > > > > > > This will result in the CMM always being selected when DU is, increasing > > > the kernel size even for devices that don't need it. I believe we need a > > > better construct in Kconfig to fix this. > > > > I had expected this to have the same meaning that we had before the > > Kconfig change: whenever the dependencies are available, turn it on, > > otherwise leave it disabled. > > > > Can you describe what behavior you actually want instead? > > Doesn't "imply" mean it gets selected by default but can be manually > disabled ? That may be what it means now (I still don't understand how it's defined as of v5.7-rc1), but traditionally it was more like a 'select if all dependencies are met'. > > > > --- a/drivers/gpu/drm/rcar-du/Kconfig > > > > +++ b/drivers/gpu/drm/rcar-du/Kconfig > > > > @@ -4,7 +4,6 @@ config DRM_RCAR_DU > > > > depends on DRM && OF > > > > depends on ARM || ARM64 > > > > depends on ARCH_RENESAS || COMPILE_TEST > > > > - imply DRM_RCAR_CMM > > > > imply DRM_RCAR_LVDS > > > > select DRM_KMS_HELPER > > > > select DRM_KMS_CMA_HELPER > > > > @@ -15,9 +14,8 @@ config DRM_RCAR_DU > > > > If M is selected the module will be called rcar-du-drm. > > > > > > > > config DRM_RCAR_CMM > > > > - tristate "R-Car DU Color Management Module (CMM) Support" > > > > + def_tristate DRM_RCAR_DU > > > > depends on DRM && OF > > > > - depends on DRM_RCAR_DU > > > > help > > > > It would be easy enough to make this a visible 'bool' symbol and > > build it into the rcu-du-drm.ko module itself. Would that help you? > > That could indeed simplify a few things. I wonder if it could introduce > a few small issues though (but likely nothing we can't fix). The two > that come to mind are the fact that the module would have two > MODULE_DESCRIPTION and MODULE_LICENSE entries (I have no idea if that > could cause breakages), and that it could make module unloading more > difficult as the CMM being used by the DU would increase the refcount on > the module. I think the latter could be worked around by manually > unbinding the DU device through sysfs before unloading the module (and I > can't say for sure that unloading the DU module is not broken today > *innocent and naive look* :-)). In that case, a Makefile trick could also work, doing ifdef CONFIG_DRM_RCAR_CMM obj-$(CONFIG_DRM_RCAR_DU) += rcar-cmm.o endif Thereby making the cmm module have the same state (y or m) as the du module whenever the option is enabled. Arnd