selftests/resctrl: Allow ->setup() to return errors
resctrl_val() assumes ->setup() always returns either 0 to continue tests or < 0 in case of the normal termination of tests after x runs. The latter overlaps with normal error returns. Define END_OF_TESTS (=1) to differentiate the normal termination of tests and return errors as negative values. Alter callers of ->setup() to handle errors properly. Fixes:790bf585b0("selftests/resctrl: Add Cache Allocation Technology (CAT) selftest") Fixes:ecdbb911f2("selftests/resctrl: Add MBM test") Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
committed by
Shuah Khan
parent
c90b3b588e
commit
fa10366cc6
@@ -244,10 +244,12 @@ int cat_val(struct resctrl_val_param *param)
|
||||
while (1) {
|
||||
if (!strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR))) {
|
||||
ret = param->setup(1, param);
|
||||
if (ret) {
|
||||
if (ret == END_OF_TESTS) {
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
if (ret < 0)
|
||||
break;
|
||||
ret = reset_enable_llc_perf(bm_pid, param->cpu_no);
|
||||
if (ret)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user