[radeon-alex:drm-next-5.2-wip 214/226] drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c:1204:3-9: preceding lock on line 1065 (fwd)

Julia Lawall julia.lawall at lip6.fr
Sat Mar 2 06:44:22 UTC 2019


Hello,

It looks like line 1204 needs a break rather than a return, like in the
aborts from the other cases.

julia

---------- Forwarded message ----------
Date: Sat, 2 Mar 2019 14:36:31 +0800
From: kbuild test robot <lkp at intel.com>
To: kbuild at 01.org
Cc: Julia Lawall <julia.lawall at lip6.fr>
Subject: [radeon-alex:drm-next-5.2-wip 214/226]
    drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c:1204:3-9: preceding
    lock on line 1065

CC: kbuild-all at 01.org
CC: dri-devel at lists.freedesktop.org
TO: Likun Gao <Likun.Gao at amd.com>
CC: Alex Deucher <alexander.deucher at amd.com>
CC: Gui Chengming <Jack.Gui at amd.com>

tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-5.2-wip
head:   25752e1fc83e9f983b11d680fc7bfc129b4eaae6
commit: e85bae378020046f53f18a61ac6bd5cdb798a079 [214/226] drm/amd/powerplay: support sysfs to set/get pcie
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago

>> drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c:1204:3-9: preceding lock on line 1065

git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
git remote update radeon-alex
git checkout e85bae378020046f53f18a61ac6bd5cdb798a079
vim +1204 drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c

1d5da59b Likun Gao 2019-01-07  1050
7b0f60df Likun Gao 2019-01-07  1051  static int vega20_force_clk_levels(struct smu_context *smu,
7b0f60df Likun Gao 2019-01-07  1052  			enum pp_clock_type type, uint32_t mask)
7b0f60df Likun Gao 2019-01-07  1053  {
7b0f60df Likun Gao 2019-01-07  1054  	struct vega20_dpm_table *dpm_table;
7b0f60df Likun Gao 2019-01-07  1055  	struct vega20_single_dpm_table *single_dpm_table;
db129665 Likun Gao 2019-02-20  1056  	uint32_t soft_min_level, soft_max_level, hard_min_level;
72ee8378 Likun Gao 2019-01-23  1057  	struct smu_dpm_context *smu_dpm = &smu->smu_dpm;
72ee8378 Likun Gao 2019-01-23  1058  	int ret = 0;
72ee8378 Likun Gao 2019-01-23  1059
72ee8378 Likun Gao 2019-01-23  1060  	if (smu_dpm->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL) {
72ee8378 Likun Gao 2019-01-23  1061  		pr_info("force clock level is for dpm manual mode only.\n");
72ee8378 Likun Gao 2019-01-23  1062  		return -EINVAL;
72ee8378 Likun Gao 2019-01-23  1063  	}
72ee8378 Likun Gao 2019-01-23  1064
72ee8378 Likun Gao 2019-01-23 @1065  	mutex_lock(&(smu->mutex));
7b0f60df Likun Gao 2019-01-07  1066
7b0f60df Likun Gao 2019-01-07  1067  	soft_min_level = mask ? (ffs(mask) - 1) : 0;
7b0f60df Likun Gao 2019-01-07  1068  	soft_max_level = mask ? (fls(mask) - 1) : 0;
7b0f60df Likun Gao 2019-01-07  1069
7b0f60df Likun Gao 2019-01-07  1070  	dpm_table = smu->smu_dpm.dpm_context;
7b0f60df Likun Gao 2019-01-07  1071
7b0f60df Likun Gao 2019-01-07  1072  	switch (type) {
7b0f60df Likun Gao 2019-01-07  1073  	case PP_SCLK:
7b0f60df Likun Gao 2019-01-07  1074  		single_dpm_table = &(dpm_table->gfx_table);
7b0f60df Likun Gao 2019-01-07  1075
7b0f60df Likun Gao 2019-01-07  1076  		if (soft_max_level >= single_dpm_table->count) {
7b0f60df Likun Gao 2019-01-07  1077  			pr_err("Clock level specified %d is over max allowed %d\n",
7b0f60df Likun Gao 2019-01-07  1078  					soft_max_level, single_dpm_table->count - 1);
72ee8378 Likun Gao 2019-01-23  1079  			ret = -EINVAL;
72ee8378 Likun Gao 2019-01-23  1080  			break;
7b0f60df Likun Gao 2019-01-07  1081  		}
7b0f60df Likun Gao 2019-01-07  1082
7b0f60df Likun Gao 2019-01-07  1083  		single_dpm_table->dpm_state.soft_min_level =
7b0f60df Likun Gao 2019-01-07  1084  			single_dpm_table->dpm_levels[soft_min_level].value;
7b0f60df Likun Gao 2019-01-07  1085  		single_dpm_table->dpm_state.soft_max_level =
7b0f60df Likun Gao 2019-01-07  1086  			single_dpm_table->dpm_levels[soft_max_level].value;
7b0f60df Likun Gao 2019-01-07  1087
db129665 Likun Gao 2019-02-20  1088  		ret = vega20_upload_dpm_level(smu, false, FEATURE_DPM_GFXCLK_MASK);
7b0f60df Likun Gao 2019-01-07  1089  		if (ret) {
7b0f60df Likun Gao 2019-01-07  1090  			pr_err("Failed to upload boot level to lowest!\n");
72ee8378 Likun Gao 2019-01-23  1091  			break;
7b0f60df Likun Gao 2019-01-07  1092  		}
7b0f60df Likun Gao 2019-01-07  1093
db129665 Likun Gao 2019-02-20  1094  		ret = vega20_upload_dpm_level(smu, true, FEATURE_DPM_GFXCLK_MASK);
72ee8378 Likun Gao 2019-01-23  1095  		if (ret)
7b0f60df Likun Gao 2019-01-07  1096  			pr_err("Failed to upload dpm max level to highest!\n");
7b0f60df Likun Gao 2019-01-07  1097
7b0f60df Likun Gao 2019-01-07  1098  		break;
7b0f60df Likun Gao 2019-01-07  1099
7b0f60df Likun Gao 2019-01-07  1100  	case PP_MCLK:
7b0f60df Likun Gao 2019-01-07  1101  		single_dpm_table = &(dpm_table->mem_table);
7b0f60df Likun Gao 2019-01-07  1102
7b0f60df Likun Gao 2019-01-07  1103  		if (soft_max_level >= single_dpm_table->count) {
7b0f60df Likun Gao 2019-01-07  1104  			pr_err("Clock level specified %d is over max allowed %d\n",
7b0f60df Likun Gao 2019-01-07  1105  					soft_max_level, single_dpm_table->count - 1);
72ee8378 Likun Gao 2019-01-23  1106  			ret = -EINVAL;
72ee8378 Likun Gao 2019-01-23  1107  			break;
7b0f60df Likun Gao 2019-01-07  1108  		}
7b0f60df Likun Gao 2019-01-07  1109
7b0f60df Likun Gao 2019-01-07  1110  		single_dpm_table->dpm_state.soft_min_level =
7b0f60df Likun Gao 2019-01-07  1111  			single_dpm_table->dpm_levels[soft_min_level].value;
7b0f60df Likun Gao 2019-01-07  1112  		single_dpm_table->dpm_state.soft_max_level =
7b0f60df Likun Gao 2019-01-07  1113  			single_dpm_table->dpm_levels[soft_max_level].value;
7b0f60df Likun Gao 2019-01-07  1114
db129665 Likun Gao 2019-02-20  1115  		ret = vega20_upload_dpm_level(smu, false, FEATURE_DPM_UCLK_MASK);
db129665 Likun Gao 2019-02-20  1116  		if (ret) {
db129665 Likun Gao 2019-02-20  1117  			pr_err("Failed to upload boot level to lowest!\n");
db129665 Likun Gao 2019-02-20  1118  			break;
db129665 Likun Gao 2019-02-20  1119  		}
db129665 Likun Gao 2019-02-20  1120
db129665 Likun Gao 2019-02-20  1121  		ret = vega20_upload_dpm_level(smu, true, FEATURE_DPM_UCLK_MASK);
db129665 Likun Gao 2019-02-20  1122  		if (ret)
db129665 Likun Gao 2019-02-20  1123  			pr_err("Failed to upload dpm max level to highest!\n");
db129665 Likun Gao 2019-02-20  1124
db129665 Likun Gao 2019-02-20  1125  		break;
db129665 Likun Gao 2019-02-20  1126
db129665 Likun Gao 2019-02-20  1127  	case PP_SOCCLK:
db129665 Likun Gao 2019-02-20  1128  		single_dpm_table = &(dpm_table->soc_table);
db129665 Likun Gao 2019-02-20  1129
db129665 Likun Gao 2019-02-20  1130  		if (soft_max_level >= single_dpm_table->count) {
db129665 Likun Gao 2019-02-20  1131  			pr_err("Clock level specified %d is over max allowed %d\n",
db129665 Likun Gao 2019-02-20  1132  					soft_max_level, single_dpm_table->count - 1);
db129665 Likun Gao 2019-02-20  1133  			ret = -EINVAL;
db129665 Likun Gao 2019-02-20  1134  			break;
db129665 Likun Gao 2019-02-20  1135  		}
db129665 Likun Gao 2019-02-20  1136
db129665 Likun Gao 2019-02-20  1137  		single_dpm_table->dpm_state.soft_min_level =
db129665 Likun Gao 2019-02-20  1138  			single_dpm_table->dpm_levels[soft_min_level].value;
db129665 Likun Gao 2019-02-20  1139  		single_dpm_table->dpm_state.soft_max_level =
db129665 Likun Gao 2019-02-20  1140  			single_dpm_table->dpm_levels[soft_max_level].value;
db129665 Likun Gao 2019-02-20  1141
db129665 Likun Gao 2019-02-20  1142  		ret = vega20_upload_dpm_level(smu, false, FEATURE_DPM_SOCCLK_MASK);
db129665 Likun Gao 2019-02-20  1143  		if (ret) {
db129665 Likun Gao 2019-02-20  1144  			pr_err("Failed to upload boot level to lowest!\n");
db129665 Likun Gao 2019-02-20  1145  			break;
db129665 Likun Gao 2019-02-20  1146  		}
db129665 Likun Gao 2019-02-20  1147
db129665 Likun Gao 2019-02-20  1148  		ret = vega20_upload_dpm_level(smu, true, FEATURE_DPM_SOCCLK_MASK);
db129665 Likun Gao 2019-02-20  1149  		if (ret)
db129665 Likun Gao 2019-02-20  1150  			pr_err("Failed to upload dpm max level to highest!\n");
db129665 Likun Gao 2019-02-20  1151
db129665 Likun Gao 2019-02-20  1152  		break;
db129665 Likun Gao 2019-02-20  1153
db129665 Likun Gao 2019-02-20  1154  	case PP_FCLK:
db129665 Likun Gao 2019-02-20  1155  		single_dpm_table = &(dpm_table->fclk_table);
db129665 Likun Gao 2019-02-20  1156
db129665 Likun Gao 2019-02-20  1157  		if (soft_max_level >= single_dpm_table->count) {
db129665 Likun Gao 2019-02-20  1158  			pr_err("Clock level specified %d is over max allowed %d\n",
db129665 Likun Gao 2019-02-20  1159  					soft_max_level, single_dpm_table->count - 1);
db129665 Likun Gao 2019-02-20  1160  			ret = -EINVAL;
db129665 Likun Gao 2019-02-20  1161  			break;
db129665 Likun Gao 2019-02-20  1162  		}
db129665 Likun Gao 2019-02-20  1163
db129665 Likun Gao 2019-02-20  1164  		single_dpm_table->dpm_state.soft_min_level =
db129665 Likun Gao 2019-02-20  1165  			single_dpm_table->dpm_levels[soft_min_level].value;
db129665 Likun Gao 2019-02-20  1166  		single_dpm_table->dpm_state.soft_max_level =
db129665 Likun Gao 2019-02-20  1167  			single_dpm_table->dpm_levels[soft_max_level].value;
db129665 Likun Gao 2019-02-20  1168
db129665 Likun Gao 2019-02-20  1169  		ret = vega20_upload_dpm_level(smu, false, FEATURE_DPM_FCLK_MASK);
7b0f60df Likun Gao 2019-01-07  1170  		if (ret) {
7b0f60df Likun Gao 2019-01-07  1171  			pr_err("Failed to upload boot level to lowest!\n");
72ee8378 Likun Gao 2019-01-23  1172  			break;
7b0f60df Likun Gao 2019-01-07  1173  		}
7b0f60df Likun Gao 2019-01-07  1174
db129665 Likun Gao 2019-02-20  1175  		ret = vega20_upload_dpm_level(smu, true, FEATURE_DPM_FCLK_MASK);
72ee8378 Likun Gao 2019-01-23  1176  		if (ret)
7b0f60df Likun Gao 2019-01-07  1177  			pr_err("Failed to upload dpm max level to highest!\n");
7b0f60df Likun Gao 2019-01-07  1178
7b0f60df Likun Gao 2019-01-07  1179  		break;
7b0f60df Likun Gao 2019-01-07  1180
db129665 Likun Gao 2019-02-20  1181  	case PP_DCEFCLK:
db129665 Likun Gao 2019-02-20  1182  		hard_min_level = soft_min_level;
db129665 Likun Gao 2019-02-20  1183  		single_dpm_table = &(dpm_table->dcef_table);
db129665 Likun Gao 2019-02-20  1184
db129665 Likun Gao 2019-02-20  1185  		if (hard_min_level >= single_dpm_table->count) {
db129665 Likun Gao 2019-02-20  1186  			pr_err("Clock level specified %d is over max allowed %d\n",
db129665 Likun Gao 2019-02-20  1187  					hard_min_level, single_dpm_table->count - 1);
db129665 Likun Gao 2019-02-20  1188  			ret = -EINVAL;
db129665 Likun Gao 2019-02-20  1189  			break;
db129665 Likun Gao 2019-02-20  1190  		}
db129665 Likun Gao 2019-02-20  1191
db129665 Likun Gao 2019-02-20  1192  		single_dpm_table->dpm_state.hard_min_level =
db129665 Likun Gao 2019-02-20  1193  			single_dpm_table->dpm_levels[hard_min_level].value;
db129665 Likun Gao 2019-02-20  1194
db129665 Likun Gao 2019-02-20  1195  		ret = vega20_upload_dpm_level(smu, false, FEATURE_DPM_DCEFCLK_MASK);
db129665 Likun Gao 2019-02-20  1196  		if (ret)
db129665 Likun Gao 2019-02-20  1197  			pr_err("Failed to upload boot level to lowest!\n");
db129665 Likun Gao 2019-02-20  1198
db129665 Likun Gao 2019-02-20  1199  		break;
db129665 Likun Gao 2019-02-20  1200
bfaf193a Likun Gao 2019-01-18  1201  	case PP_PCIE:
e85bae37 Likun Gao 2019-02-21  1202  		if (soft_min_level >= NUM_LINK_LEVELS ||
e85bae37 Likun Gao 2019-02-21  1203  		    soft_max_level >= NUM_LINK_LEVELS)
e85bae37 Likun Gao 2019-02-21 @1204  			return -EINVAL;
e85bae37 Likun Gao 2019-02-21  1205
e85bae37 Likun Gao 2019-02-21  1206  		ret = smu_send_smc_msg_with_param(smu,
e85bae37 Likun Gao 2019-02-21  1207  				SMU_MSG_SetMinLinkDpmByIndex, soft_min_level);
e85bae37 Likun Gao 2019-02-21  1208  		if (ret)
e85bae37 Likun Gao 2019-02-21  1209  			pr_err("Failed to set min link dpm level!\n");
e85bae37 Likun Gao 2019-02-21  1210
bfaf193a Likun Gao 2019-01-18  1211  		break;
bfaf193a Likun Gao 2019-01-18  1212
7b0f60df Likun Gao 2019-01-07  1213  	default:
7b0f60df Likun Gao 2019-01-07  1214  		break;
7b0f60df Likun Gao 2019-01-07  1215  	}
7b0f60df Likun Gao 2019-01-07  1216
72ee8378 Likun Gao 2019-01-23  1217  	mutex_unlock(&(smu->mutex));
72ee8378 Likun Gao 2019-01-23  1218  	return ret;
7b0f60df Likun Gao 2019-01-07  1219  }
7b0f60df Likun Gao 2019-01-07  1220

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation


More information about the dri-devel mailing list