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

Bert Karwatzki <[email protected]> Mon, 27 Jul 2026 00:52:34 +0200
Newsgroups dev.linux.lists.linux-rt-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-next
Message-ID <[email protected]>
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:
>=20
>=20
> Now I've run a test with
> commit 8bf0cb97edb ("drm/amd/display: Move dml2_destroy to non-FPU compi=
lation unit")
> with the following debugging patch:
>=20

As I had no better idea I started throwing printk()s into the general=20
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 =3D %d\n", __func__, __LINE__, pre=
empt_count());
 struct dc_plane_state *plane_state =3D kvzalloc_obj(*plane_state,
 GFP_ATOMIC);
 printk(KERN_INFO "%s %d\n", __func__, __LINE__);

 if (NULL =3D=3D 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 =3D 2"! (only if dc_create_pl=
ane_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_resourc=
e.c b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
index cb93bfbe9e9e..7a90098ec118 100644
=2D-- 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,
        }
=20
        if (dc->debug.using_dml2) {
-               DC_FP_START();
                status =3D dml2_validate(dc, context,
                                context->power_source =3D=3D DC_POWER_SOUR=
CE_DC ? context->bw_ctx.dml2_dc_power_source : context->bw_ctx.dml2,
                                validate_mode) ? DC_OK : DC_FAIL_BANDWIDTH=
_VALIDATE;
-               DC_FP_END();
        }
=20
        if (validate_mode =3D=3D DC_VALIDATE_MODE_AND_PROGRAMMING && statu=
s =3D=3D 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 =3D=3D DC_VALIDATE_MODE_AND_PROGRAMMING && statu=
s =3D=3D DC_FAIL_HW_CURSOR_SUPPORT) {
                /* attempt to validate again with subvp disabled due to cu=
rsor */
                if (dc->debug.using_dml2) {
-                       DC_FP_START();
                        status =3D dml2_validate(dc, context,
                                        context->power_source =3D=3D DC_PO=
WER_SOURCE_DC ? context->bw_ctx.dml2_dc_power_source : context->bw_ctx.dml=
2,
                                        validate_mode) ? DC_OK : DC_FAIL_B=
ANDWIDTH_VALIDATE;
-                       DC_FP_END();
                }
        }
=20
I get in all cases "preempt_count =3D 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/gp=
u/drm/amd/display/dc/core/dc_surface.c
index 5f12dcca7f71..29f45b556371 100644
=2D-- 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_stat=
e, const struct dc_plane
  ************************************************************************=
******/
 struct dc_plane_state *dc_create_plane_state(const struct dc *dc)
 {
+       printk(KERN_INFO "%s 0: preempt_count =3D %d\n", __func__, preempt=
_count());
        struct dc_plane_state *plane_state =3D kvzalloc_obj(*plane_state,
                                                          GFP_ATOMIC);
=20

Again I get only 0 for the preempt_count.

Bert Karwatzki