Skip to contentSkip to conversation

drm: Add stackdepot include for DRM_DEBUG_MM

PATCH In review Chris Wilson 3 participants 6 messages Nov 8, 2016

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

PATCH 1/1 drm: Add stackdepot include for DRM_DEBUG_MM

0day found that stackdepot.h doesn't get automatically included on all architectures, so remember to add our #include.

Fixes 5705670d0463 ("drm: Track drm_mm allocators and show leaks on shutdown")
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_mm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_mm.c +2 -0
index 89b891a4847f..632473beb40c 100644
@@ -105,6 +105,8 @@ static struct drm_mm_node *drm_mm_search_free_in_range_generic(const struct drm_
 						enum drm_mm_search_flags flags);
 
 #ifdef CONFIG_DRM_DEBUG_MM
+#include <linux/stackdepot.h>
+
 #define STACKDEPTH 32
 #define BUFSZ 4096
 
Signature · 6 lines
2.10.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Am 08.11.2016 um 12:56 schrieb Chris Wilson:

Quoted 7 lines

0day found that stackdepot.h doesn't get automatically included on all architectures, so remember to add our #include.

Fixes 5705670d0463 ("drm: Track drm_mm allocators and show leaks on shutdown")
Cc Daniel Vetter <[email protected]>
Quoted 9 lines
---
  drivers/gpu/drm/drm_mm.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_mm.c +0 -0
index 89b891a4847f..632473beb40c 100644

drivers/gpu/drm/drm_mm.c static struct drm_mm_node *drm_mm_search_free_in_range_generic(const struct drm_ · line 112

Quoted 8 lines
drivers/gpu/drm/drm_mm.c +2 -0
@@ -105,6 +105,8 @@ static struct drm_mm_node *drm_mm_search_free_in_range_generic(const struct drm_
  						enum drm_mm_search_flags flags);
 
  #ifdef CONFIG_DRM_DEBUG_MM
+#include <linux/stackdepot.h>
+
  #define STACKDEPTH 32
  #define BUFSZ 4096
 

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

#2 lore raw
In reply to Chris Wilson
Quoted 7 lines · Chris Wilson

0day found that stackdepot.h doesn't get automatically included on all architectures, so remember to add our #include.

Fixes 5705670d0463 ("drm: Track drm_mm allocators and show leaks on shutdown")
Cc Daniel Vetter <[email protected]>

Thx for the fast fixup, applied to drm-misc.
-Daniel

Quoted 20 lines
---
 drivers/gpu/drm/drm_mm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_mm.c +2 -0
index 89b891a4847f..632473beb40c 100644
@@ -105,6 +105,8 @@ static struct drm_mm_node *drm_mm_search_free_in_range_generic(const struct drm_
 						enum drm_mm_search_flags flags);
 
 #ifdef CONFIG_DRM_DEBUG_MM
+#include <linux/stackdepot.h>
+
 #define STACKDEPTH 32
 #define BUFSZ 4096
 
Signature · 1 line
2.10.2
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
Quoted 10 lines · Daniel Vetter
Quoted 7 lines · Chris Wilson

0day found that stackdepot.h doesn't get automatically included on all architectures, so remember to add our #include.

Fixes 5705670d0463 ("drm: Track drm_mm allocators and show leaks on shutdown")
Cc Daniel Vetter <[email protected]>

Thx for the fast fixup, applied to drm-misc.

And I misread the kbuild result. Apparently we all build drm.ko as a builtin and kbuild doesn't.

depot_save_stack is not exported :(

Is

- depends on DRM
+ depends on DRM=y

a good temporary? Will have to munge i915 similarly. :( -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 1/2 drm/i915: Restrict DRM_DEBUG_MM automatic selection

DRM_DEBUG_MM is only valid if the DRM.ko is builtin as currently depot_save_stack is not exported.

Fixes 5c7fcf2db027 ("drm/i915: Enable drm_mm debug when enabling DRM_I915_DEBUG")
---
 drivers/gpu/drm/i915/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/Kconfig.debug +1 -1
index 69edf196ed03..51ba630a134b 100644
@@ -21,7 +21,7 @@ config DRM_I915_DEBUG
         select PREEMPT_COUNT
         select X86_MSR # used by igt/pm_rpm
         select DRM_VGEM # used by igt/prime_vgem (dmabuf interop checks)
-        select DRM_DEBUG_MM
+        select DRM_DEBUG_MM if DRM=y
         default n
         help
           Choose this option to turn on extra driver debugging that may affect
Signature · 6 lines
2.10.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

PATCH 2/2 drm: Restrict stackdepot usage to builtin drm.ko

I misread the kbuild result thinking that we had missed the include (which we had for completeness anyway), what kbuild was actually warning me about was that depot_save_stack was not exported.

Temporarily fix this by only selecting STACKDEPOT iff drm.ko is builtin

Fixes 5705670d0463 ("drm: Track drm_mm allocators and show leaks on shutdown")
---
 drivers/gpu/drm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/Kconfig +1 -1
index 25e8e3793d29..d6ee0592b625 100644
@@ -36,7 +36,7 @@ config DRM_DP_AUX_CHARDEV
 config DRM_DEBUG_MM
 	bool "Insert extra checks and debug info into the DRM range managers"
 	default n
-	depends on DRM
+	depends on DRM=y
 	select STACKDEPOT
 	help
 	  Enable allocation tracking of memory manager and leak detection on
Signature · 6 lines
2.10.2

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