From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751536AbbIKA6t (ORCPT ); Thu, 10 Sep 2015 20:58:49 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:63995 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbbIKA6r (ORCPT ); Thu, 10 Sep 2015 20:58:47 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-44-55f227436e3a Subject: Re: [PATCH] power: bq24261_charger: Add support for TI BQ24261 charger To: "Andrew F. Davis" , "Pallala, Ramakrishna" References: <1441560187-23611-1-git-send-email-ramakrishna.pallala@intel.com> <55F0C522.6070705@samsung.com> <55F1B2FD.4020608@ti.com> Cc: "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , "devicetree@vger.kernel.org" , Sebastian Reichel , "Tc, Jenny" , Andreas Dannenberg From: Krzysztof Kozlowski Message-id: <55F22740.4080003@samsung.com> Date: Fri, 11 Sep 2015 09:58:40 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-version: 1.0 In-reply-to: <55F1B2FD.4020608@ti.com> Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRmVeSWpSXmKPExsVy+t/xa7rO6p9CDa4utLZ4f2oiu8XqK1PY LeYfOcdqsfZrD7vF6xeGFpd3zWGz+Nx7hNFi4ZubTBand5c4cHos3vOSyWPTqk42j74tqxg9 jt/YzuTxeZNcAGsUl01Kak5mWWqRvl0CV8bvfVuYCy4LVrTs+s7cwNjB18XIySEhYCJxdOF0 NghbTOLCvfVANheHkMBSRolLt2ewQjhfGCW6Pm8DqxIW8Jc42f6cEcQWEYiR2Lh1ChOILSQw k0liyyp3EJtZYCWTxIwV2SA2m4CxxOblS4B6OTh4BbQkTkyTBQmzCKhKzD70hBnEFhWIkDh1 9i3YeF4BQYkfk++xgNicAmoSU5+tBmtlFlCXmDIlF2K6vMTmNW+ZJzAKzELSMQuhahaSqgWM zKsYRVNLkwuKk9JzDfWKE3OLS/PS9ZLzczcxQgL+yw7GxcesDjEKcDAq8fBaqH4KFWJNLCuu zD3EKMHBrCTCayAHFOJNSaysSi3Kjy8qzUktPsQozcGiJM47d9f7ECGB9MSS1OzU1ILUIpgs EwenVANj9NnWGRsbe/xObczqlrweOvH73DL+6+s6X5+2CdoydXMNX2T9q3P57Htue2xaszTb /MCZvrDFIbkRVWs4jUxVfRgFQ7q8P1TNcW7g8r2jN+2Gi2HVOf1uPU+vqJ6lh3dX8YiW/w49 LfR2di7/vKDCZ6y3I3bHGP+YnsRqdLP6mWaIS1sRq7USS3FGoqEWc1FxIgD9YPu7dAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11.09.2015 01:42, Andrew F. Davis wrote: > On 09/09/2015 06:47 PM, Krzysztof Kozlowski wrote: >>>>> +- ti,enable-user-write: boolean, if present driver will allow the >>>>> user space >>>>> + to control the charging current and voltage through sysfs; >>>> >>>> This is not DT property. It does not describe hardware. >>> We needed a mechanism to enable the sysfs writes on certain properties. >>> If DT is not the place where should it go? >> >> DT is not the place. As I discussed later with Andreas, if you really >> need this and if mainline is a place for that then probably this should >> be compile option (a Kconfig symbol). >> > > I think this would actually be a good use for module parameters, this way > it could still be set at boot without re-compiling. > > I think compile-time disabling sysfs properties because they are > "dangerous" is > a little bit too artificially restricting and controlling, you can set > permissions > so only root can change them already. The kernel should not be > restricting root, > I understand the fear of someone rooting a machine and remotely over > charging > a LiPo[1], but these physical limits are hardware descriptions and can > and should > be set by DT, beyond this root should have full control over their machine. Indeed module parameters could be used for enabling/disabling debug options... but as fair as I understand these are for purely development purposes. That is why they got into DT initially, right? To allow the developer to play with it on the development board? This is why I am really not convinced that this should go to mainline. Anyway if it goes, then maybe compiling it out is the safest choice? What's the purpose of having it in kernel all the time? If this was a debug option, than some experienced user could turn it on and report to LKML with extended debug data. But it's not a debug but development option? > Besides root can already just unbind your driver and issue raw I2C > commands to do > the same thing. > > [1] http://i.imgur.com/vszJJ.jpg Oh, these weird sickos... That's why I am using IPoAC and always check the bits by myself for weird looking I2C commands. :) Best regards, Krzysztof