Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: use GFP_ATOMIC in dcn20_resource_construct

Replace GFP_KERNEL with GFP_ATOMIC as dcn20_resource_construct()
can't sleep.

Partially fixes: https://bugzilla.kernel.org/show_bug.cgi?id=212311
as dcn20_resource_construct() also calls into SMU functions which does
mutex_lock().

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Nirmoy Das and committed by
Alex Deucher
3bb11050 3ca40145

+18 -18
+1 -1
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c
··· 283 283 const struct dce_abm_shift *abm_shift, 284 284 const struct dce_abm_mask *abm_mask) 285 285 { 286 - struct dce_abm *abm_dce = kzalloc(sizeof(*abm_dce), GFP_KERNEL); 286 + struct dce_abm *abm_dce = kzalloc(sizeof(*abm_dce), GFP_ATOMIC); 287 287 288 288 if (abm_dce == NULL) { 289 289 BREAK_TO_DEBUGGER();
+3 -3
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c
··· 1133 1133 const struct dce_dmcu_shift *dmcu_shift, 1134 1134 const struct dce_dmcu_mask *dmcu_mask) 1135 1135 { 1136 - struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_KERNEL); 1136 + struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_ATOMIC); 1137 1137 1138 1138 if (dmcu_dce == NULL) { 1139 1139 BREAK_TO_DEBUGGER(); ··· 1154 1154 const struct dce_dmcu_shift *dmcu_shift, 1155 1155 const struct dce_dmcu_mask *dmcu_mask) 1156 1156 { 1157 - struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_KERNEL); 1157 + struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_ATOMIC); 1158 1158 1159 1159 if (dmcu_dce == NULL) { 1160 1160 BREAK_TO_DEBUGGER(); ··· 1175 1175 const struct dce_dmcu_shift *dmcu_shift, 1176 1176 const struct dce_dmcu_mask *dmcu_mask) 1177 1177 { 1178 - struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_KERNEL); 1178 + struct dce_dmcu *dmcu_dce = kzalloc(sizeof(*dmcu_dce), GFP_ATOMIC); 1179 1179 1180 1180 if (dmcu_dce == NULL) { 1181 1181 BREAK_TO_DEBUGGER();
+1 -1
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.c
··· 112 112 const struct dccg_shift *dccg_shift, 113 113 const struct dccg_mask *dccg_mask) 114 114 { 115 - struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_KERNEL); 115 + struct dcn_dccg *dccg_dcn = kzalloc(sizeof(*dccg_dcn), GFP_ATOMIC); 116 116 struct dccg *base; 117 117 118 118 if (dccg_dcn == NULL) {
+13 -13
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
··· 1106 1106 uint32_t inst) 1107 1107 { 1108 1108 struct dcn20_dpp *dpp = 1109 - kzalloc(sizeof(struct dcn20_dpp), GFP_KERNEL); 1109 + kzalloc(sizeof(struct dcn20_dpp), GFP_ATOMIC); 1110 1110 1111 1111 if (!dpp) 1112 1112 return NULL; ··· 1124 1124 struct dc_context *ctx, uint32_t inst) 1125 1125 { 1126 1126 struct dcn10_ipp *ipp = 1127 - kzalloc(sizeof(struct dcn10_ipp), GFP_KERNEL); 1127 + kzalloc(sizeof(struct dcn10_ipp), GFP_ATOMIC); 1128 1128 1129 1129 if (!ipp) { 1130 1130 BREAK_TO_DEBUGGER(); ··· 1141 1141 struct dc_context *ctx, uint32_t inst) 1142 1142 { 1143 1143 struct dcn20_opp *opp = 1144 - kzalloc(sizeof(struct dcn20_opp), GFP_KERNEL); 1144 + kzalloc(sizeof(struct dcn20_opp), GFP_ATOMIC); 1145 1145 1146 1146 if (!opp) { 1147 1147 BREAK_TO_DEBUGGER(); ··· 1158 1158 uint32_t inst) 1159 1159 { 1160 1160 struct aux_engine_dce110 *aux_engine = 1161 - kzalloc(sizeof(struct aux_engine_dce110), GFP_KERNEL); 1161 + kzalloc(sizeof(struct aux_engine_dce110), GFP_ATOMIC); 1162 1162 1163 1163 if (!aux_engine) 1164 1164 return NULL; ··· 1196 1196 uint32_t inst) 1197 1197 { 1198 1198 struct dce_i2c_hw *dce_i2c_hw = 1199 - kzalloc(sizeof(struct dce_i2c_hw), GFP_KERNEL); 1199 + kzalloc(sizeof(struct dce_i2c_hw), GFP_ATOMIC); 1200 1200 1201 1201 if (!dce_i2c_hw) 1202 1202 return NULL; ··· 1209 1209 struct mpc *dcn20_mpc_create(struct dc_context *ctx) 1210 1210 { 1211 1211 struct dcn20_mpc *mpc20 = kzalloc(sizeof(struct dcn20_mpc), 1212 - GFP_KERNEL); 1212 + GFP_ATOMIC); 1213 1213 1214 1214 if (!mpc20) 1215 1215 return NULL; ··· 1227 1227 { 1228 1228 int i; 1229 1229 struct dcn20_hubbub *hubbub = kzalloc(sizeof(struct dcn20_hubbub), 1230 - GFP_KERNEL); 1230 + GFP_ATOMIC); 1231 1231 1232 1232 if (!hubbub) 1233 1233 return NULL; ··· 1255 1255 uint32_t instance) 1256 1256 { 1257 1257 struct optc *tgn10 = 1258 - kzalloc(sizeof(struct optc), GFP_KERNEL); 1258 + kzalloc(sizeof(struct optc), GFP_ATOMIC); 1259 1259 1260 1260 if (!tgn10) 1261 1261 return NULL; ··· 1334 1334 bool dp_clk_src) 1335 1335 { 1336 1336 struct dce110_clk_src *clk_src = 1337 - kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); 1337 + kzalloc(sizeof(struct dce110_clk_src), GFP_ATOMIC); 1338 1338 1339 1339 if (!clk_src) 1340 1340 return NULL; ··· 1440 1440 struct dc_context *ctx, uint32_t inst) 1441 1441 { 1442 1442 struct dcn20_dsc *dsc = 1443 - kzalloc(sizeof(struct dcn20_dsc), GFP_KERNEL); 1443 + kzalloc(sizeof(struct dcn20_dsc), GFP_ATOMIC); 1444 1444 1445 1445 if (!dsc) { 1446 1446 BREAK_TO_DEBUGGER(); ··· 1574 1574 uint32_t inst) 1575 1575 { 1576 1576 struct dcn20_hubp *hubp2 = 1577 - kzalloc(sizeof(struct dcn20_hubp), GFP_KERNEL); 1577 + kzalloc(sizeof(struct dcn20_hubp), GFP_ATOMIC); 1578 1578 1579 1579 if (!hubp2) 1580 1580 return NULL; ··· 3396 3396 3397 3397 static struct pp_smu_funcs *dcn20_pp_smu_create(struct dc_context *ctx) 3398 3398 { 3399 - struct pp_smu_funcs *pp_smu = kzalloc(sizeof(*pp_smu), GFP_KERNEL); 3399 + struct pp_smu_funcs *pp_smu = kzalloc(sizeof(*pp_smu), GFP_ATOMIC); 3400 3400 3401 3401 if (!pp_smu) 3402 3402 return pp_smu; ··· 4042 4042 struct dc *dc) 4043 4043 { 4044 4044 struct dcn20_resource_pool *pool = 4045 - kzalloc(sizeof(struct dcn20_resource_pool), GFP_KERNEL); 4045 + kzalloc(sizeof(struct dcn20_resource_pool), GFP_ATOMIC); 4046 4046 4047 4047 if (!pool) 4048 4048 return NULL;