Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbdG1EF4 (ORCPT ); Fri, 28 Jul 2017 00:05:56 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43156 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750935AbdG1EFz (ORCPT ); Fri, 28 Jul 2017 00:05:55 -0400 Subject: Re: [PATCH V8 1/3] powernv: powercap: Add support for powercap framework To: Cyril Bur , stewart@linux.vnet.ibm.com References: <1501045509-21732-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> <1501045509-21732-2-git-send-email-shilpa.bhat@linux.vnet.ibm.com> <1501205974.3324.1.camel@gmail.com> Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, ego@linux.vnet.ibm.com, svaidy@linux.vnet.ibm.com From: Shilpasri G Bhat Date: Fri, 28 Jul 2017 09:34:53 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1501205974.3324.1.camel@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable x-cbid: 17072804-0004-0000-0000-0000022915D4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17072804-0005-0000-0000-00005E0E7B40 Message-Id: <9b884a27-0b1e-f8b0-c2c5-3246432c6853@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-28_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707280061 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1181 Lines: 36 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/ system-powercap # ls /sys/firmware/opal/powercap/system-powercap/ powercap-current powercap-max powercap-min # grep . /sys/firmware/opal/powercap/system-powercap/* /sys/firmware/opal/powercap/system-powercap/powercap-current:2375 /sys/firmware/opal/powercap/system-powercap/powercap-max:2375 /sys/firmware/opal/powercap/system-powercap/powercap-min:1945 Thanks and Regards, Shilpa