RE: [PATCH] drm/amdgpu: add missing error handling for amdgpu_ring_alloc()

2024-07-03 Thread Zhou, Bob
[AMD Official Use Only - AMD Internal Distribution Only] Hi Christian, In making the v2 version patch process, I check lots of cases for amdgpu_ring_alloc(). I think checking the return value maybe better. For allocating submission size from amdgpu_ring_alloc(), the action is allowed to fail so

[PATCH v1 4/4] drm/amdgpu: add gfx queue support for gfx12 ipdump

2024-07-03 Thread Sunil Khatri
Add support of all the CP GFX queues for gfx12 ipdump to be used by devcoredump. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 94 ++ 1 file changed, 94 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/am

[PATCH v1 0/4] GFX12 ipdump of gfx IP

2024-07-03 Thread Sunil Khatri
Validated on navi48 Sunil Khatri (4): drm/amdgpu: add gfx12 register support in ipdump drm/amdgpu: add print support for gfx12 ipdump drm/amdgpu: add cp queue registers for gfx12 ipdump drm/amdgpu: add gfx queue support for gfx12 ipdump drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 316 ++

[PATCH v1 3/4] drm/amdgpu: add cp queue registers for gfx12 ipdump

2024-07-03 Thread Sunil Khatri
Add gfx12 support of CP queue registers for all queues to be used by devcoredump. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 111 - 1 file changed, 109 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/driv

[PATCH v1 2/4] drm/amdgpu: add print support for gfx12 ipdump

2024-07-03 Thread Sunil Khatri
Add support of gfx12 ipdump print so devcoredump could trigger it to dump the captured registers in devcoredump. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/

[PATCH v1 1/4] drm/amdgpu: add gfx12 register support in ipdump

2024-07-03 Thread Sunil Khatri
Add general registers of gfx12 in ipdump for devcoredump support. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 101 + 1 file changed, 101 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0

RE: [PATCH 2/3] drm/dp_mst: Skip CSN if topology probing is not done yet

2024-07-03 Thread Lin, Wayne
[Public] > -Original Message- > From: Lyude Paul > Sent: Saturday, June 29, 2024 1:40 AM > To: Lin, Wayne ; amd-gfx@lists.freedesktop.org; dri- > de...@lists.freedesktop.org > Cc: jani.nik...@intel.com; imre.d...@intel.com; dan...@ffwll.ch; Wentland, > Harry ; Zuo, Jerry ; > sta...@vger.k

RE: [PATCH 2/4] drm/amdgpu: add ras POSION_CREATION event id support

2024-07-03 Thread Zhou1, Tao
[AMD Official Use Only - AMD Internal Distribution Only] > -Original Message- > From: Wang, Yang(Kevin) > Sent: Wednesday, July 3, 2024 1:52 PM > To: amd-gfx@lists.freedesktop.org > Cc: Zhang, Hawking ; Zhou1, Tao > > Subject: [PATCH 2/4] drm/amdgpu: add ras POSION_CREATION event id supp

RE: [PATCH 3/4] drm/amdgpu: add ras POSION_CONSUMPTION event id support

2024-07-03 Thread Zhou1, Tao
[AMD Official Use Only - AMD Internal Distribution Only] > -Original Message- > From: Wang, Yang(Kevin) > Sent: Wednesday, July 3, 2024 1:52 PM > To: amd-gfx@lists.freedesktop.org > Cc: Zhang, Hawking ; Zhou1, Tao > > Subject: [PATCH 3/4] drm/amdgpu: add ras POSION_CONSUMPTION event id >

Re: [PATCH v3 1/6] drm/radeon: change variable name "dev" to "ddev" for consistency

2024-07-03 Thread Thomas Zimmermann
Am 30.06.24 um 18:59 schrieb Wu Hoi Pok: In the probe function of amdgpu, it uses "ddev" as the name of "struct drm_device *", so I suggest renaming it to be consistent. Signed-off-by: Wu Hoi Pok Reviewed-by: Thomas Zimmermann Tested-by: Thomas Zimmermann --- drivers/gpu/drm/radeon/

[PATCH 1/2] drm/amdgpu: flush all cached ras bad pages to eeprom

2024-07-03 Thread YiPeng Chai
Before uninstalling gpu driver, flush all cached ras bad pages to eeprom. Signed-off-by: YiPeng Chai --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras

[PATCH 2/2] drm/amdgpu: timely save bad pages to eeprom after gpu ras reset is complete

2024-07-03 Thread YiPeng Chai
The problem case is as follows: 1. GPU A triggers a gpu ras reset, and GPU A drives GPU B to also perform a gpu ras reset. 2. After gpu B ras reset started, gpu B queried a DE data. Since the DE data was queried in the ras reset thread instead of the page retirement thread, bad page ret

Re: [PATCH v3 2/6] drm/radeon: remove load callback from kms_driver

2024-07-03 Thread Thomas Zimmermann
Am 30.06.24 um 18:59 schrieb Wu Hoi Pok: The ".load" callback in "struct drm_driver" is deprecated. In order to remove the callback, we have to manually call "radeon_driver_load_kms" instead. Signed-off-by: Wu Hoi Pok Acked-by: Thomas Zimmermann Tested-by: Thomas Zimmermann --- drive

Re: [PATCH v3 3/6] drm/radeon: use variable flags as parameter

2024-07-03 Thread Thomas Zimmermann
Am 30.06.24 um 18:59 schrieb Wu Hoi Pok: To be consistent with amdgpu driver, use "flags" as the parameter because it is already assigned as "ent->driver_data". Signed-off-by: Wu Hoi Pok Reviewed-by: Thomas Zimmermann Tested-by: Thomas Zimmermann --- drivers/gpu/drm/radeon/radeon_dr

Re: [PATCH v3 4/6] drm/radeon: add helper rdev_to_drm(rdev)

2024-07-03 Thread Thomas Zimmermann
Am 30.06.24 um 18:59 schrieb Wu Hoi Pok: Add helper rdev_to_drm(rdev), similar to amdgpu, most function should access the "drm_device" with "rdev_to_drm(rdev)" instead, where amdgpu has "adev_to_drm(adev)". It also makes changing from "*drm_device" to "drm_device" in "radeon_devicce" later on

RE: [PATCH 3/4] drm/amdgpu: add ras POSION_CONSUMPTION event id support

2024-07-03 Thread Wang, Yang(Kevin)
[AMD Official Use Only - AMD Internal Distribution Only] -Original Message- From: Zhou1, Tao Sent: Wednesday, July 3, 2024 4:28 PM To: Wang, Yang(Kevin) ; amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking Subject: RE: [PATCH 3/4] drm/amdgpu: add ras POSION_CONSUMPTION event id support [A

Re: [PATCH v3 5/6] drm/radeon: change rdev->ddev to rdev_to_drm(rdev)

2024-07-03 Thread Thomas Zimmermann
Am 30.06.24 um 18:59 schrieb Wu Hoi Pok: This patch changes the way "drm_device" is accessed. It uses "rdev_to_drm(rdev)" instead of accessing the struct member directly. Signed-off-by: Wu Hoi Pok Reviewed-by: Thomas Zimmermann Tested-by: Thomas Zimmermann --- drivers/gpu/drm/radeon

Re: [PATCH v3 6/6] drm/radeon: change drm_dev_alloc to devm_drm_dev_alloc

2024-07-03 Thread Thomas Zimmermann
Am 30.06.24 um 18:59 schrieb Wu Hoi Pok: "drm_dev_alloc" is deprecated, in order to use the newer "devm_drm_dev_alloc", the "drm_device" is stored inside "radeon_device", by changing "rdev_to_drm(rdev)" other functions still gain access to the member "drm_device". Also, "devm_drm_dev_alloc"

Re: [PATCH v3 0/6] drm/radeon: remove load callback & drm_dev_alloc

2024-07-03 Thread Thomas Zimmermann
Hi Am 30.06.24 um 18:59 schrieb Wu Hoi Pok: .load and drm_dev_alloc are deprecated. These patch series aims to remove them. v3: Both v1 and v2 sucks. v3 improves greatly on readability. Very nice, thank you. I tested the patches with Radeon hardware and did not find issues. AFAICT this can b

[PATCH] drm/amdgpu: : Fix the null pointer dereference for amdgpu_device_switch_gang

2024-07-03 Thread Bob Zhou
To avoid null pointer dereference reported by Coverity, so add null pointer check for the return of amdgpu_device_get_gang(). Signed-off-by: Bob Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdg

[PATCH 2/4] drm/amdgpu: add ras POSION_CREATION event id support

2024-07-03 Thread Yang Wang
add amdgpu ras POSION_CREATION event id support. Signed-off-by: Yang Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 17 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b

[PATCH v2] drm/amdgpu: refine amdgpu ras event id core code

2024-07-03 Thread Yang Wang
v1: - use unified event id to manage ras events - add a new function amdgpu_ras_query_error_status_with_event() to accept event type as parameter. v2: add a warn log to show the location of function failure when calling amdgpu_ras_mark_event(). (Tao Zhou) Signed-off-by: Yang Wang --- drivers/

[PATCH 3/4] drm/amdgpu: add ras POSION_CONSUMPTION event id support

2024-07-03 Thread Yang Wang
add amdgpu ras POSION_CONSUMPTION event id support. Signed-off-by: Yang Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 16 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 1 + drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c | 15 --- 3 files changed, 2

[PATCH 4/4] drm/amdgpu: add ras event state device attribute support

2024-07-03 Thread Yang Wang
add amdgpu ras 'event_state' sysfs device attribute support Signed-off-by: Yang Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 56 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 7 +++- 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/

Re: [PATCH] drm/amdgpu: add missing error handling for amdgpu_ring_alloc()

2024-07-03 Thread Christian König
Error handling is to resolve or at least mitigate problems caused by the user or the hardware. When the driver tries to allocate more than allowed from the ring then that's a driver bug and not something for error handling. So the error handling here doesn't seem to make sense in the first pl

Re: [PATCH] drm/amdgpu: : Fix the null pointer dereference for amdgpu_device_switch_gang

2024-07-03 Thread Christian König
Am 03.07.24 um 11:01 schrieb Bob Zhou: To avoid null pointer dereference reported by Coverity, so add null pointer check for the return of amdgpu_device_get_gang(). NAK, that's complete nonsense in the first place. The pointer is guaranteed to be never NULL or otherwise the logic would have c

RE: [PATCH] drm/amdgpu: : Fix the null pointer dereference for amdgpu_device_switch_gang

2024-07-03 Thread Zhou, Bob
[AMD Official Use Only - AMD Internal Distribution Only] Hi Christian Thanks for your comments. I miss the before logic has limited the generated pointer. Regards, Bob -Original Message- From: Koenig, Christian Sent: 2024年7月3日 17:26 To: Zhou, Bob ; amd-gfx@lists.freedesktop.org; Huang,

Re: [PATCH] drm/amdgpu: : Fix the null pointer dereference for amdgpu_device_switch_gang

2024-07-03 Thread Christian König
Well Coverity probably can't know that and will keep complaining. Maybe we can add some extra code to point out that old can never be NULL here? Regards, Christian. Am 03.07.24 um 13:06 schrieb Zhou, Bob: [AMD Official Use Only - AMD Internal Distribution Only] Hi Christian Thanks for your

Re: [PATCH v9 30/52] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2

2024-07-03 Thread Ville Syrjälä
On Tue, Jul 02, 2024 at 08:34:39PM -0600, jim.cro...@gmail.com wrote: > On Tue, Jul 2, 2024 at 5:33 PM Ville Syrjälä > wrote: > > > > On Tue, Jul 02, 2024 at 03:57:20PM -0600, Jim Cromie wrote: > > > dyndbg's CLASSMAP-v1 api was broken; DECLARE_DYNDBG_CLASSMAP tried to > > > do too much. Its repl

Re: [PATCH] drm/amdgpu: disallow multiple BO_HANDLES chunks in one submit

2024-07-03 Thread Pierre-Eric Pelloux-Prayer
Le 02/07/2024 à 15:35, Christian König a écrit : Am 02.07.24 um 15:23 schrieb Pierre-Eric Pelloux-Prayer: Before this commit, only submits with both a BO_HANDLES chunk and a 'bo_list_handle' would be rejected (by amdgpu_cs_parser_bos). But if UMD sent a multiple BO_HANDLES, what would happen

RE: [PATCH] drm/amdgpu/atomfirmware: silence UBSAN warning

2024-07-03 Thread SHANMUGAM, SRINIVASAN
[Public] Acked-by: Srinivasan Shanmugam -Original Message- From: amd-gfx On Behalf Of Alex Deucher Sent: Monday, July 1, 2024 10:25 PM To: amd-gfx@lists.freedesktop.org; jlay...@kernel.org Cc: Deucher, Alexander Subject: [PATCH] drm/amdgpu/atomfirmware: silence UBSAN warning This is a

[PATCH v9 29/52] drm: use correct ccflags-y spelling

2024-07-03 Thread Jim Cromie
Incorrectly spelled CFLAGS- failed to add -DDYNAMIC_DEBUG_MODULE, which broke builds with: CONFIG_DRM_USE_DYNAMIC_DEBUG=y CONFIG_DYNAMIC_DEBUG_CORE=y CONFIG_DYNAMIC_DEBUG=n Also add subdir-ccflags so that all drivers pick up the addition. Fixes: 84ec67288c10 ("drm_print: wrap drm_*_dbg in dyndbg

[PATCH v9 20/52] selftests-dyndbg: add comma_terminator_tests

2024-07-03 Thread Jim Cromie
New fn validates parsing and effect of queries using combinations of commas and spaces to delimit the tokens. It manipulates pr-debugs in builtin module/params, so might have deps I havent foreseen on odd configurations. Signed-off-by: Jim Cromie --- .../selftests/dynamic_debug/dyndbg_selftest.

[PATCH v9 09/52] dyndbg: reduce verbose/debug clutter

2024-07-03 Thread Jim Cromie
currently, for verbose=3, these are logged (blank lines for clarity): dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op='+' dyndbg: flags=0x1 dyndbg: *flagsp=0x1 *maskp=0x dyndbg: parsed: func="" file="" module="" format="

[PATCH v9 49/52] drm-dyndbg: add DRM_CLASSMAP_USE to the gud driver

2024-07-03 Thread Jim Cromie
The gud driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/gud/gud_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gud/gud_drv.c

[PATCH v9 43/52] drm-dyndbg: add DRM_CLASSMAP_USE to gma500 driver

2024-07-03 Thread Jim Cromie
The gma500 has 126 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/gma500/psb_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gma500/psb_drv

[PATCH v9 46/52] drm-dyndbg: add DRM_CLASSMAP_USE to vkms driver

2024-07-03 Thread Jim Cromie
The vkms driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/vkms/vkms_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_d

[PATCH v9 38/53] drm-print: workaround unused variable compiler meh

2024-07-03 Thread Jim Cromie
With CONFIG_DRM_USE_DYNAMIC_DEBUG=y, I'm getting an unused variable warning/error on 'category', though the usage follows immediately, in drm_debug_enabled(). This drops the local var and refs the field directly in the macro-call, which avoids the warning. For static-key optimized dyndbg, the mac

[PATCH v9 18/52] dyndbg-doc: add classmap info to howto

2024-07-03 Thread Jim Cromie
Describe the 3 API macros providing dynamic_debug's classmaps DYNDBG_CLASSMAP_DEFINE - create, exports a module's classmap DYNDBG_CLASSMAP_USE- refer to exported map DYNDBG_CLASSMAP_PARAM - bind control param to the classmap DYNDBG_CLASSMAP_PARAM_REF + use module's storage - __drm_debug cc:

[PATCH v9 00/53] fix CONFIG_DRM_USE_DYNAMIC_DEBUG=y

2024-07-03 Thread Jim Cromie
This fixes dynamic-debug support for DRM.debug, added via classmaps. commit bb2ff6c27bc9 (drm: Disable dynamic debug as broken) CONFIG_DRM_USE_DYNAMIC_DEBUG=y was marked broken because drm.debug=val was applied when drm.ko was modprobed; too early for the yet-to-load drivers, which thus missed the

[PATCH v9 50/53] drm-dyndbg: add DRM_CLASSMAP_USE to the gud driver

2024-07-03 Thread Jim Cromie
The gud driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/gud/gud_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gud/gud_drv.c

[PATCH v9 12/52] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap

2024-07-03 Thread Jim Cromie
old_bits arg is currently a pointer to the input bits, but this could allow inadvertent changes to the input by the fn. Disallow this. And constify new_bits while here. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-

[PATCH v9 17/52] dyndbg-API: promote DYNDBG_CLASSMAP_PARAM to API

2024-07-03 Thread Jim Cromie
move the DYNDBG_CLASSMAP_PARAM macro from test-dynamic-debug.c into the header, and refine it, by distinguishing the 2 use cases: 1.DYNDBG_CLASSMAP_PARAM_REF for DRM, to pass in extern __drm_debug by name. dyndbg keeps bits in it, so drm can still use it as before 2.DYNDBG_CLASSMAP_PARAM

[PATCH v9 06/52] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it

2024-07-03 Thread Jim Cromie
Add param: query_module to ddebug_apply_class_bitmap(), and pass it thru to _ddebug_queries(), replacing NULL with query_module. This allows its caller to update just one module, or all (as currently). We'll use this later to propagate drm.debug to each USEr as they're modprobed. No functional c

[PATCH v9 23/52] docs/dyndbg: explain new delimiters: comma, percent

2024-07-03 Thread Jim Cromie
Add mention of comma and percent delimiters into the respective paragraphs describing their equivalents: space and newline. Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst| 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Documen

[PATCH v9 50/52] drm-dyndbg: add DRM_CLASSMAP_USE to the qxl driver

2024-07-03 Thread Jim Cromie
The qxl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/qxl/qxl_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c

[PATCH v9 30/52] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2

2024-07-03 Thread Jim Cromie
dyndbg's CLASSMAP-v1 api was broken; DECLARE_DYNDBG_CLASSMAP tried to do too much. Its replaced by DRM_CLASSMAP_DEFINE, which creates & EXPORTs the classmap when CONFIG_DRM_USE_DYNAMIC_DEBUG=y, for direct reference by drivers. The drivers still use DECLARE_DYNDBG_CLASSMAP for now, so they still r

[PATCH v9 25/52] dyndbg-doc: explain flags parse 1st

2024-07-03 Thread Jim Cromie
When writing queries to >control, flags are parsed 1st, since they are the only required field. So if the flags draw an error, then keyword errors aren't reported. This can be mildly confusing/annoying, so explain it instead. This note could be moved up to just after the grammar id's the flags,

[PATCH v9 51/52] drm-dyndbg: add DRM_CLASSMAP_USE to the drm_gem_shmem_helper driver

2024-07-03 Thread Jim Cromie
The drm_gem_shmem_helper driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/driv

Re: High Power Consumption of AMD RX6800xt in Idle with Secondary Monitor Connected

2024-07-03 Thread Jaroslav Pulchart
Yes, I can try two panels of the same model. The results are: LG 32UL950 + LG 27UL850 => "MCLK constant boost" (issue) LG 27UL950 + LG 27UL850 => "MCLK is scaling down" (no-issue) > > [AMD Official Use Only - AMD Internal Distribution Only] > > > yeah, there timings look the same, but could you t

[PATCH v9 40/53] drm-dyndbg: add DRM_CLASSMAP_USE to virtio_gpu

2024-07-03 Thread Jim Cromie
virtio_gpu has 10 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/v

[PATCH v9 15/52] dyndbg-API: fix DECLARE_DYNDBG_CLASSMAP

2024-07-03 Thread Jim Cromie
DECLARE_DYNDBG_CLASSMAP() has a design error; its usage fails a basic K&R rule: "define once, refer many times". It is used across DRM core & drivers, each use re-defines the classmap understood by that module; and all must match for the modules to respond together when DRM.debug categories are en

[PATCH v9 47/52] drm-dyndbg: add DRM_CLASSMAP_USE to udl driver

2024-07-03 Thread Jim Cromie
The udl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/udl/udl_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/udl/udl_main.

[PATCH v9 19/52] dyndbg: treat comma as a token separator

2024-07-03 Thread Jim Cromie
Treat comma as a token terminator, just like a space. This allows a user to avoid quoting hassles when spaces are otherwise needed: :#> modprobe drm dyndbg=class,DRM_UT_CORE,+p\;class,DRM_UT_KMS,+p or as a boot arg: drm.dyndbg=class,DRM_UT_CORE,+p # todo: support multi-query here Given the

[PATCH v9 08/52] dyndbg: drop NUM_TYPE_ARRAY

2024-07-03 Thread Jim Cromie
ARRAY_SIZE works here, since array decl is complete. no functional change Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b53217e4b711..8116d0a0

[PATCH v9 16/52] selftests-dyndbg: add tools/testing/selftests/dynamic_debug/*

2024-07-03 Thread Jim Cromie
Add a selftest script for dynamic-debug. The config requires CONFIG_TEST_DYNAMIC_DEBUG=m (and CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m), which tacitly requires either CONFIG_DYNAMIC_DEBUG=y or CONFIG_DYNAMIC_DEBUG_CORE=y ATM this has just basic_tests(), it modifies pr_debug flags in a few builtins (ini

[PATCH v9 03/52] dyndbg: reword "class unknown, " to "class:_UNKNOWN_"

2024-07-03 Thread Jim Cromie
When a dyndbg classname is unknown to a kernel module (as before previous patch), the callsite is un-addressable via >control queries. The control-file displays this condition as "class unknown," currently. That spelling is sub-optimal/too-generic, so change it to "class:_UNKNOWN_" to loudly anno

[PATCH v9 31/52] drm-dyndbg: adapt DRM to invoke DYNDBG_CLASSMAP_PARAM

2024-07-03 Thread Jim Cromie
Invoke DYNDBG_CLASSMAP_PARAM to hook drm.debug (__drm_debug) to the DRM_UT_* classmap, replacing the ad-hoc wiring previously doing it. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 8 ++-- include/drm/drm_print.h | 6 -- 2 files changed, 6 insertions(+), 8 deletions(-)

[PATCH v9 47/53] drm-dyndbg: add DRM_CLASSMAP_USE to vkms driver

2024-07-03 Thread Jim Cromie
The vkms driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/vkms/vkms_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_d

[PATCH v9 42/53] drm-dyndbg: add DRM_CLASSMAP_USE to bochs

2024-07-03 Thread Jim Cromie
tiny/bochs has 5 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/tiny/bochs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tiny/bochs.c b/drive

[PATCH v9 39/53] drm-dyndbg: add DRM_CLASSMAP_USE to Xe driver

2024-07-03 Thread Jim Cromie
Invoke DRM_CLASSMAP_USE from xe_drm_client.c. When built with CONFIG_DRM_USE_DYNAMIC_DEBUG=y, this tells dydnbg that Xe uses has drm.debug calls. Signed-off-by: Jim Cromie --- drivers/gpu/drm/xe/xe_drm_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_drm_clie

[PATCH v9 07/52] dyndbg: split param_set_dyndbg_classes to _module & wrapper fns

2024-07-03 Thread Jim Cromie
Split api-fn: param_set_dyndbg_classes(), adding modname param and passing NULL in from api-fn. The new arg allows caller to specify that only one module is affected by a prdbgs update. This selectivity will be used later to narrow the scope of changes made. no functional change. Signed-off-by:

[PATCH v9 46/53] drm-dyndbg: add DRM_CLASSMAP_USE to vmwgfx driver

2024-07-03 Thread Jim Cromie
The vmwgfx driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vmwgf

[PATCH v9 01/52] docs/dyndbg: update examples \012 to \n

2024-07-03 Thread Jim Cromie
commit 47ea6f99d06e ("dyndbg: use ESCAPE_SPACE for cat control") changed the control-file to display format strings with "\n" rather than "\012". Update the docs to match the new reality. Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 +- 1 file ch

Re: [PATCH v9 32/53] DRM-CLASSMAP-USE in drm-drv.c

2024-07-03 Thread jim . cromie
On Tue, Jul 2, 2024 at 3:58 PM Jim Cromie wrote: > > --- > drivers/gpu/drm/drm_drv.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c > index 243cacb3575c..f511d40f577a 100644 > --- a/drivers/gpu/drm/drm_drv.c > +++ b/drivers/gpu/dr

[PATCH v9 28/52] dyndbg-selftest: reduce default verbosity

2024-07-03 Thread Jim Cromie
Remove the '-v' arg from the tests in test_mod_submod(). Setting V=1 in the environment turns it back on, for all tests. Signed-off-by: Jim Cromie --- .../dynamic_debug/dyndbg_selftest.sh | 23 +-- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tools/tes

[PATCH v9 02/52] test-dyndbg: fixup CLASSMAP usage error

2024-07-03 Thread Jim Cromie
A more careful reading of logging output from test_dynamic_debug.ko reveals: lib/test_dynamic_debug.c:103 [test_dynamic_debug]do_cats =pmf "doing categories\n" lib/test_dynamic_debug.c:105 [test_dynamic_debug]do_cats =p "LOW msg\n" class:MID lib/test_dynamic_debug.c:106 [test_dynamic_debug]do_ca

[PATCH v9 51/53] drm-dyndbg: add DRM_CLASSMAP_USE to the qxl driver

2024-07-03 Thread Jim Cromie
The qxl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/qxl/qxl_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c

[PATCH v9 04/52] dyndbg: make ddebug_class_param union members same size

2024-07-03 Thread Jim Cromie
struct ddebug_class_param keeps a ref to the state-storage of the param; make both class-types use the same unsigned long storage type. ISTM this is simpler and safer; it avoids an irrelevant difference, and if 2 users somehow get class-type mixed up (or refer to the wrong union member), at least

[PATCH v9 24/52] selftests-dyndbg: add test_mod_submod

2024-07-03 Thread Jim Cromie
This new test-fn runs 3 module/submodule modprobe scenarios, variously using both the generic dyndbg= modprobe arg, and the test-module's classmap-params to manipulate the test-mod*'s pr_debugs. In all cases, the current flag-settings are counted and tested vs expectations. The 3rd scenario recapi

Re: [PATCH v9 00/53] fix CONFIG_DRM_USE_DYNAMIC_DEBUG=y

2024-07-03 Thread jim . cromie
On Tue, Jul 2, 2024 at 4:01 PM Luis Chamberlain wrote: > > On Tue, Jul 02, 2024 at 03:56:50PM -0600, Jim Cromie wrote: > > This fixes dynamic-debug support for DRM.debug, added via classmaps. > > commit bb2ff6c27bc9 (drm: Disable dynamic debug as broken) > > > > CONFIG_DRM_USE_DYNAMIC_DEBUG=y was

[PATCH v9 49/53] drm-dyndbg: add DRM_CLASSMAP_USE to mgag200 driver

2024-07-03 Thread Jim Cromie
The mgag200 driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/mgag200/mgag200_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/mg

[PATCH v9 38/52] drm-dyndbg: add DRM_CLASSMAP_USE to Xe driver

2024-07-03 Thread Jim Cromie
Invoke DRM_CLASSMAP_USE from xe_drm_client.c. When built with CONFIG_DRM_USE_DYNAMIC_DEBUG=y, this tells dydnbg that Xe uses has drm.debug calls. Signed-off-by: Jim Cromie --- drivers/gpu/drm/xe/xe_drm_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_drm_clie

[PATCH v9 35/52] drm-dyndbg: DRM_CLASSMAP_USE in drm_dp_helper

2024-07-03 Thread Jim Cromie
Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f

Re: [PATCH v9 30/52] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2

2024-07-03 Thread jim . cromie
On Tue, Jul 2, 2024 at 5:33 PM Ville Syrjälä wrote: > > On Tue, Jul 02, 2024 at 03:57:20PM -0600, Jim Cromie wrote: > > dyndbg's CLASSMAP-v1 api was broken; DECLARE_DYNDBG_CLASSMAP tried to > > do too much. Its replaced by DRM_CLASSMAP_DEFINE, which creates & > > EXPORTs the classmap when CONFIG_

[PATCH v9 48/53] drm-dyndbg: add DRM_CLASSMAP_USE to udl driver

2024-07-03 Thread Jim Cromie
The udl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/udl/udl_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/udl/udl_main.

[PATCH v9 52/52] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN

2024-07-03 Thread Jim Cromie
end of official submission. Time for some quality CI Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 5a0c476361c3..b2ea73ae48f0 100644 --- a/drivers/gpu/drm/Kconfi

[PATCH v9 36/53] drm-dyndbg: DRM_CLASSMAP_USE in drm_dp_helper

2024-07-03 Thread Jim Cromie
Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f

[PATCH v9 53/53] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN

2024-07-03 Thread Jim Cromie
end of official submission. Time for some quality CI Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 5a0c476361c3..b2ea73ae48f0 100644 --- a/drivers/gpu/drm/Kconfi

[PATCH v9 36/52] drm-dyndbg: DRM_CLASSMAP_USE in nouveau

2024-07-03 Thread Jim Cromie
Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f

[PATCH v9 45/53] drm-dyndbg: add DRM_CLASSMAP_USE to radeon

2024-07-03 Thread Jim Cromie
radeon has some DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg about its use of the class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/radeon/radeon_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon

[PATCH v9 37/53] drm-dyndbg: DRM_CLASSMAP_USE in nouveau

2024-07-03 Thread Jim Cromie
Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f

[PATCH v9 39/52] drm-dyndbg: add DRM_CLASSMAP_USE to virtio_gpu

2024-07-03 Thread Jim Cromie
virtio_gpu has 10 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/v

[PATCH v9 32/53] DRM-CLASSMAP-USE in drm-drv.c

2024-07-03 Thread Jim Cromie
--- drivers/gpu/drm/drm_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 243cacb3575c..f511d40f577a 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -56,6 +56,9 @@ MODULE_LICENSE("GPL and additional ri

[PATCH v9 33/53] drm-dyndbg: DRM_CLASSMAP_USE in amdgpu driver

2024-07-03 Thread Jim Cromie
Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f

[PATCH v9 11/52] dyndbg: tighten ddebug_class_name() 1st arg type

2024-07-03 Thread Jim Cromie
Change function's 1st arg-type, and deref in the caller. The fn doesn't need any other fields in the struct. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_d

[PATCH v9 35/53] drm-dyndbg: DRM_CLASSMAP_USE in drm_crtc_helper

2024-07-03 Thread Jim Cromie
Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f

[PATCH v9 05/52] dyndbg: replace classmap list with a vector

2024-07-03 Thread Jim Cromie
Classmaps are stored in an elf section/array, but are individually list-linked onto dyndbg's per-module ddebug_table for operation. This is unnecessary; even when ddebug_attach_classmap() is handling the builtin section (with classmaps for multiple builtin modules), its contents are ordered, so a

[PATCH v9 44/53] drm-dyndbg: add DRM_CLASSMAP_USE to gma500 driver

2024-07-03 Thread Jim Cromie
The gma500 has 126 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/gma500/psb_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gma500/psb_drv

[PATCH v9 14/52] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code

2024-07-03 Thread Jim Cromie
Remove the NAMED class types; these 2 classmap types accept class names at the PARAM interface, for example: echo +DRM_UT_CORE,-DRM_UT_KMS > /sys/module/drm/parameters/debug_names The code works, but its only used by test-dynamic-debug, and wasn't asked for by anyone else, so reduce test-surfac

[PATCH v9 41/53] drm-dyndbg: add DRM_CLASSMAP_USE to simpledrm

2024-07-03 Thread Jim Cromie
tiny/simpledrm has 3 DRM_UT_DRIVER debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/tiny/simpledrm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tiny/si

[PATCH v9 26/52] dyndbg: change __dynamic_func_call_cls* macros into expressions

2024-07-03 Thread Jim Cromie
The Xe driver's XE_IOCTL_DBG macro calls drm_dbg() from inside an if (expression). This breaks when CONFIG_DRM_USE_DYNAMIC_DEBUG=y because the invoked macro has a do-while-0 wrapper. if (cond && (drm_dbg("expr-form"),1)) { ... do some more stuff } Fix it by changing __dynamic_func_ca

[PATCH v9 32/52] drm-dyndbg: DRM_CLASSMAP_USE in amdgpu driver

2024-07-03 Thread Jim Cromie
Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f

[PATCH v9 10/52] dyndbg: silence debugs with no-change updates

2024-07-03 Thread Jim Cromie
In ddebug_apply_class_bitmap(), check for actual changes to the bits before announcing them, to declutter logs. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dyna

[PATCH v9 27/52] selftests-dyndbg: check KCONFIG_CONFIG to avoid silly fails

2024-07-03 Thread Jim Cromie
Several tests are dependent upon config choices. Lets avoid failing where that is noise. The KCONFIG_CONFIG var exists to convey the config-file around. If the var names a file, read it and extract the relevant CONFIG items, and use them to skip the dependent tests, thus avoiding the fails that w

[PATCH v9 22/52] selftests-dyndbg: test_percent_splitting

2024-07-03 Thread Jim Cromie
This does basic testing of classmaps using '%' separated multi-queries. It modprobes test_dynamic_debug with several classes enabled, and counts to verify that the expected sites show the enablement in the control file. Signed-off-by: Jim Cromie --- .../dynamic_debug/dyndbg_selftest.sh

[PATCH v9 21/52] dyndbg: split multi-query strings with %

2024-07-03 Thread Jim Cromie
Since commit 85f7f6c0edb8 ("dynamic_debug: process multiple debug-queries on a line") Multi-query commands have been allowed: modprobe drm dyndbg="class DRM_UT_CORE +p; class DRM_UT_KMS +p" modprobe drm dyndbg=< [ 203.902703] dyndbg: query parse failed [ 203.902871] dyndbg: processed 2 quer

[PATCH v9 41/52] drm-dyndbg: add DRM_CLASSMAP_USE to bochs

2024-07-03 Thread Jim Cromie
tiny/bochs has 5 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/tiny/bochs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tiny/bochs.c b/drive

[PATCH v9 37/52] drm-print: workaround unused variable compiler meh

2024-07-03 Thread Jim Cromie
With CONFIG_DRM_USE_DYNAMIC_DEBUG=y, I'm getting an unused variable warning/error on 'category', though the usage follows immediately, in drm_debug_enabled(). This drops the local var and refs the field directly in the macro-call, which avoids the warning. For static-key optimized dyndbg, the mac

[PATCH v9 34/52] drm-dyndbg: DRM_CLASSMAP_USE in drm_crtc_helper

2024-07-03 Thread Jim Cromie
Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f

  1   2   >