Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp706888ybz; Wed, 15 Apr 2020 17:09:43 -0700 (PDT) X-Google-Smtp-Source: APiQypJbdoMy12+cZ1O6gRNK6wW7nx3B3BM/Cuj5vrWnYplZ19xQSu3rc0xEHWtrDHKpCAVa8J5Z X-Received: by 2002:a17:906:c9c1:: with SMTP id hk1mr7536087ejb.146.1586995783474; Wed, 15 Apr 2020 17:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586995783; cv=none; d=google.com; s=arc-20160816; b=gBWYnenUB6/Oo7n0dIEXHCWGnMYiatsh3inilpjltEjBm6TXf/2sd+WIxoIio5nUrs aUJX3QubGPgWK4tkyQi1rX09zw2ihefyuECboGnLS/5b42dyVXpELgSuSN81qUoRw8y9 v5prgt7ZX7/Ju8rlcCpTBbzqTUfldWKuudwXwqcqt77UpZUPT5BvUO9HMteOpIUC9Mmu O57XDBz3e/airld9nskww+jhmVDmmUtQ0vzfVS4QLqs4XnSfTyR6to0gcXqI2MJmsjaD zIXJTjdqC4crfdCJYYH1QK5TfdHoyKEmnnY+gzAZlHwFNa+StZTQAJ1f8W3PPrLGqJlD uaQQ== 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=/Gt7M+RuQIzyJOeJqT0MWmg4GB8D71MVJXJNFoJPodE=; b=PONBS4mNHYM23sDcAoTUSiIHPN6e+rBJphy65Zh7Gz47UXNrE1ZicehbhiNJZpj0Pu jNljwtDIvfP4wY+GekpoOLZLBeGzen5GX0A3B1Yo9Ds2V2m5Lsm23DIW+PWuBf0sf+D5 tSIvYV+GJ3JHP/ETE50fxGA1gzeKXsVXaYtlFz/QyFp9erxGSkGjnllhANuv0G7hEw1H U88IpCZyalKn2Y+KylrkTfoydi97U+5/6NN5Hk0eC6kh5G4AxEvM3S+mTTLpmNqWrP+E jIRPTJ74wu+bGPm3YRq+OkTRXLD/3H9F/3EE8Oe6m2VST7r1rQn434Lk/kpu4ScnyWRk RkEA== 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 k26si3042737ejs.504.2020.04.15.17.09.19; Wed, 15 Apr 2020 17:09:43 -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 S2636503AbgDOONx (ORCPT + 99 others); Wed, 15 Apr 2020 10:13:53 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:36991 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2636464AbgDOONk (ORCPT ); Wed, 15 Apr 2020 10:13:40 -0400 Received: by mail-oi1-f193.google.com with SMTP id r25so3688150oij.4; Wed, 15 Apr 2020 07:13:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/Gt7M+RuQIzyJOeJqT0MWmg4GB8D71MVJXJNFoJPodE=; b=kUd/Xa/FC50VWPa21LftEpFTamN5dQ+OQNYWc7HISdQRVAA5uEdwRCjFIFUZa2Tx22 Cqi1jCWR+DbzrZJzhv7v2KHFTn1EqZJd+diChuv2WDUJnp5N63L5LsqIPsBmEJEs3r8n 2G7BJ/byOeoN6mzUaxMGW6zcLVZAWV1yS2/tMrJhHXYP8KJA72z+Ers6dzL7m5EVpSR6 Z7XsPIOc5OsHNOL0oDqvCNDe9gZIFP9en2yFNUqc9lN4WkSUxo7+dZYwNxE13E+dPcfA DscVdL+GtYY1EnnuFKWGiR+Zs7V/iLSzMJoScZ7kTq9ekVNoKc8uJTnGentlszFCAq/I Mxbg== X-Gm-Message-State: AGi0Pub5KogBU3xeumkh9EzDs3LnAhRVnYXuTXpmqHSNMvyFQbeziu82 BI+UTqKBCDF7gdvspB3UY9Dj58MXQtaElYnNKG4= X-Received: by 2002:aca:f541:: with SMTP id t62mr4667388oih.148.1586960018814; Wed, 15 Apr 2020 07:13:38 -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: From: Geert Uytterhoeven Date: Wed, 15 Apr 2020 16:13:27 +0200 Message-ID: Subject: Re: [RFC 5/6] drm/rcar-du: fix selection of CMM driver To: Arnd Bergmann Cc: Laurent Pinchart , "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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Wed, Apr 15, 2020 at 3:47 PM Arnd Bergmann wrote: > On Tue, Apr 14, 2020 at 10:52 PM Laurent Pinchart > wrote: > > 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'. That's still what it is supposed to mean right now ;-) Except that now it should correctly handle the modular case, too. > > > > > --- 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. What about dropping the "imply DRM_RCAR_CMM", but defaulting to enable CMM if DU is enabled? config DRM_RCAR_CMM tristate "R-Car DU Color Management Module (CMM) Support" depends on DRM_RCAR_DU && OF default DRM_RCAR_DU Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds