Re: [Re] kernel panic during shutdown in next-20260722

From: Bert Karwatzki

Date: Sun Jul 26 2026 - 18:52:57 EST


Am Sonntag, dem 26.07.2026 um 20:47 +0200 schrieb Bert Karwatzki:
> Am Sonntag, dem 26.07.2026 um 01:16 +0200 schrieb Bert Karwatzki:
>
>
> Now I've run a test with
> commit 8bf0cb97edb ("drm/amd/display: Move dml2_destroy to non-FPU compilation unit")
> with the following debugging patch:
>

As I had no better idea I started throwing printk()s into the general
direction of the bug, and found this after some attempts:


/*******************************************************************************
* Public functions
******************************************************************************/
struct dc_plane_state *dc_create_plane_state(const struct dc *dc)
{
printk(KERN_INFO "%s %d: preempt_count = %d\n", __func__, __LINE__, preempt_count());
struct dc_plane_state *plane_state = kvzalloc_obj(*plane_state,
GFP_ATOMIC);
printk(KERN_INFO "%s %d\n", __func__, __LINE__);

if (NULL == plane_state)
return NULL;

kref_init(&plane_state->refcount);
dc_plane_construct(dc->ctx, plane_state);

return plane_state;
}

In the error case this prints "preempt_count = 2"! (only if dc_create_plane_state()
is called from dc_state_create_phantom_plane()).

If I combine this with the "solution" from above

diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
index cb93bfbe9e9e..7a90098ec118 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
@@ -1693,11 +1693,9 @@ enum dc_status dcn401_validate_bandwidth(struct dc *dc,
}

if (dc->debug.using_dml2) {
- DC_FP_START();
status = dml2_validate(dc, context,
context->power_source == DC_POWER_SOURCE_DC ? context->bw_ctx.dml2_dc_power_source : context->bw_ctx.dml2,
validate_mode) ? DC_OK : DC_FAIL_BANDWIDTH_VALIDATE;
- DC_FP_END();
}

if (validate_mode == DC_VALIDATE_MODE_AND_PROGRAMMING && status == DC_OK && dc_state_is_subvp_in_use(context)) {
@@ -1718,11 +1716,9 @@ enum dc_status dcn401_validate_bandwidth(struct dc *dc,
if (validate_mode == DC_VALIDATE_MODE_AND_PROGRAMMING && status == DC_FAIL_HW_CURSOR_SUPPORT) {
/* attempt to validate again with subvp disabled due to cursor */
if (dc->debug.using_dml2) {
- DC_FP_START();
status = dml2_validate(dc, context,
context->power_source == DC_POWER_SOURCE_DC ? context->bw_ctx.dml2_dc_power_source : context->bw_ctx.dml2,
validate_mode) ? DC_OK : DC_FAIL_BANDWIDTH_VALIDATE;
- DC_FP_END();
}
}

I get in all cases "preempt_count = 0" again.

I also monitored the preempt_count with this patch applied
on top of commit
02c3060ee303 ("drm/amdgpu: add support to query vram info from firmware")
(this is the last commit before the problematic patchset
32c1c35b6d8b drm/amd/display: Move FPU Guards From DML To DC - Part 3
4bb2f0721ed8 drm/amd/display: Move FPU Guards From DML To DC - Part 2
3539437f354b drm/amd/display: Move FPU Guards From DML To DC - Part 1)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
index 5f12dcca7f71..29f45b556371 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
@@ -85,6 +85,7 @@ uint8_t dc_plane_get_pipe_mask(struct dc_state *dc_state, const struct dc_plane
******************************************************************************/
struct dc_plane_state *dc_create_plane_state(const struct dc *dc)
{
+ printk(KERN_INFO "%s 0: preempt_count = %d\n", __func__, preempt_count());
struct dc_plane_state *plane_state = kvzalloc_obj(*plane_state,
GFP_ATOMIC);


Again I get only 0 for the preempt_count.

Bert Karwatzki