Regressions for "imply" behavior change
Subsystems (8)
cover Regressions for "imply" behavior change
Hi everyone,
I've just restarted doing randconfig builds on top of mainline Linux and found a couple of regressions with missing dependency from the recent change in the "imply" keyword in Kconfig, presumably these two patches:
3a9dd3ecb207 kconfig: make 'imply' obey the direct dependency def2fbffe62c kconfig: allow symbols implied by y to become m
I have created workarounds for the Kconfig files, which now stop using imply and do something else in each case. I don't know whether there was a bug in the kconfig changes that has led to allowing configurations that were not meant to be legal even with the new semantics, or if the Kconfig files have simply become incorrect now and the tool works as expected.
Please have a look at the cases I found, and what you think we should do about them. I assume there are a couple more like these, the six regressions here are what I found in the first 1000 randconfig builds on the kernel.
Arnd
Arnd Bergmann (6):
thunder: select PTP driver if possible
net/mlx5e: fix VXLAN dependency
LiquidIO VF: add dependency for PTP_1588_CLOCK
drm/bridge/sii8620: fix extcon dependency
drm/rcar-du: fix selection of CMM driver
drm/rcar-du: fix lvds dependency
drivers/gpu/drm/bridge/Kconfig | 1 - drivers/gpu/drm/bridge/sil-sii8620.c | 5 +++-- drivers/gpu/drm/rcar-du/Kconfig | 7 ++----- drivers/net/ethernet/cavium/Kconfig | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 2 +- 5 files changed, 8 insertions(+), 11 deletions(-)
Signature · 6 lines
2.26.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC 1/6 thunder: select PTP driver if possible
The 'imply' selection means the driver can still be a loadable module even if the main driver is built-in, leading to a link error:
aarch64-linux-ld: drivers/net/ethernet/cavium/thunder/nicvf_main.o: in function `nicvf_remove':
nicvf_main.c:(.text+0x25c): undefined reference to `cavium_ptp_put'
aarch64-linux-ld: drivers/net/ethernet/cavium/thunder/nicvf_main.o: in function `nicvf_probe':
nicvf_main.c:(.text+0x3080): undefined reference to `cavium_ptp_get'
Use a 'select' statement instead.
--- drivers/net/ethernet/cavium/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cavium/Kconfig +1 -1
@@ -27,7 +27,7 @@ config THUNDER_NIC_PF config THUNDER_NIC_VF tristate "Thunder Virtual function driver" - imply CAVIUM_PTP + select CAVIUM_PTP if POSIX_TIMERS depends on 64BIT && PCI ---help--- This driver supports Thunder's NIC virtual function
Signature · 6 lines
2.26.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC 2/6 net/mlx5e: fix VXLAN dependency
In reply to Arnd BergmannThe 'imply' statement does not prevent MLX5 to be built-in and fail when VXLAN=m:
aarch64-linux-ld: drivers/net/ethernet/mellanox/mlx5/core/main.o: in function `mlx5_init_once':
main.c:(.text+0x7cc): undefined reference to mlx5_vxlan_create' main.c:(.text+0x958): undefined reference to mlx5_vxlan_destroy'
Use a normal dependency instead.
--- drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/Kconfig +1 -1
@@ -8,7 +8,7 @@ config MLX5_CORE depends on PCI select NET_DEVLINK imply PTP_1588_CLOCK - imply VXLAN + depends on VXLAN || !VXLAN imply MLXFW imply PCI_HYPERV_INTERFACE default n
Signature · 6 lines
2.26.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC 3/6 LiquidIO VF: add dependency for PTP_1588_CLOCK
In reply to Arnd BergmannThe 'imply' keyword no longer does what it was originally introduced for:
lio_ethtool.c:(.text+0xba8): undefined reference to `ptp_clock_index'
Use a dependency instead.
--- drivers/net/ethernet/cavium/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cavium/Kconfig +1 -1
@@ -66,7 +66,7 @@ config LIQUIDIO tristate "Cavium LiquidIO support" depends on 64BIT && PCI depends on PCI - imply PTP_1588_CLOCK + depends on PTP_1588_CLOCK || !PTP_1588_CLOCK select FW_LOADER select LIBCRC32C select NET_DEVLINK
Signature · 6 lines
2.26.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build botRe: [RFC 3/6] LiquidIO VF: add dependency for PTP_1588_CLOCK
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please…
Hi Arnd,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on arm-soc/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Arnd-Bergmann/Regressions-for-imply-behavior-change/20200409-044236 base: https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git for-next config: i386-tinyconfig compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
make ARCH=i386 tinyconfig
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> drivers/net/ethernet/freescale/Kconfig:6:error: recursive dependency detected! >> drivers/net/ethernet/freescale/Kconfig:6: symbol NET_VENDOR_FREESCALE depends on PPC_BESTCOMM >> drivers/dma/bestcomm/Kconfig:6: symbol PPC_BESTCOMM depends on DMADEVICES >> drivers/dma/Kconfig:6: symbol DMADEVICES is selected by CRYPTO_DEV_SP_CCP >> drivers/crypto/ccp/Kconfig:10: symbol CRYPTO_DEV_SP_CCP depends on CRYPTO >> crypto/Kconfig:16: symbol CRYPTO is selected by LIBCRC32C >> lib/Kconfig:222: symbol LIBCRC32C is selected by LIQUIDIO >> drivers/net/ethernet/cavium/Kconfig:65: symbol LIQUIDIO depends on PTP_1588_CLOCK >> drivers/ptp/Kconfig:8: symbol PTP_1588_CLOCK is implied by FEC >> drivers/net/ethernet/freescale/Kconfig:23: symbol FEC depends on NET_VENDOR_FREESCALE
For a resolution refer to Documentation/kbuild/kconfig-language.rst subsection "Kconfig recursive dependency limitations"
vim +65 drivers/net/ethernet/cavium/Kconfig
4863dea3fab017 Sunil Goutham 2015-05-26 15 4863dea3fab017 Sunil Goutham 2015-05-26 16 config THUNDER_NIC_PF 4863dea3fab017 Sunil Goutham 2015-05-26 17 tristate "Thunder Physical function driver" 74525cc5f5f7c0 Arnd Bergmann 2018-07-17 18 depends on 64BIT && PCI 4863dea3fab017 Sunil Goutham 2015-05-26 19 select THUNDER_NIC_BGX 4863dea3fab017 Sunil Goutham 2015-05-26 20 ---help--- 4863dea3fab017 Sunil Goutham 2015-05-26 21 This driver supports Thunder's NIC physical function. f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 22 The NIC provides the controller and DMA engines to f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 23 move network traffic to/from the memory. The NIC f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 24 works closely with TNS, BGX and SerDes to implement the f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 25 functions replacing and virtualizing those of a typical f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 26 standalone PCIe NIC chip. 4863dea3fab017 Sunil Goutham 2015-05-26 27 4863dea3fab017 Sunil Goutham 2015-05-26 28 config THUNDER_NIC_VF 4863dea3fab017 Sunil Goutham 2015-05-26 29 tristate "Thunder Virtual function driver" 72b220d6dee287 Arnd Bergmann 2020-04-08 30 select CAVIUM_PTP if POSIX_TIMERS 74525cc5f5f7c0 Arnd Bergmann 2018-07-17 31 depends on 64BIT && PCI 4863dea3fab017 Sunil Goutham 2015-05-26 32 ---help--- 4863dea3fab017 Sunil Goutham 2015-05-26 33 This driver supports Thunder's NIC virtual function 4863dea3fab017 Sunil Goutham 2015-05-26 34 4863dea3fab017 Sunil Goutham 2015-05-26 35 config THUNDER_NIC_BGX 4863dea3fab017 Sunil Goutham 2015-05-26 36 tristate "Thunder MAC interface driver (BGX)" e40562abdf81f3 Alexander Sverdlin 2018-07-17 37 depends on 64BIT && PCI 274b0b3984a93d Radha Mohan Chintakuntla 2015-07-28 38 select PHYLIB 74525cc5f5f7c0 Arnd Bergmann 2018-07-17 39 select MDIO_THUNDER if PCI 6465859aba1e66 Sunil Goutham 2016-08-12 40 select THUNDER_NIC_RGX 4863dea3fab017 Sunil Goutham 2015-05-26 41 ---help--- 4863dea3fab017 Sunil Goutham 2015-05-26 42 This driver supports programming and controlling of MAC 4863dea3fab017 Sunil Goutham 2015-05-26 43 interface from NIC physical function driver. 4863dea3fab017 Sunil Goutham 2015-05-26 44 6465859aba1e66 Sunil Goutham 2016-08-12 45 config THUNDER_NIC_RGX 6465859aba1e66 Sunil Goutham 2016-08-12 46 tristate "Thunder MAC interface driver (RGX)" e40562abdf81f3 Alexander Sverdlin 2018-07-17 47 depends on 64BIT && PCI 6465859aba1e66 Sunil Goutham 2016-08-12 48 select PHYLIB 74525cc5f5f7c0 Arnd Bergmann 2018-07-17 49 select MDIO_THUNDER if PCI 6465859aba1e66 Sunil Goutham 2016-08-12 50 ---help--- 6465859aba1e66 Sunil Goutham 2016-08-12 51 This driver supports configuring XCV block of RGX interface 6465859aba1e66 Sunil Goutham 2016-08-12 52 present on CN81XX chip. 6465859aba1e66 Sunil Goutham 2016-08-12 53 8c56df372bc137 Radoslaw Biernacki 2018-01-15 54 config CAVIUM_PTP 8c56df372bc137 Radoslaw Biernacki 2018-01-15 55 tristate "Cavium PTP coprocessor as PTP clock" e40562abdf81f3 Alexander Sverdlin 2018-07-17 56 depends on 64BIT && PCI 8c56df372bc137 Radoslaw Biernacki 2018-01-15 57 imply PTP_1588_CLOCK 8c56df372bc137 Radoslaw Biernacki 2018-01-15 58 ---help--- 8c56df372bc137 Radoslaw Biernacki 2018-01-15 59 This driver adds support for the Precision Time Protocol Clocks and 8c56df372bc137 Radoslaw Biernacki 2018-01-15 60 Timestamping coprocessor (PTP) found on Cavium processors. 8c56df372bc137 Radoslaw Biernacki 2018-01-15 61 PTP provides timestamping mechanism that is suitable for use in IEEE 1588 8c56df372bc137 Radoslaw Biernacki 2018-01-15 62 Precision Time Protocol or other purposes. Timestamps can be used in 8c56df372bc137 Radoslaw Biernacki 2018-01-15 63 BGX, TNS, GTI, and NIC blocks. 8c56df372bc137 Radoslaw Biernacki 2018-01-15 64 f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 @65 config LIQUIDIO f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 66 tristate "Cavium LiquidIO support" e40562abdf81f3 Alexander Sverdlin 2018-07-17 67 depends on 64BIT && PCI 74525cc5f5f7c0 Arnd Bergmann 2018-07-17 68 depends on PCI 9c550475dccbde Arnd Bergmann 2020-04-08 69 depends on PTP_1588_CLOCK || !PTP_1588_CLOCK f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 70 select FW_LOADER 3dc817d21279ea Raghu Vatsavayi 2015-06-16 71 select LIBCRC32C f6b19b354d50c5 Jiri Pirko 2019-03-24 72 select NET_DEVLINK f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 73 ---help--- f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 74 This driver supports Cavium LiquidIO Intelligent Server Adapters e86b1ab6866690 Raghu Vatsavayi 2016-08-31 75 based on CN66XX, CN68XX and CN23XX chips. f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 76 f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 77 To compile this driver as a module, choose M here: the module f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 78 will be called liquidio. This is recommended. f21fb3ed364bb8 Raghu Vatsavayi 2015-06-09 79
:::::: The code at line 65 was first introduced by commit
:::::: f21fb3ed364bb83533c5efe19354e337ea9ecda9 Add support of Cavium Liquidio ethernet adapters
:::::: TO: Raghu Vatsavayi <[email protected]> :::::: CC: David S. Miller <[email protected]>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Re: [RFC 3/6] LiquidIO VF: add dependency for PTP_1588_CLOCK
Quoted 32 lines · kbuild test robot
Hi Arnd,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on arm-soc/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]url: https://github.com/0day-ci/linux/commits/Arnd-Bergmann/Regressions-for-imply-behavior-change/20200409-044236 base: https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git for-next config: i386-tinyconfig compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0reproduce:
make ARCH=i386 tinyconfig
make ARCH=i386If you fix the issue, kindly add following tag as appropriate
Reported-by kbuild test robot <[email protected]>All errors (new ones prefixed by >>):
Quoted 10 lines
Quoted 10 lines
drivers/net/ethernet/freescale/Kconfig:6:error: recursive dependency detected!
drivers/net/ethernet/freescale/Kconfig:6: symbolNET_VENDOR_FREESCALEdepends onPPC_BESTCOMMdrivers/dma/bestcomm/Kconfig:6: symbolPPC_BESTCOMMdepends on DMADEVICESdrivers/dma/Kconfig:6: symbol DMADEVICES is selected byCRYPTO_DEV_SP_CCPdrivers/crypto/ccp/Kconfig:10: symbolCRYPTO_DEV_SP_CCPdepends on CRYPTOcrypto/Kconfig:16: symbol CRYPTO is selected by LIBCRC32C
lib/Kconfig:222: symbol LIBCRC32C is selected by LIQUIDIOdrivers/net/ethernet/cavium/Kconfig:65: symbol LIQUIDIO depends onPTP_1588_CLOCKdrivers/ptp/Kconfig:8: symbolPTP_1588_CLOCKis implied by FECdrivers/net/ethernet/freescale/Kconfig:23: symbol FEC depends onNET_VENDOR_FREESCALE
Quoted 2 lines
For a resolution refer to
Documentation/kbuild/kconfig-language.rstsubsection "Kconfigrecursive dependency limitations"
Yes, I expected this regression and sent a separate patch to change CRYPTO_DEV_SP_CCP
to avoid this:
https://lore.kernel.org/lkml/dade39d2-db11-1830-eda0-d39b40f6c3aa(a)amd.com/
RFC 4/6 drm/bridge/sii8620: fix extcon dependency
In reply to Arnd BergmannUsing 'imply' does not work here, it still cause the same build failure:
arm-linux-gnueabi-ld: drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_remove':
sil-sii8620.c:(.text+0x1b8): undefined reference to `extcon_unregister_notifier'
arm-linux-gnueabi-ld: drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_probe':
sil-sii8620.c:(.text+0x27e8): undefined reference to `extcon_find_edev_by_node'
arm-linux-gnueabi-ld: sil-sii8620.c:(.text+0x2870): undefined reference to `extcon_register_notifier'
arm-linux-gnueabi-ld: drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_extcon_work':
sil-sii8620.c:(.text+0x2908): undefined reference to `extcon_get_state'
I tried the usual 'depends on EXTCON || !EXTCON' logic, but that caused a circular Kconfig dependency. Using IS_REACHABLE() is ugly but works.
--- drivers/gpu/drm/bridge/Kconfig | 1 - drivers/gpu/drm/bridge/sil-sii8620.c | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/Kconfig +0 -1
@@ -90,7 +90,6 @@ config DRM_SIL_SII8620 tristate "Silicon Image SII8620 HDMI/MHL bridge" depends on OF select DRM_KMS_HELPER - imply EXTCON depends on RC_CORE || !RC_CORE help Silicon Image SII8620 HDMI/MHL bridge chip driver.
drivers/gpu/drm/bridge/sil-sii8620.c +3 -2
@@ -2330,7 +2330,8 @@ static int sii8620_probe(struct i2c_client *client,if (ret)return ret; - ret =sii8620_extcon_init (ctx); +if (IS_REACHABLE (CONFIG_EXTCON )) + ret =sii8620_extcon_init (ctx);if (ret <0 ) {dev_err (ctx->dev,"failed to initialize EXTCON\n" );return ret;
@@ -2352,7 +2353,7 @@ static int sii8620_remove(struct i2c_client *client) {struct sii8620 *ctx =i2c_get_clientdata (client); -if (ctx->extcon) { +if (IS_REACHABLE (CONFIG_EXTCON ) && ctx->extcon) {extcon_unregister_notifier (ctx->extcon,EXTCON_DISP_MHL , &ctx->extcon_nb);flush_work (&ctx->extcon_wq);
Signature · 1 line
2.26.0
Re: [RFC 4/6] drm/bridge/sii8620: fix extcon dependency
Quoted 11 lines · Arnd Bergmann
Using 'imply' does not work here, it still cause the same build failure:
arm-linux-gnueabi-ld:
drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_remove':
sil-sii8620.c:(.text+0x1b8): undefined reference to `extcon_unregister_notifier'
arm-linux-gnueabi-ld:drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_probe':
sil-sii8620.c:(.text+0x27e8): undefined reference to `extcon_find_edev_by_node'
arm-linux-gnueabi-ld: sil-sii8620.c:(.text+0x2870): undefined reference to `extcon_register_notifier'
arm-linux-gnueabi-ld:drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_extcon_work':
sil-sii8620.c:(.text+0x2908): undefined reference to `extcon_get_state'
Quoted 2 lines
I tried the usual 'depends on EXTCON || !EXTCON' logic, but that caused a circular
Kconfigdependency. UsingIS_REACHABLE()is ugly but works.
'depends on EXTCON || !EXTCON' seems to be proper solution, maybe would be better to try to solve circular dependencies issue.
Regards
Andrzej
Re: [RFC 4/6] drm/bridge/sii8620: fix extcon dependency
Quoted 14 lines · Andrzej Hajda
Quoted 11 lines · Arnd Bergmann
Using 'imply' does not work here, it still cause the same build failure:
arm-linux-gnueabi-ld:
drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_remove':
sil-sii8620.c:(.text+0x1b8): undefined reference to `extcon_unregister_notifier'
arm-linux-gnueabi-ld:drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_probe':
sil-sii8620.c:(.text+0x27e8): undefined reference to `extcon_find_edev_by_node'
arm-linux-gnueabi-ld: sil-sii8620.c:(.text+0x2870): undefined reference to `extcon_register_notifier'
arm-linux-gnueabi-ld:drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_extcon_work':
sil-sii8620.c:(.text+0x2908): undefined reference to `extcon_get_state'
Quoted 4 lines
Quoted 2 lines
I tried the usual 'depends on EXTCON || !EXTCON' logic, but that caused a circular
Kconfigdependency. UsingIS_REACHABLE()is ugly but works.'depends on EXTCON || !EXTCON' seems to be proper solution, maybe would be better to try to solve circular dependencies issue.
I agree that would be nice, but I failed to come to a proper solution here. FWIW, there
is one circular dependency that I managed to avoid by changing all drivers that select FB_DDC
to depend on I2C rather than selecting it:
drivers/i2c/Kconfig:8:error: recursive dependency detected! drivers/i2c/Kconfig:8: symbol I2C is selected by FB_DDC drivers/video/fbdev/Kconfig:63: symbol FB_DDC depends on FB drivers/video/fbdev/Kconfig:12: symbol FB is selected by DRM_KMS_FB_HELPER drivers/gpu/drm/Kconfig:80: symbol DRM_KMS_FB_HELPER depends on DRM_KMS_HELPER drivers/gpu/drm/Kconfig:74: symbol DRM_KMS_HELPER is selected by DRM_SIL_SII8620 drivers/gpu/drm/bridge/Kconfig:89: symbol DRM_SIL_SII8620 depends on EXTCON drivers/extcon/Kconfig:2: symbol EXTCON is selected by CHARGER_MANAGER drivers/power/supply/Kconfig:482: symbol CHARGER_MANAGER depends on POWER_SUPPLY drivers/power/supply/Kconfig:2: symbol POWER_SUPPLY is selected by HID_BATTERY_STRENGTHdrivers/hid/Kconfig:29: symbol HID_BATTERY_STRENGTH depends on HID drivers/hid/Kconfig:8: symbol HID is selected by I2C_HID drivers/hid/i2c-hid/Kconfig:5: symbol I2C_HID depends on I2C
After that, Kconfig crashes with a segfault:
drivers/video/fbdev/Kconfig:12:error: recursive dependency detected! drivers/video/fbdev/Kconfig:12: symbol FB is selected by DRM_KMS_FB_HELPER drivers/gpu/drm/Kconfig:80: symbol DRM_KMS_FB_HELPER depends on DRM_KMS_HELPER drivers/gpu/drm/Kconfig:74: symbol DRM_KMS_HELPER is selected by DRM_SIL_SII8620 drivers/gpu/drm/bridge/Kconfig:89: symbol DRM_SIL_SII8620 depends on EXTCON drivers/extcon/Kconfig:2: symbol EXTCON is selected by CHARGER_MANAGER drivers/power/supply/Kconfig:482: symbol CHARGER_MANAGER depends on POWER_SUPPLY drivers/power/supply/Kconfig:2: symbol POWER_SUPPLY is selected by HID_ASUS drivers/hid/Kconfig:150: symbol HID_ASUS depends on LEDS_CLASS drivers/leds/Kconfig:17: symbol LEDS_CLASS depends on NEW_LEDS drivers/leds/Kconfig:9: symbol NEW_LEDS is selected by SENSORS_APPLESMC drivers/hwmon/Kconfig:327: symbol SENSORS_APPLESMC depends on HWMON drivers/hwmon/Kconfig:6: symbol HWMON is selected by EEEPC_LAPTOP drivers/platform/x86/Kconfig:260: symbol EEEPC_LAPTOP depends on ACPI_VIDEO make[3]: *** [/git/arm-soc/scripts/kconfig/Makefile:71: randconfig] Segmentation fault (core dumped)
After changing EEEPC_LAPTOP and THINKPAD_ACPI to 'depends on HWMON' instead of 'select HWMON', I get this one:
drivers/video/fbdev/Kconfig:12:error: recursive dependency detected! drivers/video/fbdev/Kconfig:12: symbol FB is selected by DRM_KMS_FB_HELPER drivers/gpu/drm/Kconfig:80: symbol DRM_KMS_FB_HELPER depends on DRM_KMS_HELPER drivers/gpu/drm/Kconfig:74: symbol DRM_KMS_HELPER is selected by DRM_SIL_SII8620 drivers/gpu/drm/bridge/Kconfig:89: symbol DRM_SIL_SII8620 depends on EXTCON drivers/extcon/Kconfig:2: symbol EXTCON is selected by CHARGER_MANAGER drivers/power/supply/Kconfig:482: symbol CHARGER_MANAGER depends on POWER_SUPPLY drivers/power/supply/Kconfig:2: symbol POWER_SUPPLY is selected by HID_ASUS drivers/hid/Kconfig:150: symbol HID_ASUS depends on LEDS_CLASS drivers/leds/Kconfig:17: symbol LEDS_CLASS depends on NEW_LEDS drivers/leds/Kconfig:9: symbol NEW_LEDS is selected by BACKLIGHT_ADP8860 drivers/video/backlight/Kconfig:316: symbol BACKLIGHT_ADP8860 depends on BACKLIGHT_CLASS_DEVICEdrivers/video/backlight/Kconfig:143: symbol BACKLIGHT_CLASS_DEVICE is selected by FB_BACKLIGHTdrivers/video/fbdev/Kconfig:187: symbol FB_BACKLIGHT depends on FB
Changing all drivers that select 'FB_BACKLIGHT' or 'BACKLIGHT_CLASS_DEVICE' to 'depends on BACKLIGHT_CLASS_DEVICE' gets it to build.
The steps each seem reasonable, in particular since they mostly clean up the legacy
fbdev drivers to what they should have done anyway, but it is quite invasive in the end.
Any other ideas?
Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC 4/6] drm/bridge/sii8620: fix extcon dependency
Quoted 81 lines · Arnd Bergmann
Quoted 14 lines · Andrzej Hajda
Quoted 11 lines · Arnd Bergmann
Using 'imply' does not work here, it still cause the same build failure:
arm-linux-gnueabi-ld:
drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_remove':
sil-sii8620.c:(.text+0x1b8): undefined reference to `extcon_unregister_notifier'
arm-linux-gnueabi-ld:drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_probe':
sil-sii8620.c:(.text+0x27e8): undefined reference to `extcon_find_edev_by_node'
arm-linux-gnueabi-ld: sil-sii8620.c:(.text+0x2870): undefined reference to `extcon_register_notifier'
arm-linux-gnueabi-ld:drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_extcon_work':
sil-sii8620.c:(.text+0x2908): undefined reference to `extcon_get_state'Quoted 4 lines
Quoted 2 lines
I tried the usual 'depends on EXTCON || !EXTCON' logic, but that caused a circular
Kconfigdependency. UsingIS_REACHABLE()is ugly but works.'depends on EXTCON || !EXTCON' seems to be proper solution, maybe would be better to try to solve circular dependencies issue.
I agree that would be nice, but I failed to come to a proper solution here. FWIW, there
is one circular dependency that I managed to avoid by changing all drivers that selectFB_DDC
to depend on I2C rather than selecting it:drivers/i2c/Kconfig:8:error: recursive dependency detected!
drivers/i2c/Kconfig:8: symbol I2C is selected byFB_DDCdrivers/video/fbdev/Kconfig:63: symbolFB_DDCdepends on FBdrivers/video/fbdev/Kconfig:12: symbol FB is selected byDRM_KMS_FB_HELPERdrivers/gpu/drm/Kconfig:80: symbolDRM_KMS_FB_HELPERdepends onDRM_KMS_HELPERdrivers/gpu/drm/Kconfig:74: symbolDRM_KMS_HELPERis selected byDRM_SIL_SII8620drivers/gpu/drm/bridge/Kconfig:89: symbolDRM_SIL_SII8620depends on EXTCONdrivers/extcon/Kconfig:2: symbol EXTCON is selected byCHARGER_MANAGERdrivers/power/supply/Kconfig:482: symbolCHARGER_MANAGERdepends onPOWER_SUPPLYdrivers/power/supply/Kconfig:2: symbolPOWER_SUPPLYis selected byHID_BATTERY_STRENGTHdrivers/hid/Kconfig:29: symbolHID_BATTERY_STRENGTHdepends on HIDdrivers/hid/Kconfig:8: symbol HID is selected byI2C_HIDdrivers/hid/i2c-hid/Kconfig:5: symbolI2C_HIDdepends on I2CAfter that,
Kconfigcrashes with a segfault:drivers/video/fbdev/Kconfig:12:error: recursive dependency detected!
drivers/video/fbdev/Kconfig:12: symbol FB is selected byDRM_KMS_FB_HELPERdrivers/gpu/drm/Kconfig:80: symbolDRM_KMS_FB_HELPERdepends onDRM_KMS_HELPERdrivers/gpu/drm/Kconfig:74: symbolDRM_KMS_HELPERis selected byDRM_SIL_SII8620drivers/gpu/drm/bridge/Kconfig:89: symbolDRM_SIL_SII8620depends on EXTCONdrivers/extcon/Kconfig:2: symbol EXTCON is selected byCHARGER_MANAGERdrivers/power/supply/Kconfig:482: symbolCHARGER_MANAGERdepends onPOWER_SUPPLYdrivers/power/supply/Kconfig:2: symbolPOWER_SUPPLYis selected byHID_ASUSdrivers/hid/Kconfig:150: symbolHID_ASUSdepends onLEDS_CLASSdrivers/leds/Kconfig:17: symbolLEDS_CLASSdepends onNEW_LEDSdrivers/leds/Kconfig:9: symbolNEW_LEDSis selected bySENSORS_APPLESMCdrivers/hwmon/Kconfig:327: symbolSENSORS_APPLESMCdepends on HWMONdrivers/hwmon/Kconfig:6: symbol HWMON is selected byEEEPC_LAPTOPdrivers/platform/x86/Kconfig:260: symbolEEEPC_LAPTOPdepends onACPI_VIDEOmake[3]: *** [/git/arm-soc/scripts/kconfig/Makefile:71: randconfig] Segmentation fault (core dumped)After changing
EEEPC_LAPTOPandTHINKPAD_ACPIto 'depends on HWMON' instead of 'select HWMON', I get this one:drivers/video/fbdev/Kconfig:12:error: recursive dependency detected!
drivers/video/fbdev/Kconfig:12: symbol FB is selected byDRM_KMS_FB_HELPERdrivers/gpu/drm/Kconfig:80: symbolDRM_KMS_FB_HELPERdepends onDRM_KMS_HELPERdrivers/gpu/drm/Kconfig:74: symbolDRM_KMS_HELPERis selected byDRM_SIL_SII8620drivers/gpu/drm/bridge/Kconfig:89: symbolDRM_SIL_SII8620depends on EXTCONdrivers/extcon/Kconfig:2: symbol EXTCON is selected byCHARGER_MANAGERdrivers/power/supply/Kconfig:482: symbolCHARGER_MANAGERdepends onPOWER_SUPPLYdrivers/power/supply/Kconfig:2: symbolPOWER_SUPPLYis selected byHID_ASUSdrivers/hid/Kconfig:150: symbolHID_ASUSdepends onLEDS_CLASSdrivers/leds/Kconfig:17: symbolLEDS_CLASSdepends onNEW_LEDSdrivers/leds/Kconfig:9: symbolNEW_LEDSis selected byBACKLIGHT_ADP8860drivers/video/backlight/Kconfig:316: symbolBACKLIGHT_ADP8860depends onBACKLIGHT_CLASS_DEVICEdrivers/video/backlight/Kconfig:143: symbolBACKLIGHT_CLASS_DEVICEis selected byFB_BACKLIGHTdrivers/video/fbdev/Kconfig:187: symbolFB_BACKLIGHTdepends on FB
Quoted 8 lines
Changing all drivers that select '
FB_BACKLIGHT' or 'BACKLIGHT_CLASS_DEVICE' to 'depends onBACKLIGHT_CLASS_DEVICE' gets it to build.The steps each seem reasonable, in particular since they mostly clean up the legacy
fbdev drivers to what they should have done anyway, but it is quite invasive in the end.
Any other ideas?
Adding Jani, since iirc he looked at the entire backlight Kconfig story before. I think there's some nonsense going on where in some cases you don't get reasonable dummy functions where it just doesn't make sense. Or something like that.
At least the entire select vs depends on backlight sounds eerily familiar. -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC 4/6] drm/bridge/sii8620: fix extcon dependency
Quoted 91 lines · Daniel Vetter
Quoted 81 lines · Arnd Bergmann
Quoted 14 lines · Andrzej Hajda
Quoted 11 lines · Arnd Bergmann
Using 'imply' does not work here, it still cause the same build failure:
arm-linux-gnueabi-ld:
drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_remove':
sil-sii8620.c:(.text+0x1b8): undefined reference to `extcon_unregister_notifier'
arm-linux-gnueabi-ld:drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_probe':
sil-sii8620.c:(.text+0x27e8): undefined reference to `extcon_find_edev_by_node'
arm-linux-gnueabi-ld: sil-sii8620.c:(.text+0x2870): undefined reference to `extcon_register_notifier'
arm-linux-gnueabi-ld:drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_extcon_work':
sil-sii8620.c:(.text+0x2908): undefined reference to `extcon_get_state'Quoted 4 lines
Quoted 2 lines
I tried the usual 'depends on EXTCON || !EXTCON' logic, but that caused a circular
Kconfigdependency. UsingIS_REACHABLE()is ugly but works.'depends on EXTCON || !EXTCON' seems to be proper solution, maybe would be better to try to solve circular dependencies issue.
I agree that would be nice, but I failed to come to a proper solution here. FWIW, there
is one circular dependency that I managed to avoid by changing all drivers that selectFB_DDC
to depend on I2C rather than selecting it:drivers/i2c/Kconfig:8:error: recursive dependency detected!
drivers/i2c/Kconfig:8: symbol I2C is selected byFB_DDCdrivers/video/fbdev/Kconfig:63: symbolFB_DDCdepends on FBdrivers/video/fbdev/Kconfig:12: symbol FB is selected byDRM_KMS_FB_HELPERdrivers/gpu/drm/Kconfig:80: symbolDRM_KMS_FB_HELPERdepends onDRM_KMS_HELPERdrivers/gpu/drm/Kconfig:74: symbolDRM_KMS_HELPERis selected byDRM_SIL_SII8620drivers/gpu/drm/bridge/Kconfig:89: symbolDRM_SIL_SII8620depends on EXTCONdrivers/extcon/Kconfig:2: symbol EXTCON is selected byCHARGER_MANAGERdrivers/power/supply/Kconfig:482: symbolCHARGER_MANAGERdepends onPOWER_SUPPLYdrivers/power/supply/Kconfig:2: symbolPOWER_SUPPLYis selected byHID_BATTERY_STRENGTHdrivers/hid/Kconfig:29: symbolHID_BATTERY_STRENGTHdepends on HIDdrivers/hid/Kconfig:8: symbol HID is selected byI2C_HIDdrivers/hid/i2c-hid/Kconfig:5: symbolI2C_HIDdepends on I2CAfter that,
Kconfigcrashes with a segfault:drivers/video/fbdev/Kconfig:12:error: recursive dependency detected!
drivers/video/fbdev/Kconfig:12: symbol FB is selected byDRM_KMS_FB_HELPERdrivers/gpu/drm/Kconfig:80: symbolDRM_KMS_FB_HELPERdepends onDRM_KMS_HELPERdrivers/gpu/drm/Kconfig:74: symbolDRM_KMS_HELPERis selected byDRM_SIL_SII8620drivers/gpu/drm/bridge/Kconfig:89: symbolDRM_SIL_SII8620depends on EXTCONdrivers/extcon/Kconfig:2: symbol EXTCON is selected byCHARGER_MANAGERdrivers/power/supply/Kconfig:482: symbolCHARGER_MANAGERdepends onPOWER_SUPPLYdrivers/power/supply/Kconfig:2: symbolPOWER_SUPPLYis selected byHID_ASUSdrivers/hid/Kconfig:150: symbolHID_ASUSdepends onLEDS_CLASSdrivers/leds/Kconfig:17: symbolLEDS_CLASSdepends onNEW_LEDSdrivers/leds/Kconfig:9: symbolNEW_LEDSis selected bySENSORS_APPLESMCdrivers/hwmon/Kconfig:327: symbolSENSORS_APPLESMCdepends on HWMONdrivers/hwmon/Kconfig:6: symbol HWMON is selected byEEEPC_LAPTOPdrivers/platform/x86/Kconfig:260: symbolEEEPC_LAPTOPdepends onACPI_VIDEOmake[3]: *** [/git/arm-soc/scripts/kconfig/Makefile:71: randconfig] Segmentation fault (core dumped)After changing
EEEPC_LAPTOPandTHINKPAD_ACPIto 'depends on HWMON' instead of 'select HWMON', I get this one:drivers/video/fbdev/Kconfig:12:error: recursive dependency detected!
drivers/video/fbdev/Kconfig:12: symbol FB is selected byDRM_KMS_FB_HELPERdrivers/gpu/drm/Kconfig:80: symbolDRM_KMS_FB_HELPERdepends onDRM_KMS_HELPERdrivers/gpu/drm/Kconfig:74: symbolDRM_KMS_HELPERis selected byDRM_SIL_SII8620drivers/gpu/drm/bridge/Kconfig:89: symbolDRM_SIL_SII8620depends on EXTCONdrivers/extcon/Kconfig:2: symbol EXTCON is selected byCHARGER_MANAGERdrivers/power/supply/Kconfig:482: symbolCHARGER_MANAGERdepends onPOWER_SUPPLYdrivers/power/supply/Kconfig:2: symbolPOWER_SUPPLYis selected byHID_ASUSdrivers/hid/Kconfig:150: symbolHID_ASUSdepends onLEDS_CLASSdrivers/leds/Kconfig:17: symbolLEDS_CLASSdepends onNEW_LEDSdrivers/leds/Kconfig:9: symbolNEW_LEDSis selected byBACKLIGHT_ADP8860drivers/video/backlight/Kconfig:316: symbolBACKLIGHT_ADP8860depends onBACKLIGHT_CLASS_DEVICEdrivers/video/backlight/Kconfig:143: symbolBACKLIGHT_CLASS_DEVICEis selected byFB_BACKLIGHTdrivers/video/fbdev/Kconfig:187: symbolFB_BACKLIGHTdepends on FBQuoted 8 lines
Changing all drivers that select '
FB_BACKLIGHT' or 'BACKLIGHT_CLASS_DEVICE' to 'depends onBACKLIGHT_CLASS_DEVICE' gets it to build.The steps each seem reasonable, in particular since they mostly clean up the legacy
fbdev drivers to what they should have done anyway, but it is quite invasive in the end.
Any other ideas?
Quoted 6 lines
Adding Jani, since iirc he looked at the entire backlight
Kconfigstory before. I think there's some nonsense going on where in some cases you don't get reasonable dummy functions where it just doesn't make sense. Or something like that.At least the entire select vs depends on backlight sounds eerily familiar.
TL;DR I'd ack a patch switching to depends.
I'm all for switching to "depends on BACKLIGHT_CLASS_DEVICE" throughout, and I've sent patches to do just that years ago. Alas it was met with opposition because if you have BACKLIGHT_CLASS_DEVICE=n as a starting point, you won't even see your driver that depends on it in menuconfig.
I do think the menuconfig usability issue is a big part of the problem here. You can't find and enable the options you want easily if the dependencies aren't met. And you can't easily enable the dependencies either. Select is an answer to that question. It's the wrong answer, but it's *an* answer.
On another level, a lot of the problems could be avoided if we took heed of the note in Documentation/kbuild/kconfig-language.rst:
Note:
select should be used with care. select will force a symbol to a value without visiting the dependencies. By abusing select you are able to select a symbol FOO even if FOO depends on BAR that is not set.
In general use select only for non-visible symbols (no prompts anywhere) and for symbols with no dependencies. That will limit the usefulness but on the other hand avoid the illegal configurations all over.
Another part of the problem is that there is no warning or lint option or anything to warn about this usage in config. You can easily add more of these, and it'll break later in subtle ways. And we'll just keep repeating the same discussion over and over again, some folks fixing issues in kconfig, some folks using IS_REACHABLE() and eventually hitting different kinds of problems. (Personally, I wouldn't very easily accept a patch adding IS_REACHABLE() use in i915.)
BR,
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC 5/6 drm/rcar-du: fix selection of CMM driver
In reply to Arnd BergmannThe '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.
--- drivers/gpu/drm/rcar-du/Kconfig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/rcar-du/Kconfig +1 -3
@@ -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 Enable support for R-Car Color Management Module (CMM).
Signature · 6 lines
2.26.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [RFC 5/6] drm/rcar-du: fix selection of CMM driver
Hi Arnd,
Thank you for the patch.
Quoted 12 lines · Arnd Bergmann
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':
Quoted 2 lines
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.
Quoted 29 lines
Fixes e08e934d6c28 ("drm: rcar-du: Add support for CMM")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/gpu/drm/rcar-du/Kconfig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpu/drm/rcar-du/Kconfig +1
-3@@ -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 Enable support for R-Car Color Management Module (CMM).
Signature · 7 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC 5/6] drm/rcar-du: fix selection of CMM driver
Quoted 18 lines · Laurent Pinchart
Hi Arnd,
Thank you for the patch.
Quoted 12 lines · Arnd Bergmann
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':
Quoted 6 lines
Quoted 2 lines
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
Kconfigto 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?
Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/rcar-du/Kconfig +0
-1@@ -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.
Quoted 6 lines
drivers/gpu/drm/rcar-du/Kconfig config DRM_RCAR_DU · line 19
Quoted 6 lines
drivers/gpu/drm/rcar-du/Kconfig +1
-2config 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?
Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [RFC 5/6] drm/rcar-du: fix selection of CMM driver
Hi Arnd,
Quoted 21 lines · Arnd Bergmann
Quoted 13 lines · Laurent Pinchart
Quoted 12 lines · Arnd Bergmann
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':Quoted 6 lines
Quoted 2 lines
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
Kconfigto fix this.
Quoted 5 lines
I had expected this to have the same meaning that we had before the
Kconfigchange: 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 ?
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/rcar-du/Kconfig +0
-1@@ -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.
Quoted 9 lines
Quoted 6 lines
drivers/gpu/drm/rcar-du/Kconfig config DRM_RCAR_DU · line 19
Quoted 6 lines
drivers/gpu/drm/rcar-du/Kconfig +1
-2config 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 helpIt 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* :-)).
Signature · 7 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC 5/6] drm/rcar-du: fix selection of CMM driver
Quoted 25 lines · Laurent Pinchart
Hi Arnd,
Quoted 21 lines · Arnd Bergmann
Quoted 19 lines · Laurent Pinchart
Quoted 12 lines · Arnd Bergmann
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':Quoted 2 lines
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
Kconfigto fix this.
Quoted 8 lines
Quoted 5 lines
I had expected this to have the same meaning that we had before the
Kconfigchange: 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'.
Quoted 23 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/rcar-du/Kconfig +0
-1@@ -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.Quoted 9 lines
Quoted 6 lines
drivers/gpu/drm/rcar-du/Kconfig config DRM_RCAR_DU · line 19
Quoted 6 lines
drivers/gpu/drm/rcar-du/Kconfig +1
-2config 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 helpIt 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?
Quoted 10 lines
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_DESCRIPTIONandMODULE_LICENSEentries (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
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC 5/6] drm/rcar-du: fix selection of CMM driver
Hi Arnd,
Quoted 28 lines · Arnd Bergmann
Quoted 26 lines · Laurent Pinchart
Quoted 25 lines · Arnd Bergmann
Quoted 13 lines · Laurent Pinchart
Quoted 12 lines · Arnd Bergmann
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':Quoted 6 lines
Quoted 2 lines
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
Kconfigto fix this.I had expected this to have the same meaning that we had before the
Kconfigchange: whenever the dependencies are available, turn it on, otherwise leave it disabled.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
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.
Quoted 34 lines
Quoted 23 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/rcar-du/Kconfig +0
-1@@ -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.Quoted 9 lines
Quoted 6 lines
drivers/gpu/drm/rcar-du/Kconfig config DRM_RCAR_DU · line 19
Quoted 6 lines
drivers/gpu/drm/rcar-du/Kconfig +1
-2config 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 helpIt 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?
Quoted 10 lines
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_DESCRIPTIONandMODULE_LICENSEentries (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* :-)).
Quoted 8 lines
In that case, a
Makefiletrick could also work, doingifdef
CONFIG_DRM_RCAR_CMM
obj-$(CONFIG_DRM_RCAR_DU) += rcar-cmm.o
endifThereby 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
Signature · 9 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] 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 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC 5/6] drm/rcar-du: fix selection of CMM driver
Quoted 11 lines · Geert Uytterhoeven
Quoted 7 lines · Arnd Bergmann
Quoted 2 lines · Laurent Pinchart
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.
Then there is a bug. If I run 'make menuconfig' now on a mainline kernel and enable CONFIG_DRM_RCAR_DU, I can setDRM_RCAR_CMM and DRM_RCAR_LVDS to 'y', 'n' or 'm' regardless of whether CONFIG_DRM_RCAR_DU is 'm' or 'y'. The 'implies' statement seems to be ignored entirely, except as reverse 'default' setting.
Quoted 10 lines
Quoted 9 lines
In that case, a
Makefiletrick could also work, doingifdef
CONFIG_DRM_RCAR_CMM
obj-$(CONFIG_DRM_RCAR_DU) += rcar-cmm.o
endifThereby making the cmm module have the same state (y or m) as the du module whenever the option is enabled.
Quoted 7 lines
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 onDRM_RCAR_DU&& OF
defaultDRM_RCAR_DU
That doesn't work because it allows DRM_RCAR_DU=y with DRM_RCAR_CMM=m, which causes a link failure.
Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC 5/6] drm/rcar-du: fix selection of CMM driver
Quoted 14 lines · Arnd Bergmann
Quoted 11 lines · Geert Uytterhoeven
Quoted 7 lines · Arnd Bergmann
Quoted 2 lines · Laurent Pinchart
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.
Quoted 6 lines
Then there is a bug. If I run 'make menuconfig' now on a mainline kernel and enable
CONFIG_DRM_RCAR_DU, I can setDRM_RCAR_CMMandDRM_RCAR_LVDSto 'y', 'n' or 'm' regardless of whetherCONFIG_DRM_RCAR_DUis 'm' or 'y'. The 'implies' statement seems to be ignored entirely, except as reverse 'default' setting.
Here is another version that should do what we want and is only half-ugly. I can send that as a proper patch if it passes my testing and nobody hates it too much.
Arnd
drivers/gpu/drm/rcar-du/Kconfig +15 -8
@@ -4,8 +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 select DRM_GEM_CMA_HELPER
@@ -14,13 +12,17 @@ config DRM_RCAR_DU Choose this option if you have an R-Car chipset. 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" - depends on DRM && OF +config DRM_RCAR_USE_CMM + bool "R-Car DU Color Management Module (CMM) Support" depends on DRM_RCAR_DU + default DRM_RCAR_DU help Enable support for R-Car Color Management Module (CMM). +config DRM_RCAR_CMM + def_tristate DRM_RCAR_DU + depends on DRM_RCAR_USE_CMM + config DRM_RCAR_DW_HDMI tristate "R-Car DU Gen3 HDMI Encoder Support" depends on DRM && OF
@@ -28,15 +30,20 @@ config DRM_RCAR_DW_HDMI help Enable support for R-Car Gen3 internal HDMI encoder. -config DRM_RCAR_LVDS - tristate "R-Car DU LVDS Encoder Support" - depends on DRM && DRM_BRIDGE && OF +config DRM_RCAR_USE_LVDS + bool "R-Car DU LVDS Encoder Support" + depends on DRM_BRIDGE && OF + default DRM_RCAR_DU select DRM_PANEL select OF_FLATTREE select OF_OVERLAY help Enable support for the R-Car Display Unit embedded LVDS encoders. +config DRM_RCAR_LVDS + def_tristate DRM_RCAR_DU + depends on DRM_RCAR_USE_LVDS + config DRM_RCAR_VSP bool "R-Car DU VSP Compositor Support" if ARM default y if ARM64
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [RFC 5/6] drm/rcar-du: fix selection of CMM driver
Hi Arnd,
Quoted 21 lines · Arnd Bergmann
Quoted 13 lines · Arnd Bergmann
Quoted 11 lines · Geert Uytterhoeven
Quoted 7 lines · Arnd Bergmann
Quoted 2 lines · Laurent Pinchart
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.
Quoted 6 lines
Then there is a bug. If I run 'make menuconfig' now on a mainline kernel and enable
CONFIG_DRM_RCAR_DU, I can setDRM_RCAR_CMMandDRM_RCAR_LVDSto 'y', 'n' or 'm' regardless of whetherCONFIG_DRM_RCAR_DUis 'm' or 'y'. The 'implies' statement seems to be ignored entirely, except as reverse 'default' setting.
Quoted 3 lines
Here is another version that should do what we want and is only half-ugly. I can send that as a proper patch if it passes my testing and nobody hates it too much.
This may be a stupid question, but doesn't this really call for fixing Kconfig ? This seems to be such a common pattern that requiring constructs similar to the ones below will be a never-ending chase of offenders.
Quoted 58 lines
drivers/gpu/drm/rcar-du/Kconfig +15
-8@@ -4,8 +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 select DRM_GEM_CMA_HELPER@@ -14,13 +12,17 @@ config DRM_RCAR_DU Choose this option if you have an R-Car chipset. 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" - depends on DRM && OF +config DRM_RCAR_USE_CMM + bool "R-Car DU Color Management Module (CMM) Support" depends on DRM_RCAR_DU + default DRM_RCAR_DU help Enable support for R-Car Color Management Module (CMM). +config DRM_RCAR_CMM + def_tristate DRM_RCAR_DU + depends on DRM_RCAR_USE_CMM + config DRM_RCAR_DW_HDMI tristate "R-Car DU Gen3 HDMI Encoder Support" depends on DRM && OF@@ -28,15 +30,20 @@ config DRM_RCAR_DW_HDMI help Enable support for R-Car Gen3 internal HDMI encoder. -config DRM_RCAR_LVDS - tristate "R-Car DU LVDS Encoder Support" - depends on DRM && DRM_BRIDGE && OF +config DRM_RCAR_USE_LVDS + bool "R-Car DU LVDS Encoder Support" + depends on DRM_BRIDGE && OF + default DRM_RCAR_DU select DRM_PANEL select OF_FLATTREE select OF_OVERLAY help Enable support for the R-Car Display Unit embedded LVDS encoders. +config DRM_RCAR_LVDS + def_tristate DRM_RCAR_DU + depends on DRM_RCAR_USE_LVDS + config DRM_RCAR_VSP bool "R-Car DU VSP Compositor Support" if ARM default y if ARM64
Signature · 7 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC 5/6] drm/rcar-du: fix selection of CMM driver
Quoted 22 lines · Laurent Pinchart
Quoted 21 lines · Arnd Bergmann
Quoted 19 lines · Arnd Bergmann
Quoted 11 lines · Geert Uytterhoeven
Quoted 7 lines · Arnd Bergmann
Quoted 2 lines · Laurent Pinchart
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.
Then there is a bug. If I run 'make menuconfig' now on a mainline kernel and enable
CONFIG_DRM_RCAR_DU, I can setDRM_RCAR_CMMandDRM_RCAR_LVDSto 'y', 'n' or 'm' regardless of whetherCONFIG_DRM_RCAR_DUis 'm' or 'y'. The 'implies' statement seems to be ignored entirely, except as reverse 'default' setting.
Quoted 8 lines
Quoted 3 lines
Here is another version that should do what we want and is only half-ugly. I can send that as a proper patch if it passes my testing and nobody hates it too much.
This may be a stupid question, but doesn't this really call for fixing
Kconfig? This seems to be such a common pattern that requiring constructs similar to the ones below will be a never-ending chase of offenders.
Maybe, I suppose the hardest part here would be to come up with an appropriate name for the keyword ;-)
Any suggestions?
This specific issue is fairly rare though, in most cases the dependencies are in the right order so a Kconfig symbol 'depends on' a second one when the corresponding loadable module uses symbols from that second module. The problem here is that the two are mixed up.
The much more common problem is the one where one needs to wrong
config FOO
depends on BAR || !BAR
To ensure the dependency is either met or BAR is disabled, but not FOO=y with BAR=m. If you have any suggestions for a keyword for that thing, we can clean up hundreds of such instances.
Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC 5/6] drm/rcar-du: fix selection of CMM driver
Quoted 47 lines · Arnd Bergmann
Quoted 22 lines · Laurent Pinchart
Quoted 21 lines · Arnd Bergmann
Quoted 19 lines · Arnd Bergmann
Quoted 11 lines · Geert Uytterhoeven
Quoted 7 lines · Arnd Bergmann
Quoted 2 lines · Laurent Pinchart
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.
Then there is a bug. If I run 'make menuconfig' now on a mainline kernel and enable
CONFIG_DRM_RCAR_DU, I can setDRM_RCAR_CMMandDRM_RCAR_LVDSto 'y', 'n' or 'm' regardless of whetherCONFIG_DRM_RCAR_DUis 'm' or 'y'. The 'implies' statement seems to be ignored entirely, except as reverse 'default' setting.Quoted 8 lines
Quoted 3 lines
Here is another version that should do what we want and is only half-ugly. I can send that as a proper patch if it passes my testing and nobody hates it too much.
This may be a stupid question, but doesn't this really call for fixing
Kconfig? This seems to be such a common pattern that requiring constructs similar to the ones below will be a never-ending chase of offenders.Maybe, I suppose the hardest part here would be to come up with an appropriate name for the keyword ;-)
Any suggestions?
This specific issue is fairly rare though, in most cases the dependencies are in the right order so a
Kconfigsymbol 'depends on' a second one when the corresponding loadable module uses symbols from that second module. The problem here is that the two are mixed up.The much more common problem is the one where one needs to wrong
Quoted 6 lines
config FOO
depends on BAR || !BARTo ensure the dependency is either met or BAR is disabled, but not FOO=y with BAR=m. If you have any suggestions for a keyword for that thing, we can clean up hundreds of such instances.
Some ideas:
config FOO
can use BAR
maybe BAR
optional BAR
We should probably double-check that this is only ever used for when both FOO and BAR are tri-state, since without that it doesn't make much sense.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [RFC 5/6] drm/rcar-du: fix selection of CMM driver
Quoted 33 lines · Daniel Vetter
Quoted 32 lines · Arnd Bergmann
Quoted 30 lines · Laurent Pinchart
Quoted 21 lines · Arnd Bergmann
Quoted 13 lines · Arnd Bergmann
Quoted 11 lines · Geert Uytterhoeven
Quoted 7 lines · Arnd Bergmann
Quoted 2 lines · Laurent Pinchart
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.
Quoted 6 lines
Then there is a bug. If I run 'make menuconfig' now on a mainline kernel and enable
CONFIG_DRM_RCAR_DU, I can setDRM_RCAR_CMMandDRM_RCAR_LVDSto 'y', 'n' or 'm' regardless of whetherCONFIG_DRM_RCAR_DUis 'm' or 'y'. The 'implies' statement seems to be ignored entirely, except as reverse 'default' setting.Quoted 3 lines
Here is another version that should do what we want and is only half-ugly. I can send that as a proper patch if it passes my testing and nobody hates it too much.
This may be a stupid question, but doesn't this really call for fixing
Kconfig? This seems to be such a common pattern that requiring constructs similar to the ones below will be a never-ending chase of offenders.
Quoted 4 lines
Quoted 4 lines
Maybe, I suppose the hardest part here would be to come up with an appropriate name for the keyword ;-)
Any suggestions?
Would it make sense to fix the imply semantics ? Or are they use cases for the current behaviour of imply ? "recommend" could be another keyword. I think we should try to limit the number of keywords though, as it would otherwise become quite messy.
Quoted 15 lines
Quoted 8 lines
This specific issue is fairly rare though, in most cases the dependencies are in the right order so a
Kconfigsymbol 'depends on' a second one when the corresponding loadable module uses symbols from that second module. The problem here is that the two are mixed up.The much more common problem is the one where one needs to wrong
Quoted 6 lines
config FOO
depends on BAR || !BARTo ensure the dependency is either met or BAR is disabled, but not FOO=y with BAR=m. If you have any suggestions for a keyword for that thing, we can clean up hundreds of such instances.
Quoted 6 lines
Some ideas:
config FOO
can use BAR
maybe BAR
optional BAR
Another idea,
depends optionally on BAR
Quoted 3 lines
We should probably double-check that this is only ever used for when both FOO and BAR are tri-state, since without that it doesn't make much sense.
Signature · 7 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC 6/6 drm/rcar-du: fix lvds dependency
In reply to Arnd Bergmannarm-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':
rcar_du_encoder.c:(.text+0x7a): undefined reference to `rcar_lvds_dual_link'
--- drivers/gpu/drm/rcar-du/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/rcar-du/Kconfig +1 -2
@@ -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_LVDS select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER select DRM_GEM_CMA_HELPER
@@ -27,7 +26,7 @@ config DRM_RCAR_DW_HDMI Enable support for R-Car Gen3 internal HDMI encoder. config DRM_RCAR_LVDS - tristate "R-Car DU LVDS Encoder Support" + def_tristate DRM_RCAR_DU depends on DRM && DRM_BRIDGE && OF select DRM_PANEL select OF_FLATTREE
Signature · 6 lines
2.26.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 6 lines · Arnd Bergmann
Hi everyone,
I've just restarted doing randconfig builds on top of mainline Linux and found a couple of regressions with missing dependency from the recent change in the "imply" keyword in
Kconfig, presumably these two patches:
Quoted 8 lines
3a9dd3ecb207kconfig: make 'imply' obey the direct dependencydef2fbffe62ckconfig: allow symbols implied by y to become mI have created workarounds for the
Kconfigfiles, which now stop using imply and do something else in each case. I don't know whether there was a bug in the kconfig changes that has led to allowing configurations that were not meant to be legal even with the new semantics, or if theKconfigfiles have simply become incorrect now and the tool works as expected.
In most cases it is the code that has to be fixed. It typically does:
if (IS_ENABLED(CONFIG_FOO)) foo_init();
Where it should rather do:
if (IS_REACHABLE(CONFIG_FOO)) foo_init();
A couple of such patches have been produced and queued in their respective trees already.
Nicolas
Quoted 30 lines · Nicolas Pitre
Quoted 12 lines · Arnd Bergmann
Hi everyone,
I've just restarted doing randconfig builds on top of mainline Linux and
found a couple of regressions with missing dependency from the recent
change in the "imply" keyword inKconfig, presumably these two patches:
3a9dd3ecb207kconfig: make 'imply' obey the direct dependencydef2fbffe62ckconfig: allow symbols implied by y to become mQuoted 10 lines
I have created workarounds for the
Kconfigfiles, which now stop using
imply and do something else in each case. I don't know whether there was
a bug in the kconfig changes that has led to allowing configurations that
were not meant to be legal even with the new semantics, or if theKconfig
files have simply become incorrect now and the tool works as expected.In most cases it is the code that has to be fixed. It typically does:
if (IS_ENABLED(CONFIG_FOO)) foo_init();
Quoted 9 lines
Where it should rather do:
if (IS_REACHABLE(CONFIG_FOO)) foo_init();A couple of such patches have been produced and queued in their respective trees already.
Yes i have a patch in mlx5-net branch converting IS_ENABLED to IS_REACHABLE in mlx5, i will post it today.
Thanks,
Saeed.
Quoted 12 lines · Nicolas Pitre
Quoted 5 lines · Arnd Bergmann
I have created workarounds for the
Kconfigfiles, which now stop using imply and do something else in each case. I don't know whether there was a bug in the kconfig changes that has led to allowing configurations that were not meant to be legal even with the new semantics, or if theKconfigfiles have simply become incorrect now and the tool works as expected.In most cases it is the code that has to be fixed. It typically does:
if (IS_ENABLED(CONFIG_FOO)) foo_init();
Quoted 7 lines
Where it should rather do:
if (IS_REACHABLE(CONFIG_FOO)) foo_init();A couple of such patches have been produced and queued in their respective trees already.
I try to use IS_REACHABLE() only as a last resort, as it tends to confuse users when a subsystem is built as a module and already loaded but something relying on that subsystem does not use it.
In the six patches I made, I had to use IS_REACHABLE() once, for the others I tended to use a Kconfig dependency like
'depends on FOO || FOO=n'
which avoids the case that IS_REACHABLE() works around badly.
I did come up with the IS_REACHABLE() macro originally, but that doesn't mean I think it's a good idea to use it liberally ;-)
Arnd
Quoted 18 lines · Arnd Bergmann
Quoted 17 lines · Nicolas Pitre
Quoted 5 lines · Arnd Bergmann
I have created workarounds for the
Kconfigfiles, which now stop using imply and do something else in each case. I don't know whether there was a bug in the kconfig changes that has led to allowing configurations that were not meant to be legal even with the new semantics, or if theKconfigfiles have simply become incorrect now and the tool works as expected.In most cases it is the code that has to be fixed. It typically does:
if (IS_ENABLED(CONFIG_FOO)) foo_init();Where it should rather do:
if (IS_REACHABLE(CONFIG_FOO)) foo_init();
Quoted 6 lines
Quoted 2 lines
A couple of such patches have been produced and queued in their respective trees already.
I try to use
IS_REACHABLE()only as a last resort, as it tends to confuse users when a subsystem is built as a module and already loaded but something relying on that subsystem does not use it.
Then this is a usage policy issue, not a code correctness issue.
The correctness issue is fixed with IS_REACHABLE(). If you want to enforce a usage policy then this goes in Kconfig.
But you still can do both.
Nicolas
Quoted 21 lines · Arnd Bergmann
Quoted 12 lines · Nicolas Pitre
Quoted 5 lines · Arnd Bergmann
I have created workarounds for the
Kconfigfiles, which now stop using imply and do something else in each case. I don't know whether there was a bug in the kconfig changes that has led to allowing configurations that were not meant to be legal even with the new semantics, or if theKconfigfiles have simply become incorrect now and the tool works as expected.In most cases it is the code that has to be fixed. It typically does:
if (IS_ENABLED(CONFIG_FOO)) foo_init();Quoted 7 lines
Where it should rather do:
if (IS_REACHABLE(CONFIG_FOO)) foo_init();A couple of such patches have been produced and queued in their respective trees already.
Quoted 8 lines
I try to use
IS_REACHABLE()only as a last resort, as it tends to confuse users when a subsystem is built as a module and already loaded but something relying on that subsystem does not use it.In the six patches I made, I had to use
IS_REACHABLE()once, for the others I tended to use aKconfigdependency like'depends on FOO || FOO=n'
It is unfortunate kconfig doesn't have a language feature for this idiom, as the above is confounding without a lot of kconfig knowledge
Quoted 2 lines
I did come up with the
IS_REACHABLE()macro originally, but that doesn't mean I think it's a good idea to use it liberally ;-)
It would be nice to have some uniform policy here
I also don't like the IS_REACHABLE solution, it makes this more complicated, not less..
Jason
Quoted 34 lines · Jason Gunthorpe
Quoted 21 lines · Arnd Bergmann
Quoted 12 lines · Nicolas Pitre
Quoted 5 lines · Arnd Bergmann
I have created workarounds for the
Kconfigfiles, which now stop using imply and do something else in each case. I don't know whether there was a bug in the kconfig changes that has led to allowing configurations that were not meant to be legal even with the new semantics, or if theKconfigfiles have simply become incorrect now and the tool works as expected.In most cases it is the code that has to be fixed. It typically does:
if (IS_ENABLED(CONFIG_FOO)) foo_init();Quoted 7 lines
Where it should rather do:
if (IS_REACHABLE(CONFIG_FOO)) foo_init();A couple of such patches have been produced and queued in their respective trees already.
Quoted 8 lines
I try to use
IS_REACHABLE()only as a last resort, as it tends to confuse users when a subsystem is built as a module and already loaded but something relying on that subsystem does not use it.In the six patches I made, I had to use
IS_REACHABLE()once, for the others I tended to use aKconfigdependency like'depends on FOO || FOO=n'
It is unfortunate kconfig doesn't have a language feature for this idiom, as the above is confounding without a lot of kconfig knowledge
Quoted 7 lines
Quoted 2 lines
I did come up with the
IS_REACHABLE()macro originally, but that doesn't mean I think it's a good idea to use it liberally ;-)It would be nice to have some uniform policy here
I also don't like the
IS_REACHABLEsolution, it makes this more complicated, not less..
Just chiming "me too" here.
IS_REACHABLE() is not a solution, it's a hack to hide a dependency link problem under the carpet, in a way that is difficult for the user to debug and figure out.
The user thinks they've enabled a feature, but it doesn't get used anyway, because a builtin depends on something that is a module and therefore not reachable. Can someone please give me an example where that kind of behaviour is desirable?
AFAICT IS_REACHABLE() is becoming more and more common in the kernel, but arguably it's just making more undesirable configurations possible. Configurations that should simply be blocked by using suitable dependencies on the Kconfig level.
For example, you have two graphics drivers, one builtin and another module. Then you have backlight as a module. Using IS_REACHABLE(), backlight would work in one driver, but not the other. I'm sure there is the oddball person who finds this desirable, but the overwhelming majority would just make the deps such that either you make all of them modules, or also require backlight to be builtin.
BR,
Jani.
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Quoted 34 lines · Jani Nikula
Quoted 33 lines · Jason Gunthorpe
Quoted 32 lines · Arnd Bergmann
Quoted 18 lines · Nicolas Pitre
Quoted 10 lines · Arnd Bergmann
I have created workarounds for the
Kconfigfiles, which now stop using
imply and do something else in each case. I don't know whether there was
a bug in the kconfig changes that has led to allowing configurations that
were not meant to be legal even with the new semantics, or if theKconfig
files have simply become incorrect now and the tool works as expected.In most cases it is the code that has to be fixed. It typically does:
if (IS_ENABLED(CONFIG_FOO)) foo_init();Quoted 7 lines
Where it should rather do:
if (IS_REACHABLE(CONFIG_FOO)) foo_init();A couple of such patches have been produced and queued in their respective trees already.
I try to use
IS_REACHABLE()only as a last resort, as it tends to confuse users when a subsystem is built as a module and already loaded but something relying on that subsystem does not use it.
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
In the six patches I made, I had to use
IS_REACHABLE()once, for the others I tended to use aKconfigdependency like'depends on FOO || FOO=n'
This assumes that the module using FOO has its own flag representing FOO which is not always the case.
for example in mlx5 we use VXLAN config flag directly to compile VXLAN related files:
mlx5/core/Makefile:
obj-$(CONFIG_MLX5_CORE) += mlx5_core.o
mlx5_core-y := mlx5_core.o
mlx5_core-$(VXLAN) += mlx5_vxlan.o
and in mlx5_main.o we do:
if (IS_ENABLED(VXLAN))
mlx5_vxlan_init()
after the change in imply semantics:
our options are:
1) use IS_REACHABLE(VXLAN) instead of IS_ENABLED(VXLAN)
2) have MLX5_VXLAN in mlx5 Kconfig and use IS_ENABLED(MLX5_VXLAN) config MLX5_VXLAN
depends on VXLAN || !VXLAN bool
So i understand that every one agree to use solution #2 ?
Quoted 30 lines
Quoted 11 lines
It is unfortunate kconfig doesn't have a language feature for this idiom, as the above is confounding without a lot of kconfig knowledge
Quoted 2 lines
I did come up with the
IS_REACHABLE()macro originally, but that doesn't mean I think it's a good idea to use it liberally ;-)It would be nice to have some uniform policy here
I also don't like the
IS_REACHABLEsolution, it makes this more complicated, not less..Just chiming "me too" here.
IS_REACHABLE()is not a solution, it's a hack to hide a dependency link
problem under the carpet, in a way that is difficult for the user to debug and figure out.The user thinks they've enabled a feature, but it doesn't get used anyway, because a builtin depends on something that is a module and therefore not reachable. Can someone please give me an example where that kind of behaviour is desirable?
AFAICT
IS_REACHABLE()is becoming more and more common in the kernel, but arguably it's just making more undesirable configurations possible. Configurations that should simply be blocked by using suitable
dependencies on theKconfiglevel.
Quoted 9 lines
For example, you have two graphics drivers, one builtin and another module. Then you have backlight as a module. Using
IS_REACHABLE(), backlight would work in one driver, but not the other. I'm sure there is
the oddball person who finds this desirable, but the overwhelming majority would just make the deps such that either you make all of them
modules, or also require backlight to be builtin.
the previous imply semantics handled this by forcing backlight to be built-in, which worked nicely.
Quoted 5 lines
BR,
Jani.
Hi Saeed,
Quoted 10 lines · Saeed Mahameed
Quoted 8 lines · Jani Nikula
For example, you have two graphics drivers, one builtin and another module. Then you have backlight as a module. Using
IS_REACHABLE(), backlight would work in one driver, but not the other. I'm sure there is
the oddball person who finds this desirable, but the overwhelming majority would just make the deps such that either you make all of them
modules, or also require backlight to be builtin.
Quoted 2 lines
the previous imply semantics handled this by forcing backlight to be built-in, which worked nicely.
Which may have worked fine for backlight, but not for other symbols with dependencies that are not always met.
=> Use "select" to enable something unconditionally, but this can only
be used if the target's dependencies are met.
=> Use "imply" to enable an optional feature conditionally.
Gr{oetje,eeting}s,
Geert
Signature · 9 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] 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 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 6 lines · Saeed Mahameed
This assumes that the module using FOO has its own flag representing FOO which is not always the case.
for example in mlx5 we use VXLAN config flag directly to compile VXLAN related files:
Quoted 8 lines
mlx5/core/Makefile:
obj-$(CONFIG_MLX5_CORE) += mlx5_core.o
mlx5_core-y := mlx5_core.o
mlx5_core-$(VXLAN) += mlx5_vxlan.oand in mlx5_main.o we do:
Does this work if VXLAN = m ?
Quoted 6 lines
if (
IS_ENABLED(VXLAN))mlx5_vxlan_init()after the change in imply semantics:
our options are:
Quoted 6 lines
1) use
IS_REACHABLE(VXLAN)instead ofIS_ENABLED(VXLAN)2) have
MLX5_VXLANin mlx5Kconfigand useIS_ENABLED(MLX5_VXLAN)configMLX5_VXLANdepends on VXLAN || !VXLAN bool
Does this trick work when vxlan is a bool not a tristate?
Why not just put the VXLAN || !VXLAN directly on MLX5_CORE?
Jason
Quoted 12 lines · Jason Gunthorpe
Quoted 10 lines · Saeed Mahameed
This assumes that the module using FOO has its own flag representing
FOO which is not always the case.for example in mlx5 we use VXLAN config flag directly to compile VXLAN
related files:mlx5/core/Makefile:
Quoted 8 lines
Quoted 6 lines
obj-$(CONFIG_MLX5_CORE) += mlx5_core.o
mlx5_core-y := mlx5_core.o
mlx5_core-$(VXLAN) += mlx5_vxlan.oand in mlx5_main.o we do:
Does this work if VXLAN = m ?
Yes, if VXLAN IS_REACHABLE to MLX5, mlx5_vxlan.o will be compiled/linked.
Quoted 9 lines
Quoted 9 lines
if (
IS_ENABLED(VXLAN))mlx5_vxlan_init()after the change in imply semantics:
our options are:1) use
IS_REACHABLE(VXLAN)instead ofIS_ENABLED(VXLAN)
Quoted 9 lines
Quoted 4 lines
2) have
MLX5_VXLANin mlx5Kconfigand useIS_ENABLED(MLX5_VXLAN)configMLX5_VXLANdepends on VXLAN || !VXLAN boolDoes this trick work when vxlan is a bool not a tristate?
Why not just put the VXLAN || !VXLAN directly on
MLX5_CORE?
so force MLX5_CORE to n if vxlan is not reachable ? why ? mlx5_core can perfectly live without vxlan .. all we need to know is if VXLAN is supported and reachable, if so, then we want to also support vxlan in mlx5 (i.e compile mlx5_vxlan.o)
and how do we compile mlx5_vxlan.o wihout a single flag can i do in Makefile :
mlx5_core-$(VXLAN || !VXLAN) += mlx5_vxlan.o ??
Quoted 1 line
Jason
Quoted 18 lines · Saeed Mahameed
Quoted 17 lines · Jason Gunthorpe
Quoted 15 lines · Saeed Mahameed
This assumes that the module using FOO has its own flag representing
FOO which is not always the case.for example in mlx5 we use VXLAN config flag directly to compile VXLAN
related files:mlx5/core/Makefile:
obj-$(CONFIG_MLX5_CORE) += mlx5_core.o
mlx5_core-y := mlx5_core.o
mlx5_core-$(VXLAN) += mlx5_vxlan.o
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
and in mlx5_main.o we do:
Does this work if VXLAN = m ?
Yes, if VXLAN
IS_REACHABLEto MLX5, mlx5_vxlan.o will be compiled/linked.
So mlx5_core-m does the right thing somehow?
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
if (
IS_ENABLED(VXLAN))mlx5_vxlan_init()after the change in imply semantics:
our options are:1) use
IS_REACHABLE(VXLAN)instead ofIS_ENABLED(VXLAN)2) have
MLX5_VXLANin mlx5Kconfigand useIS_ENABLED(MLX5_VXLAN)configMLX5_VXLANdepends on VXLAN || !VXLAN bool
Quoted 6 lines
Quoted 4 lines
Does this trick work when vxlan is a bool not a tristate?
Why not just put the VXLAN || !VXLAN directly on
MLX5_CORE?so force
MLX5_COREto n if vxlan is not reachable ?
IIRC that isn't what the expression does, if vxlan is 'n' then
n || !n == true
The other version of this is (m || VXLAN != m)
Basically all it does is prevent MLX5_CORE=y && VXLAN=m
Quoted 3 lines
and how do we compile mlx5_vxlan.o wihout a single flag can i do in
Makefile:
mlx5_core-$(VXLAN || !VXLAN) += mlx5_vxlan.o ??
No, you just use VXLAN directly, it will be m, n or y, but it won't be m if mlx5_core is y
Jason
Quoted 18 lines · Jason Gunthorpe
Quoted 17 lines · Saeed Mahameed
Quoted 16 lines · Jason Gunthorpe
Quoted 14 lines · Saeed Mahameed
This assumes that the module using FOO has its own flag representing
FOO which is not always the case.for example in mlx5 we use VXLAN config flag directly to compile VXLAN related files:
mlx5/core/Makefile:
obj-$(CONFIG_MLX5_CORE) += mlx5_core.o
mlx5_core-y := mlx5_core.o
mlx5_core-$(VXLAN) += mlx5_vxlan.o
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
and in mlx5_main.o we do:
Does this work if VXLAN = m ?
Yes, if VXLAN
IS_REACHABLEto MLX5, mlx5_vxlan.o will be compiled/linked.So mlx5_core-m does the right thing somehow?
What happens with CONFIG_VXLAN=m is that the above turns into
mlx5_core-y := mlx5_core.o
mlx5_core-m += mlx5_vxlan.o
which in turn leads to mlx5_core.ko *not* containing mlx5_vxlan.o, and in turn causing that link error against mlx5_vxlan_create/mlx5_vxlan_destroy, unless the IS_ENABLED() is changed to IS_REACHABLE().
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 6 lines
if (
IS_ENABLED(VXLAN))mlx5_vxlan_init()after the change in imply semantics:
our options are:Quoted 6 lines
1) use
IS_REACHABLE(VXLAN)instead ofIS_ENABLED(VXLAN)2) have
MLX5_VXLANin mlx5Kconfigand useIS_ENABLED(MLX5_VXLAN)configMLX5_VXLAN
depends on VXLAN || !VXLAN
boolDoes this trick work when vxlan is a bool not a tristate?
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Why not just put the VXLAN || !VXLAN directly on
MLX5_CORE?so force
MLX5_COREto n if vxlan is not reachable ?IIRC that isn't what the expression does, if vxlan is 'n' then
n || !n == true
It forces MLX5_CORE to 'm' or 'n' but not 'y' if VXLAN=m, but allows any option if VXLAN=y
Quoted 1 line
The other version of this is (m || VXLAN != m)
Right, that should be the same, but is less common.
I later found that I also needed this one for the same kind of dependency on PTP:
drivers/net/ethernet/mellanox/mlx5/core/Kconfig +0 -0
@@ -7,7 +7,7 @@ config MLX5_CORE tristate "Mellanox 5th generation network adapters (ConnectX
series) core driver"
depends on PCI
select NET_DEVLINK
- imply PTP_1588_CLOCK
+ depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
depends on VXLAN || !VXLAN
imply MLXFW
imply PCI_HYPERV_INTERFACE_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 30 lines · Arnd Bergmann
Quoted 18 lines · Jason Gunthorpe
Quoted 17 lines · Saeed Mahameed
Quoted 16 lines · Jason Gunthorpe
Quoted 14 lines · Saeed Mahameed
This assumes that the module using FOO has its own flag representing
FOO which is not always the case.for example in mlx5 we use VXLAN config flag directly to compile VXLAN related files:
mlx5/core/Makefile:
obj-$(CONFIG_MLX5_CORE) += mlx5_core.o
mlx5_core-y := mlx5_core.o
mlx5_core-$(VXLAN) += mlx5_vxlan.oQuoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
and in mlx5_main.o we do:
Does this work if VXLAN = m ?
Yes, if VXLAN
IS_REACHABLEto MLX5, mlx5_vxlan.o will be compiled/linked.So mlx5_core-m does the right thing somehow?
What happens with
CONFIG_VXLAN=mis that the above turns into
Quoted 7 lines
mlx5_core-y := mlx5_core.o
mlx5_core-m += mlx5_vxlan.owhich in turn leads to mlx5_core.ko *not* containing mlx5_vxlan.o, and in turn causing that link error against mlx5_vxlan_create/mlx5_vxlan_destroy, unless the
IS_ENABLED()is changed toIS_REACHABLE().
What about the reverse if mlx5_core is 'm' and VLXAN is 'y'?
mlx5_core-m := mlx5_core.o
mlx5_core-y += mlx5_vxlan.o
Magically works out?
Quoted 5 lines
Quoted 2 lines
IIRC that isn't what the expression does, if vxlan is 'n' then
n || !n == trueIt forces
MLX5_COREto 'm' or 'n' but not 'y' if VXLAN=m, but allows any option if VXLAN=y
And any option if VXLAN=n ?
Jason
Quoted 9 lines · Jason Gunthorpe
Quoted 6 lines · Arnd Bergmann
Quoted 1 line · Jason Gunthorpe
On Fri, Apr 10, 2020 at 07:04:27PM +0000, Saeed Mahameed wrote:
which in turn leads to mlx5_core.ko *not* containing mlx5_vxlan.o, and in turn causing that link error against mlx5_vxlan_create/mlx5_vxlan_destroy, unless the
IS_ENABLED()is changed toIS_REACHABLE().
Quoted 6 lines
What about the reverse if
mlx5_coreis 'm' and VLXAN is 'y'?mlx5_core-m := mlx5_core.o
mlx5_core-y += mlx5_vxlan.oMagically works out?
Yes, Kbuild takes care of that case.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
IIRC that isn't what the expression does, if vxlan is 'n' then
n || !n == trueIt forces
MLX5_COREto 'm' or 'n' but not 'y' if VXLAN=m, but allows any option if VXLAN=yAnd any option if VXLAN=n ?
Correct.
Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 23 lines · Arnd Bergmann
Quoted 10 lines · Jason Gunthorpe
Quoted 8 lines · Arnd Bergmann
Quoted 1 line · Jason Gunthorpe
On Fri, Apr 10, 2020 at 07:04:27PM +0000, Saeed Mahameed wrote:
which in turn leads to mlx5_core.ko *not* containing mlx5_vxlan.o,
and in turn causing that link error against mlx5_vxlan_create/mlx5_vxlan_destroy, unless theIS_ENABLED()is changed toIS_REACHABLE().Quoted 6 lines
What about the reverse if
mlx5_coreis 'm' and VLXAN is 'y'?mlx5_core-m := mlx5_core.o
mlx5_core-y += mlx5_vxlan.oMagically works out?
Yes,
Kbuildtakes care of that case.Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
IIRC that isn't what the expression does, if vxlan is 'n' then
n || !n == true
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
It forces
MLX5_COREto 'm' or 'n' but not 'y' if VXLAN=m, but allows any option if VXLAN=yAnd any option if VXLAN=n ?
Correct.
Great !
Then bottom line we will change mlx5/Kconfig: to
depends on VXLAN || !VXLAN
This will force MLX5_CORE to m when necessary to make vxlan reachable to mlx5_core. So no need for explicit use of IS_REACHABLE(). in mlx5 there are 4 of these:
imply PTP_1588_CLOCK
imply VXLAN
imply MLXFW
imply PCI_HYPERV_INTERFACEI will make a patch.
Thanks,
Saeed.
Quoted 10 lines · Saeed Mahameed
Quoted 3 lines · Arnd Bergmann
On Tue, Apr 14, 2020 at 5:23 PM Jason Gunthorpe <[email protected]> wrote:
Correct.Great !
Then bottom line we will change mlx5/Kconfig: to
depends on VXLAN || !VXLAN
Ok
Quoted 8 lines
This will force
MLX5_COREto m when necessary to make vxlan reachable tomlx5_core. So no need for explicit use ofIS_REACHABLE(). in mlx5 there are 4 of these:imply PTP_1588_CLOCK imply VXLAN imply MLXFW imply PCI_HYPERV_INTERFACE
As mentioned earlier, we do need to replace the 'imply PTP_1588_CLOCK' with the same
depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
So far I have not seen problems for the other two options, so I assume they are fine for now -- it seems to build just fine without PCI_HYPERV_INTERFACE, and MLXFW has no other dependencies, meaning that 'imply' is the same as 'select' here. Using 'select MLXFW' would make it clearer perhaps.
Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines · Arnd Bergmann
Quoted 6 lines · Saeed Mahameed
Quoted 4 lines · Arnd Bergmann
On Tue, Apr 14, 2020 at 5:23 PM Jason Gunthorpe <[email protected]> wrote:
Correct.
Quoted 8 lines
Quoted 5 lines
Great !
Then bottom line we will change mlx5/Kconfig: to
depends on VXLAN || !VXLAN
Ok
BTW how about adding a new Kconfig option to hide the details of ( BAR || !BAR) ? as Jason already explained and suggested, this will make it easier for the users and developers to understand the actual meaning behind this tristate weird condition.
e.g have a new keyword:
reach VXLAN
which will be equivalent to:
depends on VXLAN && !VXLAN
Quoted 16 lines
Quoted 9 lines
This will force
MLX5_COREto m when necessary to make vxlan reachable
tomlx5_core. So no need for explicit use ofIS_REACHABLE(). in mlx5 there are 4 of these:imply PTP_1588_CLOCK imply VXLAN imply MLXFW imply PCI_HYPERV_INTERFACEAs mentioned earlier, we do need to replace the 'imply
PTP_1588_CLOCK'
with the samedepends on PTP_1588_CLOCK || !PTP_1588_CLOCK
Quoted 7 lines
So far I have not seen problems for the other two options, so I assume they
are fine for now -- it seems to build just fine withoutPCI_HYPERV_INTERFACE,
and MLXFW has no other dependencies, meaning that 'imply' is the same as 'select' here. Using 'select MLXFW' would make it clearer perhaps.
No, I would like to avoid select and allow building mlx5 without MLXFW, MLXFW already has a stub protected with IS_REACHABLE(), this is why we don't have an issue with it.
Quoted 2 lines
Arnd
Quoted 24 lines · Saeed Mahameed
Quoted 8 lines · Arnd Bergmann
Quoted 6 lines · Saeed Mahameed
Quoted 4 lines · Arnd Bergmann
On Tue, Apr 14, 2020 at 5:23 PM Jason Gunthorpe <[email protected]> wrote:
Correct.Quoted 8 lines
Quoted 5 lines
Great !
Then bottom line we will change mlx5/Kconfig: to
depends on VXLAN || !VXLAN
Ok
BTW how about adding a new
Kconfigoption to hide the details of ( BAR || !BAR) ? as Jason already explained and suggested, this will make it easier for the users and developers to understand the actual meaning behind this tristate weird condition.
Quoted 4 lines
e.g have a new keyword:
reach VXLAN
which will be equivalent to:depends on VXLAN && !VXLAN
I'd love to see that, but I'm not sure what keyword is best. For your suggestion of "reach", that would probably do the job, but I'm not sure if this ends up being more or less confusing than what we have today.
Quoted 24 lines
Quoted 16 lines
Quoted 9 lines
This will force
MLX5_COREto m when necessary to make vxlan reachable
tomlx5_core. So no need for explicit use ofIS_REACHABLE(). in mlx5 there are 4 of these:imply PTP_1588_CLOCK imply VXLAN imply MLXFW imply PCI_HYPERV_INTERFACEAs mentioned earlier, we do need to replace the 'imply
PTP_1588_CLOCK'
with the samedepends on PTP_1588_CLOCK || !PTP_1588_CLOCKQuoted 7 lines
So far I have not seen problems for the other two options, so I assume they
are fine for now -- it seems to build just fine withoutPCI_HYPERV_INTERFACE,
and MLXFW has no other dependencies, meaning that 'imply' is the same as 'select' here. Using 'select MLXFW' would make it clearer perhaps.
Quoted 3 lines
No, I would like to avoid select and allow building mlx5 without MLXFW, MLXFW already has a stub protected with
IS_REACHABLE(), this is why we don't have an issue with it.
So the 'imply MLXFW' should be dropped then?
Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · Saeed Mahameed
BTW how about adding a new
Kconfigoption to hide the details of ( BAR || !BAR) ? as Jason already explained and suggested, this will make it easier for the users and developers to understand the actual meaning behind this tristate weird condition.e.g have a new keyword:
reach VXLAN
which will be equivalent to:depends on VXLAN && !VXLAN
Quoted 4 lines
I'd love to see that, but I'm not sure what keyword is best. For your suggestion of "reach", that would probably do the job, but I'm not sure if this ends up being more or less confusing than what we have today.
Ah, perfect bikeshedding topic!
Perhaps "uses"? If the dependency is enabled it gets used as a dependency.
Of course, this is all just talk until someone(tm) posts a patch actually making the change. I've looked at the kconfig tool sources before; not going to make the same mistake again.
BR,
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 18 lines · Jani Nikula
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · Saeed Mahameed
BTW how about adding a new
Kconfigoption to hide the details of ( BAR || !BAR) ? as Jason already explained and suggested, this will make it easier for the users and developers to understand the actual meaning behind this tristate weird condition.e.g have a new keyword:
reach VXLAN
which will be equivalent to:depends on VXLAN && !VXLANQuoted 4 lines
I'd love to see that, but I'm not sure what keyword is best. For your suggestion of "reach", that would probably do the job, but I'm not sure if this ends up being more or less confusing than what we have today.
Quoted 4 lines
Ah, perfect bikeshedding topic!
Perhaps "uses"? If the dependency is enabled it gets used as a dependency.
That seems to be the best naming suggestion so far
Quoted 3 lines
Of course, this is all just talk until someone(tm) posts a patch actually making the change. I've looked at the kconfig tool sources before; not going to make the same mistake again.
Right. OTOH whoever implements it gets to pick the color of the bikeshed. ;-)
Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 20 lines · Arnd Bergmann
Quoted 18 lines · Jani Nikula
Quoted 15 lines · Arnd Bergmann
Quoted 9 lines · Saeed Mahameed
BTW how about adding a new
Kconfigoption to hide the details of ( BAR || !BAR) ? as Jason already explained and suggested, this will make it easier for the users and developers to understand the actual meaning behind this tristate weird condition.e.g have a new keyword:
reach VXLAN
which will be equivalent to:depends on VXLAN && !VXLANI'd love to see that, but I'm not sure what keyword is best. For your suggestion of "reach", that would probably do the job, but I'm not sure if this ends up being more or less confusing than what we have today.
Quoted 6 lines
Quoted 4 lines
Ah, perfect bikeshedding topic!
Perhaps "uses"? If the dependency is enabled it gets used as a dependency.
That seems to be the best naming suggestion so far
Uses also makes sense to me.
Quoted 6 lines
Quoted 3 lines
Of course, this is all just talk until someone(tm) posts a patch actually making the change. I've looked at the kconfig tool sources before; not going to make the same mistake again.
Right. OTOH whoever implements it gets to pick the color of the bikeshed. ;-)
I hope someone takes it up, especially now that imply, which apparently used to do this, doesn't any more :)
Jason
Quoted 11 lines · Jason Gunthorpe
Quoted 7 lines · Arnd Bergmann
Quoted 3 lines · Jani Nikula
Of course, this is all just talk until someone(tm) posts a patch actually making the change. I've looked at the kconfig tool sources before; not going to make the same mistake again.
Right. OTOH whoever implements it gets to pick the color of the bikeshed. ;-)
I hope someone takes it up, especially now that imply, which apparently used to do this, doesn't any more :)
The old 'imply' was something completely different, it was more of a 'try to select if you can so we can assume it's there, but give up if it can only be a module and we need it to be built-in".
Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · Jason Gunthorpe
Quoted 7 lines · Arnd Bergmann
Quoted 3 lines · Jani Nikula
Of course, this is all just talk until someone(tm) posts a patch actually making the change. I've looked at the kconfig tool sources before; not going to make the same mistake again.
Right. OTOH whoever implements it gets to pick the color of the bikeshed. ;-)
Quoted 6 lines
Quoted 2 lines
I hope someone takes it up, especially now that imply, which apparently used to do this, doesn't any more :)
The old 'imply' was something completely different, it was more of a 'try to select if you can so we can assume it's there, but give up if it can only be a module and we need it to be built-in".
But it seems to have done this as a side-effect, and drivers were relying on that, otherwise this series wouldn't exist..
Jason
Quoted 41 lines · Jason Gunthorpe
Quoted 26 lines · Arnd Bergmann
Quoted 24 lines · Jani Nikula
Quoted 22 lines · Arnd Bergmann
Quoted 8 lines · Saeed Mahameed
BTW how about adding a new
Kconfigoption to hide the details of
( BAR || !BAR) ? as Jason already explained and suggested, this will
make it easier for the users and developers to understand the actual
meaning behind this tristate weird condition.Quoted 4 lines
e.g have a new keyword:
reach VXLAN
which will be equivalent to:depends on VXLAN && !VXLANI'd love to see that, but I'm not sure what keyword is best. For your
suggestion of "reach", that would probably do the job, but I'm not
sure if this ends up being more or less confusing than what we have
today.Quoted 6 lines
Quoted 4 lines
Ah, perfect bikeshedding topic!
Perhaps "uses"? If the dependency is enabled it gets used as a dependency.
That seems to be the best naming suggestion so far
Uses also makes sense to me.
Quoted 5 lines
Quoted 4 lines
Of course, this is all just talk until someone(tm) posts a patch actually making the change. I've looked at the kconfig tool sources
before; not going to make the same mistake again.
Quoted 6 lines
Quoted 2 lines
Right. OTOH whoever implements it gets to pick the color of the bikeshed. ;-)
I hope someone takes it up, especially now that imply, which apparently used to do this, doesn't any more :)
Well, I have a patch since yesterday.. i though You and Arnd didn't like the idea, so i dropped the whole thing :), but apparently you just didn't like the name of the new option.
"uses" seems like a good name ..
I will post the patch.
Quoted 20 lines · Arnd Bergmann
Quoted 18 lines · Jani Nikula
Quoted 15 lines · Arnd Bergmann
Quoted 9 lines · Saeed Mahameed
BTW how about adding a new
Kconfigoption to hide the details of ( BAR || !BAR) ? as Jason already explained and suggested, this will make it easier for the users and developers to understand the actual meaning behind this tristate weird condition.e.g have a new keyword:
reach VXLAN
which will be equivalent to:depends on VXLAN && !VXLANI'd love to see that, but I'm not sure what keyword is best. For your suggestion of "reach", that would probably do the job, but I'm not sure if this ends up being more or less confusing than what we have today.
Quoted 6 lines
Quoted 4 lines
Ah, perfect bikeshedding topic!
Perhaps "uses"? If the dependency is enabled it gets used as a dependency.
That seems to be the best naming suggestion so far
What I don't like about "uses" is that it doesn't convey the conditional dependency. It could be mistaken as being synonymous to "select".
What about "depends_if" ? The rationale is that this is actually a dependency, but only if the related symbol is set (i.e. not n or empty).
Quoted 2 lines
Right. OTOH whoever implements it gets to pick the color of the bikeshed. ;-)
Absolutely. But some brainstorming can't hurt.
Nicolas
Quoted 27 lines · Nicolas Pitre
Quoted 25 lines · Arnd Bergmann
Quoted 22 lines · Jani Nikula
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · Saeed Mahameed
BTW how about adding a new
Kconfigoption to hide the details of ( BAR || !BAR) ? as Jason already explained and suggested, this will make it easier for the users and developers to understand the actual meaning behind this tristate weird condition.e.g have a new keyword:
reach VXLAN
which will be equivalent to:depends on VXLAN && !VXLANQuoted 4 lines
I'd love to see that, but I'm not sure what keyword is best. For your suggestion of "reach", that would probably do the job, but I'm not sure if this ends up being more or less confusing than what we have today.
Ah, perfect bikeshedding topic!
Perhaps "uses"? If the dependency is enabled it gets used as a dependency.
Quoted 7 lines
Quoted 1 line
That seems to be the best naming suggestion so far
What I don't like about "uses" is that it doesn't convey the conditional dependency. It could be mistaken as being synonymous to "select".
What about "
depends_if" ? The rationale is that this is actually a dependency, but only if the related symbol is set (i.e. not n or empty).
I think that stretches the common understanding of 'depends' a bit too far.. A depends where the target can be N is just too strange.
Somthing incorporating 'optional' seems like a better choice 'optionally uses' seems particularly clear and doesn't overload existing works like depends or select
Jason
Quoted 28 lines · Jason Gunthorpe
Quoted 27 lines · Nicolas Pitre
Quoted 17 lines · Arnd Bergmann
Quoted 15 lines · Jani Nikula
Quoted 14 lines · Arnd Bergmann
Quoted 9 lines · Saeed Mahameed
BTW how about adding a new
Kconfigoption to hide the details of ( BAR || !BAR) ? as Jason already explained and suggested, this will make it easier for the users and developers to understand the actual meaning behind this tristate weird condition.e.g have a new keyword:
reach VXLAN
which will be equivalent to:depends on VXLAN && !VXLANI'd love to see that, but I'm not sure what keyword is best. For your suggestion of "reach", that would probably do the job, but I'm not sure if this ends up being more or less confusing than what we have today.
Quoted 5 lines
Quoted 4 lines
Ah, perfect bikeshedding topic!
Perhaps "uses"? If the dependency is enabled it gets used as a dependency.
That seems to be the best naming suggestion so far
What I don't like about "uses" is that it doesn't convey the conditional dependency. It could be mistaken as being synonymous to "select".
Quoted 8 lines
Quoted 2 lines
What about "
depends_if" ? The rationale is that this is actually a dependency, but only if the related symbol is set (i.e. not n or empty).I think that stretches the common understanding of 'depends' a bit too far.. A depends where the target can be N is just too strange.
Somthing incorporating 'optional' seems like a better choice 'optionally uses' seems particularly clear and doesn't overload existing works like depends or select
I think the whole misunderstanding with imply is that ppl try to use it as weak 'depend on' but it is weak 'select' - ie it enforces value of implied symbol in contrast to 'depends' which enforces value of current symbol.
So if we want to add new symbol 'weak depend' it would be good to stress out that difference.
Moreover name imply is already cryptic, adding another keyword which for sure will be cryptic (as there are no natural candidates) will complicate things more.
Maybe adding some decorator would be better, like optionally or weak, for example:
optionally depends on X
optionally select Y
Even more readable:
depends on X if on
depends on Y if enabled
Regards
Andrzej
Quoted 3 lines
Jason