Skip to contentSkip to conversation

drm/drm_panel: Fix EXPORT of drm_panel_of_backlight() one more time

PATCH In review Andy Shevchenko 4 participants 5 messages Dec 17, 2019 – Dec 18, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/drm_panel: Fix EXPORT of drm_panel_of_backlight() one more time

The initial commit followed by the fix didn't take into consideration the case

CONFIG_DRM_PANEL=y
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_DRM_I915=y

where symbol devm_of_find_backlight() is not reachable from DRM subsystem. Quick fix is to avoid drm_panel_of_backlight() from exporting in such case.

Fixes 907aa265fde6 ("drm/drm_panel: fix EXPORT of drm_panel_of_backlight")
Cc Linus Walleij <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maxime Ripard <[email protected]>
---
 drivers/gpu/drm/drm_panel.c | 2 +-
 include/drm/drm_panel.h     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_panel.c +1 -1
index 79ff3fdf6f6e..8c7bac85a793 100644
@@ -302,7 +302,7 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np)
 EXPORT_SYMBOL(of_drm_find_panel);
 #endif
 
-#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE)
 /**
  * drm_panel_of_backlight - use backlight device node for backlight
  * @panel: DRM panel
include/drm/drm_panel.h +1 -1
index 5f27b693e1a0..121f7aabccd1 100644
@@ -198,7 +198,7 @@ static inline struct drm_panel *of_drm_find_panel(const struct device_node *np)
 }
 #endif
 
-#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE)
 int drm_panel_of_backlight(struct drm_panel *panel);
 #else
 static inline int drm_panel_of_backlight(struct drm_panel *panel)
Signature · 1 line
2.24.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Andy Shevchenko

The initial commit followed by the fix didn't take into consideration the case

CONFIG_DRM_PANEL=y
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_DRM_I915=y

where symbol devm_of_find_backlight() is not reachable from DRM subsystem. Quick fix is to avoid drm_panel_of_backlight() from exporting in such case.

Quoted 13 lines
Fixes 907aa265fde6 ("drm/drm_panel: fix EXPORT of drm_panel_of_backlight")
Cc Linus Walleij <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maxime Ripard <[email protected]>

Yes, that fixes the build error. Thanks.

Quoted 32 lines
---
 drivers/gpu/drm/drm_panel.c | 2 +-
 include/drm/drm_panel.h     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_panel.c +1 -1
index 79ff3fdf6f6e..8c7bac85a793 100644
@@ -302,7 +302,7 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np)
 EXPORT_SYMBOL(of_drm_find_panel);
 #endif
 
-#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE)
 /**
  * drm_panel_of_backlight - use backlight device node for backlight
  * @panel: DRM panel
include/drm/drm_panel.h +1 -1
index 5f27b693e1a0..121f7aabccd1 100644
@@ -198,7 +198,7 @@ static inline struct drm_panel *of_drm_find_panel(const struct device_node *np)
 }
 #endif
 
-#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE)
 int drm_panel_of_backlight(struct drm_panel *panel);
 #else
 static inline int drm_panel_of_backlight(struct drm_panel *panel)
Signature · 1 line
~Randy
#2 lore raw
Quoted 24 lines · Randy Dunlap
Quoted 9 lines · Andy Shevchenko

The initial commit followed by the fix didn't take into consideration the case

CONFIG_DRM_PANEL=y
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_DRM_I915=y

where symbol devm_of_find_backlight() is not reachable from DRM subsystem. Quick fix is to avoid drm_panel_of_backlight() from exporting in such case.

Quoted 13 lines
Fixes 907aa265fde6 ("drm/drm_panel: fix EXPORT of drm_panel_of_backlight")
Cc Linus Walleij <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maxime Ripard <[email protected]>
Quoted 3 lines

Yes, that fixes the build error. Thanks.

Hi Andy - thanks for fixing this. And thanks Randy for verifying the fix.
It passed my build test and is now pushed to drm-misc-next.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 25 lines · Sam Ravnborg
Quoted 24 lines · Randy Dunlap
Quoted 22 lines · Andy Shevchenko

The initial commit followed by the fix didn't take into consideration the case

CONFIG_DRM_PANEL=y
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_DRM_I915=y

where symbol devm_of_find_backlight() is not reachable from DRM subsystem. Quick fix is to avoid drm_panel_of_backlight() from exporting in such case.

Fixes 907aa265fde6 ("drm/drm_panel: fix EXPORT of drm_panel_of_backlight")
Cc Linus Walleij <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maxime Ripard <[email protected]>
Quoted 7 lines
Quoted 3 lines

Yes, that fixes the build error. Thanks.

Hi Andy - thanks for fixing this. And thanks Randy for verifying the fix.
It passed my build test and is now pushed to drm-misc-next.

As I wrote in [1], this allows a configuration that builds and links, but is silently broken. You won't get backlight support in drm panel which would be a reasonable expectation with CONFIG_BACKLIGHT_CLASS_DEVICE=m.

BR,
Jani.

[1] http://mid.mail-archive.com/[email protected]

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#4 lore raw

Hi Jani.

Quoted 4 lines

As I wrote in [1], this allows a configuration that builds and links, but is silently broken. You won't get backlight support in drm panel which would be a reasonable expectation with CONFIG_BACKLIGHT_CLASS_DEVICE=m.

Agreed - it needs to be improved. But right now we had to fix the build breakage.

http://lore.kernel.org/r/[email protected]
is added to my TODO list.
May take a stamp on this over xmas.

Sam