[PATCH V8 1/3] powernv: powercap: Add support for powercap framework

Shilpasri G Bhat shilpa.bhat at linux.vnet.ibm.com
Fri Jul 28 14:04:53 AEST 2017

Hi Cyril,

On 07/28/2017 07:09 AM, Cyril Bur wrote:
> Is there any reason that pcap_attrs needs to be contiguous? If not, I
> feel like you could eliminate the entire loop below (and the last one
> as well maybe) and just do the assignment of pattr_groups[].attrs[] up
> there.
> In fact do you even need to store pcap_attrs? If you kcalloc them as
> you need them (in the loop above), you can always free them again on
> error by freeing pattr_groups[].attrs[] right?
> I'll admit I've become quite confused as to the layout of the sysfs dir
>  that you're creating here - would you mind showing what the expected
> layout will be?
> I'll take more of a look once thats more clear in my head
> Thanks,
> Cyril

The sysfs layout looks as below:
# ls /sys/firmware/opal/powercap/

# ls /sys/firmware/opal/powercap/system-powercap/
powercap-current  powercap-max  powercap-min

# grep .  /sys/firmware/opal/powercap/system-powercap/*

Thanks and Regards,

More information about the Linuxppc-dev mailing list