[PATCH] cpufreq: Add test cases to validate the frequency and pstate table

Shilpasri G Bhat shilpa.bhat at linux.vnet.ibm.com
Fri Apr 22 09:22:25 UTC 2016


Hi Jeremy,

On 04/22/2016 02:24 PM, Jeremy Kerr wrote:
> Hi Shilpasri,
> 
>> +static int read_device_tree_file(const char *path, int *val)
> 
> [...]
> 
>> +static int read_device_tree_array(const char *path, int *arr, int *len)
> 
> [...]
> 
>> +static int cpufreq_test_pstate_limits(fwts_framework *fw)
>> +{
>> +	char *dev_tree_path = "/proc/device-tree/ibm,opal/power-mgt/";
> 
> [...]
> 
> We already have a representation of the device tree loaded, in fw->fdt.
> You can use the standard libfdt accessors on this data.
> 
> Then, the compile time check becomes FWTS_HAS_DEVICETREE (to determine
> whether you can use the libfdt functions), and you'd skip the test if
> you have no fdt data:
> 
> 	if (!fw->fdt)
> 		return FWTS_SKIPPED;

Cool. I will use fw->fdt to parse the pstate table. Thanks for pointing this out.

Regards,
Shilpa

> 
> Cheers,
> 
> 
> Jeremy
> 




More information about the fwts-devel mailing list