Skip to contentSkip to conversation

Patch "fbdev: simplefb: fix Kconfig dependencies" has been added to the 5.14-stable tree

PATCH [email protected] 1 participant 1 message Oct 9, 2021

Subsystems (2)
lore
Share & tools
lore

[email protected]

author Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

fbdev: simplefb: fix Kconfig dependencies

to the 5.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
fbdev-simplefb-fix-kconfig-dependencies.patch
and it can be found in the queue-5.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From ec7cc3f74b4236860ce612656aa5be7936d1c594 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <[email protected]>
Date: Tue, 28 Sep 2021 16:52:10 +0200
Subject: fbdev: simplefb: fix Kconfig dependencies

From: Arnd Bergmann <[email protected]>

commit ec7cc3f74b4236860ce612656aa5be7936d1c594 upstream.

Configurations with both CONFIG_FB_SIMPLE=y and CONFIG_DRM_SIMPLEDRM=m are allowed by Kconfig because the 'depends on !DRM_SIMPLEDRM' dependency does not disallow FB_SIMPLE as long as SIMPLEDRM is not built-in. This can however result in a build failure when cfb_fillrect() etc are then also in loadable modules:

x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x1f8): undefined reference to `cfb_fillrect'
x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x200): undefined reference to `cfb_copyarea'
x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x208): undefined reference to `cfb_imageblit'

To work around this, change FB_SIMPLE to be a 'tristate' symbol, which still allows both to be =m together, but not one of them to be =y if the other one is =m. If a distro kernel picks this configuration, it can be determined by local policy which of the two modules gets loaded. The 'of_chosen' export is needed as this is the first loadable module referencing it.

Alternatively, the Kconfig dependency could be changed to 'depends on DRM_SIMPLEDRM=n', which would forbid the configuration with both drivers.

Fixes 11e8f5fd223b ("drm: Add simpledrm driver")
Cc Thomas Zimmermann <[email protected]>
Cc Daniel Vetter <[email protected]> # fbdev support
Cc Maxime Ripard <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Mark Brown <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Peter Collingbourne <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc <[email protected]> # v5.14+
---
 drivers/of/base.c           |    1 +
 drivers/video/fbdev/Kconfig |    5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/of/base.c +1 -0
@@ -36,6 +36,7 @@ LIST_HEAD(aliases_lookup);
 struct device_node *of_root;
 EXPORT_SYMBOL(of_root);
 struct device_node *of_chosen;
+EXPORT_SYMBOL(of_chosen);
 struct device_node *of_aliases;
 struct device_node *of_stdout;
 static const char *of_stdout_options;
drivers/video/fbdev/Kconfig +3 -2
@@ -2191,8 +2191,9 @@ config FB_HYPERV
 	  This framebuffer driver supports Microsoft Hyper-V Synthetic Video.
 
 config FB_SIMPLE
-	bool "Simple framebuffer support"
-	depends on (FB = y) && !DRM_SIMPLEDRM
+	tristate "Simple framebuffer support"
+	depends on FB
+	depends on !DRM_SIMPLEDRM
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT

Patches currently in stable-queue which might be from [email protected] are

queue-5.14/fbdev-simplefb-fix-kconfig-dependencies.patch