Skip to contentSkip to conversation

drm/amd/display: Use GFP_ATOMIC in dc_create_stream_for_sink

PATCH Applied Natalie Vock 2 participants 2 messages Feb 23 – Feb 24

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Use GFP_ATOMIC in dc_create_stream_for_sink

This can be called while preemption is disabled, for example by dcn32_internal_validate_bw which is called with the FPU active.

Fixes "BUG: scheduling while atomic" messages I encounter on my Navi31 machine.

---
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +2 -2
index 191f6435e7c64..87c0cf7e290ea 100644
@@ -170,11 +170,11 @@ struct dc_stream_state *dc_create_stream_for_sink(
 	if (sink == NULL)
 		goto fail;
 
-	stream = kzalloc(sizeof(struct dc_stream_state), GFP_KERNEL);
+	stream = kzalloc(sizeof(struct dc_stream_state), GFP_ATOMIC);
 	if (stream == NULL)
 		goto fail;
 
-	stream->update_scratch = kzalloc((int32_t) dc_update_scratch_space_size(), GFP_KERNEL);
+	stream->update_scratch = kzalloc((int32_t) dc_update_scratch_space_size(), GFP_ATOMIC);
 	if (stream->update_scratch == NULL)
 		goto fail;
 
Signature · 1 line
2.53.0
Applied
#1 lore raw

Applied. Thanks!

Quoted 35 lines · Natalie Vock

This can be called while preemption is disabled, for example by dcn32_internal_validate_bw which is called with the FPU active.

Fixes "BUG: scheduling while atomic" messages I encounter on my Navi31 machine.

---
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +2 -3
index 191f6435e7c64..87c0cf7e290ea 100644
@@ -170,11 +170,11 @@ struct dc_stream_state *dc_create_stream_for_sink(
        if (sink == NULL)
                goto fail;
 
-       stream = kzalloc(sizeof(struct dc_stream_state), GFP_KERNEL);
+       stream = kzalloc(sizeof(struct dc_stream_state), GFP_ATOMIC);
        if (stream == NULL)
                goto fail;
 
-       stream->update_scratch = kzalloc((int32_t) dc_update_scratch_space_size(), GFP_KERNEL);
+       stream->update_scratch = kzalloc((int32_t) dc_update_scratch_space_size(), GFP_ATOMIC);
        if (stream->update_scratch == NULL)
                goto fail;
 
--

2.53.0