[bug report] drm/amd/display: Simplify the per-CPU usage.
Sebastian Andrzej Siewior
bigeasy at linutronix.de
Thu Feb 1 13:53:42 UTC 2024
On 2024-02-01 15:18:04 [+0300], Dan Carpenter wrote:
> Hello Sebastian Andrzej Siewior,
Hi Dan,
> The patch de5e73dc6baf: "drm/amd/display: Simplify the per-CPU
> usage." from Sep 21, 2023 (linux-next), leads to the following Smatch
> static checker warning:
Did I introduce that or has it been made visible?
That change adds preempt_disable() to DC_FP_START() but this was there
already, just hidden. For x86 it is done within kernel_fpu_begin().
> drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn30/dcn30_resource.c:2385 dcn30_resource_construct() warn: sleeping in atomic context
> drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn32/dcn32_resource.c:2136 dcn32_resource_construct() warn: sleeping in atomic context
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn30/dcn30_resource.c
> 2263 static bool dcn30_resource_construct(
> 2264 uint8_t num_virtual_links,
> 2265 struct dc *dc,
> 2266 struct dcn30_resource_pool *pool)
> 2267 {
…
> 2281
> 2282 DC_FP_START();
> ^^^^^^^^^^^^^^
> Preempt disabled here.
…
> 2383 /* Clock Sources for Pixel Clock*/
> 2384 pool->base.clock_sources[DCN30_CLK_SRC_PLL0] =
> --> 2385 dcn30_clock_source_create(ctx, ctx->dc_bios,
> ^^^^^^^^^^^^^^^^^^^^^^^^^^
> sleeping allocation here.
>
Correct you are. But there is more. Later is also dccg30_create() and
dcn30_hubbub_create() and probably a few other, too.
Could we please restructure the init-phase so that the memory allocation
happen outside of DC_FP_START(). Is DC_FP_START() even needed here?
> regards,
> dan carpenter
Sebastian
More information about the amd-gfx
mailing list