Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

accel/ivpu: Add debug Kconfig option

Add CONFIG_DRM_ACCEL_IVPU_DEBUG option that:
- Adds -DDEBUG that enables printk regardless of the kernel config
- Enables unsafe module params (that are now disabled by default)

Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-10-jacek.lawrynowicz@linux.intel.com

authored by

Maciej Falkowski and committed by
Jacek Lawrynowicz
5f8600b9 7df06efe

+17
+9
drivers/accel/ivpu/Kconfig
··· 16 16 and Deep Learning applications. 17 17 18 18 If "M" is selected, the module will be called intel_vpu. 19 + 20 + config DRM_ACCEL_IVPU_DEBUG 21 + bool "Intel NPU debug mode" 22 + depends on DRM_ACCEL_IVPU 23 + help 24 + Choose this option to enable additional 25 + debug features for the Intel NPU driver: 26 + - Always print debug messages regardless of dyndbg config, 27 + - Enable unsafe module params.
+2
drivers/accel/ivpu/Makefile
··· 24 24 25 25 obj-$(CONFIG_DRM_ACCEL_IVPU) += intel_vpu.o 26 26 27 + subdir-ccflags-$(CONFIG_DRM_ACCEL_IVPU_DEBUG) += -DDEBUG 28 + 27 29 CFLAGS_ivpu_trace_points.o = -I$(src)
+2
drivers/accel/ivpu/ivpu_drv.c
··· 43 43 MODULE_PARM_DESC(dbg_mask, "Driver debug mask. See IVPU_DBG_* macros."); 44 44 45 45 int ivpu_test_mode; 46 + #if IS_ENABLED(CONFIG_DRM_ACCEL_IVPU_DEBUG) 46 47 module_param_named_unsafe(test_mode, ivpu_test_mode, int, 0644); 47 48 MODULE_PARM_DESC(test_mode, "Test mode mask. See IVPU_TEST_MODE_* macros."); 49 + #endif 48 50 49 51 u8 ivpu_pll_min_ratio; 50 52 module_param_named(pll_min_ratio, ivpu_pll_min_ratio, byte, 0644);
+2
drivers/accel/ivpu/ivpu_fw.c
··· 46 46 #define IVPU_FOCUS_PRESENT_TIMER_MS 1000 47 47 48 48 static char *ivpu_firmware; 49 + #if IS_ENABLED(CONFIG_DRM_ACCEL_IVPU_DEBUG) 49 50 module_param_named_unsafe(firmware, ivpu_firmware, charp, 0644); 50 51 MODULE_PARM_DESC(firmware, "NPU firmware binary in /lib/firmware/.."); 52 + #endif 51 53 52 54 static struct { 53 55 int gen;
+2
drivers/accel/ivpu/ivpu_pm.c
··· 24 24 #include "vpu_boot_api.h" 25 25 26 26 static bool ivpu_disable_recovery; 27 + #if IS_ENABLED(CONFIG_DRM_ACCEL_IVPU_DEBUG) 27 28 module_param_named_unsafe(disable_recovery, ivpu_disable_recovery, bool, 0644); 28 29 MODULE_PARM_DESC(disable_recovery, "Disables recovery when NPU hang is detected"); 30 + #endif 29 31 30 32 static unsigned long ivpu_tdr_timeout_ms; 31 33 module_param_named(tdr_timeout_ms, ivpu_tdr_timeout_ms, ulong, 0644);