Linux real-time development
 help / color / mirror / Atom feed
From: Bert Karwatzki <spasswolf@web.de>
To: linux-kernel@vger.kernel.org, Rafal Ostrowski <rafal.ostrowski@amd.com>
Cc: linux-next@vger.kernel.org, linux-rt-devel@lists.linux.dev,
	 amd-gfx@lists.freedesktop.org,
	Alex Deucher <alexander.deucher@amd.com>,
	 Mario Limonciello <mario.limonciello@amd.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Thomas Gleixner	 <tglx@linutronix.de>,
	spasswolf@web.de
Subject: Re: [Re] kernel panic during shutdown in  next-20260722
Date: Mon, 27 Jul 2026 00:52:34 +0200	[thread overview]
Message-ID: <f012ef660c71e5d85bd746caab2f6a6e456671de.camel@web.de> (raw)
In-Reply-To: <6e0b713cffd64b3c30eb4ff04e50721bac9cf8ca.camel@web.de>

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

  reply	other threads:[~2026-07-26 22:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23 12:34 kernel panic during shutdown in v7.2-rc4 and next-20260722 with PREEMPT_RT Bert Karwatzki
2026-07-23 12:43 ` [Re] " Bert Karwatzki
2026-07-23 13:10   ` [Re] kernel panic during shutdown in v7.2-rc{3,4} " Bert Karwatzki
2026-07-23 13:23     ` Bert Karwatzki
2026-07-23 16:17       ` Bert Karwatzki
2026-07-23 22:51         ` [Re] kernel panic during shutdown in next-20260722 Bert Karwatzki
2026-07-24 15:08           ` Bert Karwatzki
2026-07-25 19:58             ` Bert Karwatzki
2026-07-25 23:16               ` Bert Karwatzki
2026-07-26 18:47                 ` Bert Karwatzki
2026-07-26 22:52                   ` Bert Karwatzki [this message]
2026-07-27 10:06                     ` [Re] kernel panic during shutdown in v7.1+ with PREEMPT_RT Bert Karwatzki
2026-07-27 10:35                       ` Ostrowski, Rafal
2026-07-27 10:50                         ` [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN,END} " Bert Karwatzki
2026-07-27 11:11                           ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f012ef660c71e5d85bd746caab2f6a6e456671de.camel@web.de \
    --to=spasswolf@web.de \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=mario.limonciello@amd.com \
    --cc=rafal.ostrowski@amd.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox