Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp884821pxb; Wed, 27 Oct 2021 14:27:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9bEfLUgZ2LNUhYWMvIIY24M/k1Yw9CRd8XMC7d/amdV/WqvmS9PGVwTWPPVk48VyOBl9v X-Received: by 2002:a17:907:2d8e:: with SMTP id gt14mr49076ejc.335.1635370030827; Wed, 27 Oct 2021 14:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635370030; cv=none; d=google.com; s=arc-20160816; b=F7QLfkoxgvue019cyemErXjR7Q0XNy5olUl4pmVS7C0uCflqGINvIDK2sqc/hfON2Q O1mbbD7n2C9x8Oamfb4YIa2IAWe0U7beioIs3jDj3EoeTiLOEtJeUaE95afbZfHQbD95 B/APZzZpkWvMMDN0Sp3z6ZIvp1KpJXLqu0NyuX7uJSdO82HMgPz11ZDIHOFtJn0FI4H/ 571wrEARO/EmzNL2r8iOGPFQb51q8E1I/i9DnwAVJwZwNeszzBJrbacMKCiSKxXC3Qgw B0lnrHD8wP6NY1v9g5SeVBjDwiI+elDE6IUOPJHmuUO0oV63cO7ODhx7fe76nFyndDYx t9rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from; bh=I5R0qk5JIjMstJ38rZFW1LFxJ7jOjhOpSWE9nlkg8Ls=; b=ZIbwaW/cRP0vxLPw13FwqEmnlEad6wRpNu0nBPc76xOO0edY1w6+JRletCNEkbAB4a LyOUOKUHkUn7JiJ1gFZ31/lQggU70vv2P5YGmmGAb2203UhG35P7Jh8vdO30Hag64mju vULlxckgHfrx7jAyMPaPmeWvlOte1+0i/a0TPyLYXlxhdz5VigdMEuFsjB//6QeoRkdT m1CfNUQPUzgnKsgg9Vw502ACXQ5PAyqejvOU2emX40gUGbU3lu9Ft0wu41icGIVdpPj9 eNFuQbhF5sXPQ2eBdSR0Zf/x9E/xZh2Z6t9U5VzeoRQfEwAIU2Alw2i3Qw4z0BGUjbAL KJcA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e3si1240345ejm.466.2021.10.27.14.26.47; Wed, 27 Oct 2021 14:27:10 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239897AbhJ0LyF (ORCPT + 97 others); Wed, 27 Oct 2021 07:54:05 -0400 Received: from mga06.intel.com ([134.134.136.31]:33800 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234994AbhJ0LyE (ORCPT ); Wed, 27 Oct 2021 07:54:04 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10149"; a="290977338" X-IronPort-AV: E=Sophos;i="5.87,186,1631602800"; d="scan'208";a="290977338" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2021 04:51:39 -0700 X-IronPort-AV: E=Sophos;i="5.87,186,1631602800"; d="scan'208";a="497831225" Received: from smaharan-mobl.gar.corp.intel.com (HELO localhost) ([10.251.214.195]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2021 04:51:34 -0700 From: Jani Nikula To: Javier Martinez Canillas , linux-kernel@vger.kernel.org Cc: Dan =?utf-8?Q?Hor=C3=A1k?= , "Justin M . Forbes" , Peter Robinson , Javier Martinez Canillas , Daniel Vetter , David Airlie , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm: Make DRM_FBDEV_EMULATION deps more robust to fix linker errors In-Reply-To: <20211027072044.4105113-1-javierm@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20211027072044.4105113-1-javierm@redhat.com> Date: Wed, 27 Oct 2021 14:51:31 +0300 Message-ID: <875ytiit30.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 Oct 2021, Javier Martinez Canillas wrote: > Enabling the CONFIG_DRM_FBDEV_EMULATION Kconfig symbol can lead to linker > errors, if CONFIG_DRM_KMS_HELPER is built-in but CONFIG_FB as a module. > > Because in that case the drm_kms_helper.o object will have references to > symbols that are defined in the fb.ko module, i.e: > > $ make bzImage modules > DESCEND objtool > CALL scripts/atomic/check-atomics.sh > CALL scripts/checksyscalls.sh > CHK include/generated/compile.h > GEN .version > CHK include/generated/compile.h > UPD include/generated/compile.h > CC init/version.o > AR init/built-in.a > LD vmlinux.o > MODPOST vmlinux.symvers > MODINFO modules.builtin.modinfo > GEN modules.builtin > LD .tmp_vmlinux.kallsyms1 > ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_resume_worker': > drm_fb_helper.c:(.text+0x2a0): undefined reference to `fb_set_suspend' > ... > > To prevent this, make following changes to the config option dependencies: > > * Depend on FB && !(DRM_KMS_HELPER=y && FB=m), to avoid invalid configs. > * Depend on DRM_KMS_HELPER instead selecting it, to avoid circular deps. > > Reported-by: Justin M. Forbes > Signed-off-by: Javier Martinez Canillas Please see [1]. I think it's a big mess. I don't think this is the fix either. BR, Jani. [1] https://lore.kernel.org/r/878ryeit9i.fsf@intel.com > --- > > This fixes linker errors found when building the Fedora kernel package > for the s390x architecture: > > https://kojipkgs.fedoraproject.org//work/tasks/9849/77859849/build.log > > drivers/gpu/drm/Kconfig | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig > index cea777ae7fb9..9a21e57b4a0d 100644 > --- a/drivers/gpu/drm/Kconfig > +++ b/drivers/gpu/drm/Kconfig > @@ -103,8 +103,8 @@ config DRM_DEBUG_DP_MST_TOPOLOGY_REFS > config DRM_FBDEV_EMULATION > bool "Enable legacy fbdev support for your modesetting driver" > depends on DRM > - depends on FB > - select DRM_KMS_HELPER > + depends on FB && !(DRM_KMS_HELPER=y && FB=m) > + depends on DRM_KMS_HELPER > select FB_CFB_FILLRECT > select FB_CFB_COPYAREA > select FB_CFB_IMAGEBLIT -- Jani Nikula, Intel Open Source Graphics Center