Skip to contentSkip to conversation

drm/amd/display: use udelay rather than fsleep

PATCH In review Alex Deucher 3 participants 3 messages Sep 3, 2025 – Sep 8, 2025

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amd/display: use udelay rather than fsleep

This function can be called from an atomic context so we can't use fsleep().

Fixes 01f60348d8fb ("drm/amd/display: Fix 'failed to blank crtc!'")
Cc Wen Chen <[email protected]>
Cc Fangzhi Zuo <[email protected]>
Cc Nicholas Kazlauskas <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +1 -1
index 7d24fa1517bf1..cc377fcda6ff9 100644
@@ -955,7 +955,7 @@ enum dc_status dcn20_enable_stream_timing(
 		return DC_ERROR_UNEXPECTED;
 	}
 
-	fsleep(stream->timing.v_total * (stream->timing.h_total * 10000u / stream->timing.pix_clk_100hz));
+	udelay(stream->timing.v_total * (stream->timing.h_total * 10000u / stream->timing.pix_clk_100hz));
 
 	params.vertical_total_min = stream->adjust.v_total_min;
 	params.vertical_total_max = stream->adjust.v_total_max;
Signature · 1 line
2.51.0
#1 lore raw

Ping?

Quoted 31 lines · Alex Deucher

This function can be called from an atomic context so we can't use fsleep().

Fixes 01f60348d8fb ("drm/amd/display: Fix 'failed to blank crtc!'")
Cc Wen Chen <[email protected]>
Cc Fangzhi Zuo <[email protected]>
Cc Nicholas Kazlauskas <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +1 -2
index 7d24fa1517bf1..cc377fcda6ff9 100644
@@ -955,7 +955,7 @@ enum dc_status dcn20_enable_stream_timing(
                return DC_ERROR_UNEXPECTED;
        }
 
-       fsleep(stream->timing.v_total * (stream->timing.h_total * 10000u / stream->timing.pix_clk_100hz));
+       udelay(stream->timing.v_total * (stream->timing.h_total * 10000u / stream->timing.pix_clk_100hz));
 
        params.vertical_total_min = stream->adjust.v_total_min;
        params.vertical_total_max = stream->adjust.v_total_max;
--

2.51.0

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Alex Deucher
Quoted 10 lines · Alex Deucher

This function can be called from an atomic context so we can't use fsleep().

Fixes 01f60348d8fb ("drm/amd/display: Fix 'failed to blank crtc!'")
Cc Wen Chen <[email protected]>
Cc Fangzhi Zuo <[email protected]>
Cc Nicholas Kazlauskas <[email protected]>
Cc Harry Wentland <[email protected]>

Harry

Quoted 17 lines
---
 drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +1 -1
index 7d24fa1517bf1..cc377fcda6ff9 100644
@@ -955,7 +955,7 @@ enum dc_status dcn20_enable_stream_timing(
 		return DC_ERROR_UNEXPECTED;
 	}
 
-	fsleep(stream->timing.v_total * (stream->timing.h_total * 10000u / stream->timing.pix_clk_100hz));
+	udelay(stream->timing.v_total * (stream->timing.h_total * 10000u / stream->timing.pix_clk_100hz));
 
 	params.vertical_total_min = stream->adjust.v_total_min;
 	params.vertical_total_max = stream->adjust.v_total_max;