[LTP] [PATCH v10] high_freq_hwp_cap_cppc.c: new test

Andrea Cervesato andrea.cervesato@suse.com
Wed May 6 14:38:02 CEST 2026


Hi Piotr,

> +		SAFE_PREAD(1, fd, &msr_highest_perf, sizeof(msr_highest_perf), MSR_HWP_CAPABILITIES);
> +		SAFE_CLOSE(fd);
> +		fd = -1;

This is not needed because it's done by SAFE_CLOSE() already.

> +		msr_highest_perf &= HIGHEST_PERF_MASK;
> +		tst_res(TDEBUG, "%s: %llu", path, msr_highest_perf);
> +
> +		if (msr_highest_perf != sysfs_highest_perf) {
> +			tst_res(TINFO, "cpu%d: sysfs=%llu MSR=%llu",
> +				i, sysfs_highest_perf, msr_highest_perf);
> +			status = false;

After this we should return, otherwise we keep cycling and next status
value might change again. I would just add here the TFAIL and return at
this point, so status variable goes away.

Unless, we want to track _all_ CPUs and then (at the end) print the
result. In this case, you need an array of int, assiging 1 in case of
error and 0 in case of success.
And the ending check, after the loop, will print the status of all
CPUs.

I'm not a driver expert, but I guess having an ending result printing
all results for all CPUs in case of mismatch is the best choice.

Kind regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


More information about the ltp mailing list