with DRM_USE_DYNAMIC_DEBUG=y now un-BROKEN
for configs like:
CONFIG_DRM_USE_DYNAMIC_DEBUG=y
# CONFIG_DYNAMIC_DEBUG is not set
CONFIG_DYNAMIC_DEBUG_CORE=y
this module gets macro breakage:
from ../drivers/accel/amdxdna/aie2_ctx.c:8:
../drivers/accel/amdxdna/aie2_ctx.c: In function ‘aie2_hwctx_restart’:
../include/drm/drm_print.h:578:9: error: implicit declaration of function
‘_dynamic_func_call_cls’ [-Wimplicit-function-declaration]
578 | _dynamic_func_call_cls(cat, fmt, __drm_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~~~~~
../include/drm/drm_print.h:663:9: note: in expansion of macro ‘drm_dev_dbg’
663 | drm_dev_dbg(__drm_to_dev(drm), DRM_UT_DRIVER, fmt,
##__VA_ARGS__)
| ^~~~~~~~~~~
../include/drm/drm_print.h:681:33: note: in expansion of macro ‘drm_dbg_driver’
681 | #define drm_dbg(drm, fmt, ...) drm_dbg_driver(drm, fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~
../drivers/accel/amdxdna/amdxdna_pci_drv.h:15:41: note: in expansion of macro
‘drm_dbg’
15 | #define XDNA_DBG(xdna, fmt, args...) drm_dbg(&(xdna)->ddev, fmt,
##args)
| ^~~~~~~
../drivers/accel/amdxdna/aie2_ctx.c:76:17: note: in expansion of macro
‘XDNA_DBG’
76 | XDNA_DBG(xdna, "hwctx is not ready, status %d",
hwctx->status);
| ^~~~~~~~
These sources include drm_print.h, which includes dynamic_debug.h and
then checks DRM_USE_DYNAMIC_DEBUG, to decide if drm_dbg() rides on
dynamic-debug underneath.
DRM_USE_DYNAMIC_DEBUG is possible with DYNAMIC_DEBUG_CORE alone, but
dynamic_debug.h also requires DYNAMIC_DEBUG_MODULE before defining
those macros above.
drm/Makefile adds this to cflags on behalf of all drivers, do so for
this driver. TBC: do subdir-cflags in drivers/accel/Makefile instead,
for all accel/* modules.
RFC: Maybe decouple from DRM, at least the DRM_USE_DYNAMIC_DEBUG
itself (ie just CONFIG_DYNAMIC_DEBUG_CORE). Its not obvious that
XDNA_DBG should be categorized with DRM_UT_DRIVER by default.
Do we need a new DRM_UT_ACCEL category ?
Reported-by: kernel test robot <[email protected]>
Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/
CC: Jason Baron <[email protected]>
CC: Min Ma <[email protected]>
CC: Lizhi Hou <[email protected]>
CC: Oded Gabbay <[email protected]>
CC: [email protected]
CC: Maarten Lankhorst <[email protected]>
CC: Maxime Ripard <[email protected]>
CC: Thomas Zimmermann <[email protected]>
CC: David Airlie <[email protected]>
CC: Simona Vetter <[email protected]>
Signed-off-by: Jim Cromie <[email protected]>
---
drivers/accel/amdxdna/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/accel/amdxdna/Makefile b/drivers/accel/amdxdna/Makefile
index 0e9adf6890a01..800f81f5a7023 100644
--- a/drivers/accel/amdxdna/Makefile
+++ b/drivers/accel/amdxdna/Makefile
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
+ccflags-$(CONFIG_DYNAMIC_DEBUG_CORE) += -DDYNAMIC_DEBUG_MODULE
+
amdxdna-y := \
aie2_ctx.o \
aie2_error.o \
--
2.50.1