All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: don't call dm_pp_ function from an fpu block
@ 2019-02-22 15:39 ` Harry Wentland
  0 siblings, 0 replies; 7+ messages in thread
From: Harry Wentland @ 2019-02-22 15:39 UTC (permalink / raw)
  To: amd-gfx; +Cc: robdclark, Harry Wentland, stable

Powerplay functions called from dm_pp_* functions tend to do a
mutex_lock which isn't safe to do inside a kernel_fpu_begin/end block as
those will disable/enable preemption.

Rearrange the dm_pp_get_clock_levels_by_type_with_voltage calls to make
sure they happen outside of kernel_fpu_begin/end.

Cc: stable@vger.kernel.org
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
index 2a807b9f77f7..5955634f6e27 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
@@ -1348,12 +1348,12 @@ void dcn_bw_update_from_pplib(struct dc *dc)
 	struct dm_pp_clock_levels_with_voltage fclks = {0}, dcfclks = {0};
 	bool res;
 
-	kernel_fpu_begin();
-
 	/* TODO: This is not the proper way to obtain fabric_and_dram_bandwidth, should be min(fclk, memclk) */
 	res = dm_pp_get_clock_levels_by_type_with_voltage(
 			ctx, DM_PP_CLOCK_TYPE_FCLK, &fclks);
 
+	kernel_fpu_begin();
+
 	if (res)
 		res = verify_clock_values(&fclks);
 
@@ -1372,9 +1372,13 @@ void dcn_bw_update_from_pplib(struct dc *dc)
 	} else
 		BREAK_TO_DEBUGGER();
 
+	kernel_fpu_end();
+
 	res = dm_pp_get_clock_levels_by_type_with_voltage(
 			ctx, DM_PP_CLOCK_TYPE_DCFCLK, &dcfclks);
 
+	kernel_fpu_begin();
+
 	if (res)
 		res = verify_clock_values(&dcfclks);
 
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-05 19:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-22 15:39 [PATCH] drm/amd/display: don't call dm_pp_ function from an fpu block Harry Wentland
2019-02-22 15:39 ` Harry Wentland
     [not found] ` <20190222153906.661-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2019-02-22 17:31   ` Deucher, Alexander
2019-02-26 21:24   ` Sasha Levin
     [not found]     ` <20190226212405.0CFF020645-+nuXSHJNwjE76Z2rM5mHXA@public.gmane.org>
2019-03-05 19:12       ` Wentland, Harry
2019-03-05 19:12         ` Wentland, Harry
2019-02-22 19:19 ` Rob Clark

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.