From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753457AbbDNILx (ORCPT ); Tue, 14 Apr 2015 04:11:53 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:57784 "EHLO e28smtp07.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752903AbbDNILq (ORCPT ); Tue, 14 Apr 2015 04:11:46 -0400 Message-ID: <552CCB77.1000307@linux.vnet.ibm.com> Date: Tue, 14 Apr 2015 13:40:31 +0530 From: Shreyas B Prabhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Preeti U Murthy , linux-kernel@vger.kernel.org, Michael Ellerman CC: linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v4 3/3] powerpc/powernv: Introduce sysfs control for fastsleep workaround behavior References: <1428976613-13007-1-git-send-email-shreyas@linux.vnet.ibm.com> <1428976613-13007-4-git-send-email-shreyas@linux.vnet.ibm.com> <552CACD2.5060600@linux.vnet.ibm.com> In-Reply-To: <552CACD2.5060600@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15041408-0025-0000-0000-000004404CD5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> >> By default, fastsleep_workaround_state = dynamic. In this case, workaround >> is applied/undone everytime the core enters/exits fastsleep. >> >> fastsleep_workaround_state = applyonce. In this case the workaround is >> applied once on all the cores and never undone. This can be triggered by >> echo applyonce > /sys/devices/system/cpu/fastsleep_workaround_state > > I was wondering if we really need such an elaborate design for this > sysfs file. Why not a sysfs file called fastsleep_workaround_apply_once, > which is set to '0' by default and the only value that it can take is > '1' ? The name easily implies that the workaround is applied only once > if it is set. I can see that this can cut down a good chunk of code from > this patch. I just didn't find too much value in having so much code for > a simple 'on' knob. I was considering something similar too. But then moved to this format as I thought this was unambiguous. Also moving to a binary attribute will reduces code only in show_fastsleep_workaround_state which I don't feel is much. That said, if you feel strongly about it, I can change it to the format you suggested. Thanks, Shreyas