Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2555618rdg; Mon, 14 Aug 2023 06:25:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3923aQpq4nuQBWsnq6Qgpkw+r3SU5WmMg+QsR50tGFBSc8s+pyxMJHBYxq7FhT6ID16Pn X-Received: by 2002:a17:906:1011:b0:99c:1b9a:b0a0 with SMTP id 17-20020a170906101100b0099c1b9ab0a0mr8292018ejm.74.1692019513730; Mon, 14 Aug 2023 06:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692019513; cv=none; d=google.com; s=arc-20160816; b=c3DVjtcaY8V4H5mUmfiboF6IcbW7S+SU8ff7YNV6oWD0KGMq+oxrt4Qvwx10y+OVAJ /zLQqDOJx4QFeF/4NccQK2eWuV1ACOK251Zn2A3ImuL1Fjc9HXLc6Xg/wQsxPPdIw+Jz WOZm0qiNF5Z87dwOALn+y+7dGerfsF1w2fXfx5xSuXtJGm7FumY9XztCDF7Fy6zA4E/0 K/pOelVP8aZkKRSGYmvgO1xw8AvQlQAMgOOBWvYusI/cdgzx+tf+p+0AYy6zI95/7TX/ jCFYgpNm2JijyHuHzEdqSTVI7YZazBYK/Nuc9Qg3kH9WuU52Msogf/vwRk7ZYtEpRkIj 1LTA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HtS3+ndZbNAXr8pNPEWVEPtq/8NZxC/SmXDKUQmMCcI=; fh=oXFkNNImRwLUfWVLQFUdNd6nf+zhYLWx+g7ACQGNFrQ=; b=RJhcrqc/rnVf0cX3AKhiT99qKS9deDXs0gB1WXagnGSwZLlkfCqsxQMm+IWukngj1s JwSFbeFQp/LMp2GZy1+hwKFpkgBG2ASulfOA1482xSpiangfkxnhFkYs89mR8mpCaqwr 4UWMFJMmGM5ChiGAHkfearjLS3FKOebBRkM4SSOYmBL07brM6oUwRtY9ShqusyVTnZsT GGRif5ogKImrLlaEJuJe2Fy2nNUoeVUNnT2jMHA29veO85Ge6jKwtxzMiJjsvx8FreY+ 5wrb2g+GDVGUWZWVd9uy3YEqkVdl5pKORyC5in8DR07Uz0mHbnzbKNsS+A95tzNCzWMp q9NQ== ARC-Authentication-Results: i=1; mx.google.com; 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 o3-20020a17090608c300b0099331b3e6f6si7004740eje.661.2023.08.14.06.24.49; Mon, 14 Aug 2023 06:25:13 -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; 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 S230034AbjHNNIm (ORCPT + 99 others); Mon, 14 Aug 2023 09:08:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbjHNNIK (ORCPT ); Mon, 14 Aug 2023 09:08:10 -0400 Received: from wxsgout04.xfusion.com (wxsgout04.xfusion.com [36.139.87.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4256A11D for ; Mon, 14 Aug 2023 06:08:08 -0700 (PDT) Received: from wuxshcsitd00600.xfusion.com (unknown [10.32.133.213]) by wxsgout04.xfusion.com (SkyGuard) with ESMTPS id 4RPZR81TQgz9xkK7; Mon, 14 Aug 2023 21:06:28 +0800 (CST) Received: from localhost (10.82.147.3) by wuxshcsitd00600.xfusion.com (10.32.133.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 14 Aug 2023 21:07:45 +0800 Date: Mon, 14 Aug 2023 21:07:45 +0800 From: Wang Jinchao To: Jani Nikula CC: Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , , , , Subject: Re: [PATCH] drm/i915: Fix Kconfig error for CONFIG_DRM_I915 Message-ID: References: <87o7jaythm.fsf@intel.com> <87h6p1ddoz.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <87h6p1ddoz.fsf@intel.com> X-Originating-IP: [10.82.147.3] X-ClientProxiedBy: wuxshcsitd00601.xfusion.com (10.32.135.241) To wuxshcsitd00600.xfusion.com (10.32.133.213) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 On Mon, Aug 14, 2023 at 03:13:32PM +0300, Jani Nikula wrote: > On Mon, 14 Aug 2023, Wang Jinchao wrote: > > On Mon, Aug 14, 2023 at 10:26:45AM +0300, Jani Nikula wrote: > >> On Sat, 12 Aug 2023, Wang Jinchao wrote: > >> > When CONFIG_DRM_I915 is set to 'y' and CONFIG_BACKLIGHT_CLASS_DEVICE > >> > is set to 'm', we encountered an ld.lld error during the build process: > >> > > >> > ld.lld: error: undefined symbol: backlight_device_get_by_name > >> > >>> referenced by intel_backlight.c:955 > >> > >>> vmlinux.o:(intel_backlight_device_register) > >> > > >> > ld.lld: error: undefined symbol: backlight_device_register > >> > >>> referenced by intel_backlight.c:971 > >> > >>> vmlinux.o:(intel_backlight_device_register) > >> > > >> > ld.lld: error: undefined symbol: backlight_device_unregister > >> > >>> referenced by intel_backlight.c:999 > >> > >>> vmlinux.o:(intel_backlight_device_unregister) > >> > > >> > This issue occurred because intel_backlight_device_register and > >> > intel_backlight_device_unregister were enclosed within > >> > However, according to Kconfig, CONFIG_DRM_I915 will select > >> > BACKLIGHT_CLASS_DEVICE only if ACPI is enabled. > >> > This led to an error, which can be resolved by removing the > >> > conditional statements related to ACPI. > >> > >> The real fix is to use > >> > >> depends on BACKLIGHT_CLASS_DEVICE || BACKLIGHT_CLASS_DEVICE=n > > it works. > >> > >> but in order to do that, you need to change a lot of places to depend > > Why, what are the other places? > > Generally when you have a mixture of depends on and select on a kconfig > symbol, you'll eventually end up with dependency problems. > Using A to represent DRM_I915 and B to represent BACKLIGHT_CLASS_DEVICE, as both A and B are tristate options, all the possibilities include: 1. A=n, B=n 2. A=m, B=n 3. A=y, B=n 4. A=n, B=m 5. A=m, B=m 6. A=y, B=m 7. A=n, B=y 8. A=m, B=y 9. A=y, B=y Among them, only the 6th case (A=y, B=m) would lead to a compilation failure. Based on your suggestion, I tested the following configuration: config A tristate "A Option" depends on B || B=n config B tristate "B Option" I tested it using menuconfig, and found that the 6th combination (A=y, B=m) cannot be manually selected. Specifically, if B=m, A can only be selected as either n or m. If A=y and B is set to m, A automatically changes to m as well. I believe there is no issue with the solution you provided. Is there something that I might have overlooked? > BR, > Jani. > > > >> on, not select BACKLIGHT_CLASS_DEVICE, because otherwise you end up with > > got it. > >> other dependency issues. > >> > >> BR, > >> Jani. > >> > >> > > >> > Signed-off-by: Wang Jinchao > >> > --- > >> > drivers/gpu/drm/i915/Kconfig | 2 +- > >> > 1 file changed, 1 insertion(+), 1 deletion(-) > >> > > >> > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig > >> > index 01b5a8272a27..5003de921bf7 100644 > >> > --- a/drivers/gpu/drm/i915/Kconfig > >> > +++ b/drivers/gpu/drm/i915/Kconfig > >> > @@ -24,7 +24,7 @@ config DRM_I915 > >> > select IRQ_WORK > >> > # i915 depends on ACPI_VIDEO when ACPI is enabled > >> > # but for select to work, need to select ACPI_VIDEO's dependencies, ick > >> > - select BACKLIGHT_CLASS_DEVICE if ACPI > >> > + select BACKLIGHT_CLASS_DEVICE > >> > select INPUT if ACPI > >> > select X86_PLATFORM_DEVICES if ACPI > >> > select ACPI_WMI if ACPI > >> > >> -- > >> Jani Nikula, Intel Open Source Graphics Center > > -- > Jani Nikula, Intel Open Source Graphics Center