Re: [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN,END} with PREEMPT_RT

From: Bert Karwatzki

Date: Wed Jul 29 2026 - 14:35:53 EST


Am Dienstag, dem 28.07.2026 um 05:51 +0500 schrieb mikhail.v.gavrilov@xxxxxxxxx:
> One thing that may be worth adjusting in the commit message: this is
> not only a PREEMPT_RT problem. 183182235f6d was needed on a plain non-
> RT x86 kernel. There DC_FP_START() takes fpregs_lock(), which disables
> local softirqs, and dc_plane_state is around 335 KiB, so kvzalloc_obj()
> falls through to the vmalloc path and hits BUG_ON(in_interrupt()). So
> on RT any allocation inside the FPU region is illegal, while on non-RT
> it is specifically the large ones - two failure modes, one root cause.

I think this was true when commit 
183182235f6d ("drm/amd/display: Wrap DCN32 phantom-plane allocation in DC_RUN_WITH_PREEMPTION_ENABLED")
was commited, but commit
04aa71da5f35 ("mm/vmalloc: do not trigger BUG() on BH disabled context")
changed the BUG_ON() in __get_vm_area_node():
diff --git a/mm/vmalloc.c b/mm/vmalloc.c

index c31a8615a832..bb6ae08d18f5 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -3203,7 +3203,7 @@ struct vm_struct *__get_vm_area_node(unsigned long size,
struct vm_struct *area;
unsigned long requested_size = size;

- BUG_ON(in_interrupt());
+ BUG_ON(in_nmi() || in_hardirq());
size = ALIGN(size, 1ul << shift);
if (unlikely(!size))
return NULL;

so on non-PREEMPT_RT kernels DC_RUN_WITH_PREEMPTION_ENABLED is no
longer required for DCN32 phantom-plane allocation.

Bert Karwatzki