Re: high_freq_hwp_cap_cppc.c: new test for testing acpi_cppc/highest_perf

[email protected]
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi Piotr,

On Wed, Jun 10, 2026 at 03:30:49PM +0200, Piotr Kubaj wrote:
> high_freq_hwp_cap_cppc.c: new test for testing acpi_cppc/highest_perf

> +//	.needs_cpu_vendor = "GenuineIntel",

This field does not exist in the LTP framework. Is this leftover from
an earlier prototype? Commented-out code should not be committed.

If the intent is to restrict to Intel, the existing CPUID HWP check
in setup() already serves that purpose since HWP is Intel-specific.

> +static void run(void)
> +{
> +	bool status = true;

> +		bool match = msr_highest_perf == sysfs_highest_perf;
> +
> +		if (!match) {
> +			tst_res(TINFO, "cpu%d: sysfs=%llu MSR=%llu",
> +				i, sysfs_highest_perf, msr_highest_perf);
> +			status = false;
> +		}
> +
> +		tst_res(TINFO, "cpu%d: %s", i, match ? "OK" : "MISMATCH");
> +	}
> +
> +	if (status)
> +		tst_res(TPASS, "Sysfs and MSR values are equal");
> +	else
> +		tst_res(TFAIL, "Highest performance values differ between sysfs and MSR");

Results should be reported directly where the outcome is determined,
not accumulated in a flag and reported at the end. Per-CPU mismatches
are logged as TINFO, meaning they won't appear as test failures in
result summaries.

Could this report TFAIL directly for each mismatched CPU and TPASS
once at the end if all matched? Something like:

    if (msr_highest_perf != sysfs_highest_perf) {
            tst_res(TFAIL, "cpu%d: sysfs=%llu MSR=%llu",
                    i, sysfs_highest_perf, msr_highest_perf);
            status = false;
    }

    ...

    if (status)
            tst_res(TPASS, "...");

That way each failing CPU is a proper TFAIL, and the redundant
second TINFO on line 99 can be dropped as well.

Verdict: Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.