提交 8e943c3d 编写于 作者: H Harry Wentland 提交者: Xie XiuQi

drm/amd/display: don't call dm_pp_ function from an fpu block

commit 59d3191f14dc18881fec1172c7096b7863622803 upstream.

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
Acked-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NHarry Wentland <harry.wentland@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8b9c5560
...@@ -1347,12 +1347,12 @@ void dcn_bw_update_from_pplib(struct dc *dc) ...@@ -1347,12 +1347,12 @@ void dcn_bw_update_from_pplib(struct dc *dc)
struct dm_pp_clock_levels_with_voltage fclks = {0}, dcfclks = {0}; struct dm_pp_clock_levels_with_voltage fclks = {0}, dcfclks = {0};
bool res; bool res;
kernel_fpu_begin();
/* TODO: This is not the proper way to obtain fabric_and_dram_bandwidth, should be min(fclk, memclk) */ /* 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( res = dm_pp_get_clock_levels_by_type_with_voltage(
ctx, DM_PP_CLOCK_TYPE_FCLK, &fclks); ctx, DM_PP_CLOCK_TYPE_FCLK, &fclks);
kernel_fpu_begin();
if (res) if (res)
res = verify_clock_values(&fclks); res = verify_clock_values(&fclks);
...@@ -1371,9 +1371,13 @@ void dcn_bw_update_from_pplib(struct dc *dc) ...@@ -1371,9 +1371,13 @@ void dcn_bw_update_from_pplib(struct dc *dc)
} else } else
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
kernel_fpu_end();
res = dm_pp_get_clock_levels_by_type_with_voltage( res = dm_pp_get_clock_levels_by_type_with_voltage(
ctx, DM_PP_CLOCK_TYPE_DCFCLK, &dcfclks); ctx, DM_PP_CLOCK_TYPE_DCFCLK, &dcfclks);
kernel_fpu_begin();
if (res) if (res)
res = verify_clock_values(&dcfclks); res = verify_clock_values(&dcfclks);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册