Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp743522pxb; Wed, 27 Oct 2021 11:30:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytWRk2QWhv7hw8zUF03WzH9JLNHpBDMXQH4P7Pd8QJ2C0/tv844rjm4qXs4zeK1+WA0Ay0 X-Received: by 2002:aa7:c6c7:: with SMTP id b7mr8216747eds.115.1635359457808; Wed, 27 Oct 2021 11:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635359457; cv=none; d=google.com; s=arc-20160816; b=mwsqs4ux4a+OzDZNC6tODs7pq4jbOQjfNcQCBAkoBy4JjtWkLQmSvutxIy1axlE9OY 5BPMowQyN/XKlX9eh1mg90ZreJIe66yHs4XwspByhrkY2FPedxO+LjGF/o91yPqMUbdz ySim8wpXBRT9lwow6VPEBwfcYl84AEB+K0m4/wx1rtEsq8V+t6rB1OQkW+v26onsPSTY ehlhgj1sZFWGyZWEJR4rRfLRRJHNiR2nVDCt7ko6ZpFevHXDIIG1fnjoxk3AJ4ChI7Z9 xwjorHYFHEAC966XGG8LbCbslCLmzRYXs75fKvF4S4akd4vOih6c1cWfVQU87GYEMuIB yWLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Rqg3stQt4XtdbZ4gHdaa4uO9gPGzOkCoc22v00/z/Gc=; b=nDecjfN55a1oX5D8ij+dtPH1EQ4FNI9sKD82WgB/rwlSWzneQreFogXJVh0UfvOxYY cKS44WIfvsbzD7MujpPo1yJeCRb7hPUyS280uIb6CSp8V+EUst3Wpd/oJe/4MX9lRmg/ 1ekI2IKoGr6ZdqoKEYlUsORtLZ9R2J3OJSl6sEAfmu7uR4BrTDFVHnWhHDzSIxK76apJ 0I9kJQ87M1xmOa3A6vwv3e6DAiYF1rf9qvZn8FM6xd9bIdBupBSJVv1qPudCvQpp89Z/ 7J7dNjz6XtP+Gsl96J7Yc+cTBsklApG31x0mtpjNKHmgDIb9VI1Gm8rAHDcoHuiq3Qyj 1uzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=fIjDTjmZ; 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 o2si713408edj.547.2021.10.27.11.30.31; Wed, 27 Oct 2021 11:30:57 -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; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=fIjDTjmZ; 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 S238563AbhJ0G2n (ORCPT + 99 others); Wed, 27 Oct 2021 02:28:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230342AbhJ0G2m (ORCPT ); Wed, 27 Oct 2021 02:28:42 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B2DFC061570; Tue, 26 Oct 2021 23:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=Rqg3stQt4XtdbZ4gHdaa4uO9gPGzOkCoc22v00/z/Gc=; b=fIjDTjmZe9z1PVOTUxtvlWNG54 yUcznJwM474rbgpbZgTiSY3WPtnRYLk1XpQslyCwnpRqaDmSJZ6gFF4Yr2g23GDHReOIMBHd8BMA4 kt8GwSHzC59W7we2rBshuWtdr1y410iTGcQoDJtvXtt7LP0daBAbYIeX9ougGKfGTNOltfuiyQLzu zFtllP3Y1x2nqxX4gT7TT98Il3XYv4FWIAdJK2hpOKXu7jwwl3qZdHk2IF0ieBqA+IPJK5MJub8Z6 PNWQBYlxvDdFVQjaHvfchuN4ZavN7ZPj57OwKFsb/mH0FkaaCOLGVcTdNCJPnitxOq7TZwZpcWoTP mqEaT1kA==; Received: from [2601:1c0:6280:3f0::aa0b] by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfcO0-0041fE-VR; Wed, 27 Oct 2021 06:26:09 +0000 Subject: Re: gpu: drm_fb_cma_helper.c:46: undefined reference to `drm_gem_fb_get_obj' To: Arnd Bergmann Cc: Thomas Zimmermann , Naresh Kamboju , dri-devel , open list , Linux-Next Mailing List , Linux ARM , Maarten Lankhorst , Maxime Ripard , David Airlie , Daniel Vetter , Andrey Konovalov , Stephen Rothwell , Alexandre Belloni , Linus Walleij References: <857ab1a9-0175-2b2c-e729-2620d0221e1e@suse.de> <6862b109-ea12-6ffa-c82b-b23ee26aa5b2@infradead.org> From: Randy Dunlap Message-ID: <61f14f2b-b1cd-b9df-86fd-8fcc4b9eb738@infradead.org> Date: Tue, 26 Oct 2021 23:26:07 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/26/21 11:19 PM, Arnd Bergmann wrote: > On Wed, Oct 27, 2021 at 2:58 AM Randy Dunlap wrote: > >>> >>> Looking at this config, there is: >>> >>> CONFIG_DRM=y >>> # CONFIG_DRM_DP_AUX_CHARDEV is not set >>> # CONFIG_DRM_DEBUG_MM is not set >>> # CONFIG_DRM_DEBUG_SELFTEST is not set >>> CONFIG_DRM_KMS_HELPER=m >>> # CONFIG_DRM_LOAD_EDID_FIRMWARE is not set >>> # CONFIG_DRM_DP_CEC is not set >>> CONFIG_DRM_GEM_CMA_HELPER=y >>> CONFIG_DRM_KMS_CMA_HELPER=y >>> >>> GEM_CMA_HELPER depends on KMS_HELPER, but the latter is a module. That's probably the cause of the problem. Is it intentionally set this way? >>> >> >> The only drivers that select DRM_KMS_HELPER are both =m, so that's how >> DRM_KMS_HELPER is set also. >> >> Symbol: DRM_KMS_HELPER [=m] >> Type : tristate >> Defined at drivers/gpu/drm/Kconfig:82 >> Depends on: HAS_IOMEM [=y] && DRM [=y] >> Selected by [m]: >> - DRM_ATMEL_HLCDC [=m] && HAS_IOMEM [=y] && DRM [=y] && OF [=y] && COMMON_CLK [=y] && MFD_ATMEL_HLCDC [=y] && ARM [=y] >> - DRM_ASPEED_GFX [=m] && HAS_IOMEM [=y] && DRM [=y] && OF [=y] && (COMPILE_TEST [=n] || ARCH_ASPEED [=y]) && MMU [=y] >> >> >> I did the ARM cross-build and also see the linker error. >> I didn't understand why -- and still don't, but here is a little >> speculation: >> >> In the past (e.g. 10 years ago), we have to move some .o files >> in lib/ from lib-y to obj-y so that they would always be included >> in the final object file and not cause their user/caller object >> files to suffer from undefined references. >> These happened because unused functions(?) in lib-y files are >> stripped out of the final object files. >> The same thing could be happening here (still just guessing). >> >> Does that help any? I dunno. >> >> Adding Arnd to Cc: to see if he has any ideas... > > From all I can tell, the problem is that DRM_KMS_CMA_HELPER is a 'bool' > symbol, so if it gets selected by a '=m' driver, it turns into '=y', which > then selects DRM_GEM_CMA_HELPER=y, but that one cannot link > against DRM_KMS_HELPER=m code. > > This trivial change makes it all build: > > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig > index c08860db2520..699f434ce813 100644 > --- a/drivers/gpu/drm/Kconfig > +++ b/drivers/gpu/drm/Kconfig > @@ -218,7 +218,7 @@ config DRM_GEM_CMA_HELPER > Choose this if you need the GEM CMA helper functions > > config DRM_KMS_CMA_HELPER > - bool > + tristate > depends on DRM > select DRM_GEM_CMA_HELPER > help > > but this needs some more testing to make sure it doesn't add > any other regressions. > > Interestingly, I never hit the problem in randconfig testing since > there is always some '=y' driver that selects DRM_KMS_HELPER. > > Arnd > Hi Arnd, Thomas had posted a patch that also fixes the problem. Somehow I missed seeing that the first time around. Thanks. -- ~Randy