Skip to content

Commit 5f8600b

Browse files
Maciej Falkowskijlawryno
authored andcommitted
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
1 parent 7df06ef commit 5f8600b

5 files changed

Lines changed: 17 additions & 0 deletions

File tree

drivers/accel/ivpu/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ config DRM_ACCEL_IVPU
1616
and Deep Learning applications.
1717

1818
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.

drivers/accel/ivpu/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ intel_vpu-$(CONFIG_DEV_COREDUMP) += ivpu_coredump.o
2424

2525
obj-$(CONFIG_DRM_ACCEL_IVPU) += intel_vpu.o
2626

27+
subdir-ccflags-$(CONFIG_DRM_ACCEL_IVPU_DEBUG) += -DDEBUG
28+
2729
CFLAGS_ivpu_trace_points.o = -I$(src)

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ module_param_named(dbg_mask, ivpu_dbg_mask, int, 0644);
4343
MODULE_PARM_DESC(dbg_mask, "Driver debug mask. See IVPU_DBG_* macros.");
4444

4545
int ivpu_test_mode;
46+
#if IS_ENABLED(CONFIG_DRM_ACCEL_IVPU_DEBUG)
4647
module_param_named_unsafe(test_mode, ivpu_test_mode, int, 0644);
4748
MODULE_PARM_DESC(test_mode, "Test mode mask. See IVPU_TEST_MODE_* macros.");
49+
#endif
4850

4951
u8 ivpu_pll_min_ratio;
5052
module_param_named(pll_min_ratio, ivpu_pll_min_ratio, byte, 0644);

drivers/accel/ivpu/ivpu_fw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@
4646
#define IVPU_FOCUS_PRESENT_TIMER_MS 1000
4747

4848
static char *ivpu_firmware;
49+
#if IS_ENABLED(CONFIG_DRM_ACCEL_IVPU_DEBUG)
4950
module_param_named_unsafe(firmware, ivpu_firmware, charp, 0644);
5051
MODULE_PARM_DESC(firmware, "NPU firmware binary in /lib/firmware/..");
52+
#endif
5153

5254
static struct {
5355
int gen;

drivers/accel/ivpu/ivpu_pm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
#include "vpu_boot_api.h"
2525

2626
static bool ivpu_disable_recovery;
27+
#if IS_ENABLED(CONFIG_DRM_ACCEL_IVPU_DEBUG)
2728
module_param_named_unsafe(disable_recovery, ivpu_disable_recovery, bool, 0644);
2829
MODULE_PARM_DESC(disable_recovery, "Disables recovery when NPU hang is detected");
30+
#endif
2931

3032
static unsigned long ivpu_tdr_timeout_ms;
3133
module_param_named(tdr_timeout_ms, ivpu_tdr_timeout_ms, ulong, 0644);

0 commit comments

Comments
 (0)