[PATCH v2] cpufreq: Add test cases to validate the frequency and pstate table
Jeremy Kerr
jk at ozlabs.org
Tue May 3 07:36:21 UTC 2016
Hi Shilparsi,
This patch is looking good - but still a couple of minor changes that
I'd suggest:
> +static int cpufreq_test_frequency_limits(fwts_framework *fw)
Just curious: do we fail both of those tests on the recent turbo-mode
OPAL bug? Does Linux still parse the invalid range of pstates from the
DT and export them to /sys/?
> +#if FWTS_HAS_DEVICETREE
> +static int cpufreq_test_pstate_limits(fwts_framework *fw)
It's a close call on whether we put this in the cpufreq tests, or the
device tree tests. The latter would mean that we don't start adding
conditional compilation into the cpufreq code, so I think I'd prefer
that (but that's just my opinion, the FWTS folks may disagree!)
> +{
> + const char *power_mgt_path = "/ibm,opal/power-mgt/";
> + int pstate_min, pstate_max, pstates[MAX_FREQS], nr_pstates;
> + bool ok = true;
> + int offset, len, ret, i;
> +
> + if (!fw->fdt) {
> + fwts_skipped(fw, "Device tree not found");
> + return FWTS_SKIP;
> + }
> +
> + offset = fdt_path_offset(fw->fdt, power_mgt_path);
> + if (offset < 0) {
> + fwts_failed(fw, LOG_LEVEL_MEDIUM, "DTNodeMissing",
> + "power management node is missing");
> + return FWTS_ERROR;
> + }
This isn't necessarily an error on all device tree platforms - consider
non-OPAL POWER machines.
You might want to skip this test on the condition:
if (fwts_firmware_detect() != FWTS_FIRMWARE_OPAL)
[Also, do this at the beginning of the test, so that non-OPAL machines
don't print out messages about no device tree.]
Looks good though - I like the new device-tree helpers too.
Cheers,
Jeremy
More information about the fwts-devel
mailing list