Return-Path: Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.intel.com (client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=haiyue.wang@linux.intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40Mn7C1cfDzF1Rt; Fri, 13 Apr 2018 15:55:18 +1000 (AEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2018 22:55:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,444,1517904000"; d="scan'208";a="220088159" Received: from haiyuewa-mobl1.ccr.corp.intel.com (HELO [10.239.196.80]) ([10.239.196.80]) by fmsmga006.fm.intel.com with ESMTP; 12 Apr 2018 22:55:13 -0700 Subject: Re: openbmc Digest, Vol 32, Issue 32 To: Benjamin Herrenschmidt , openbmc@lists.ozlabs.org, openbmc-request@lists.ozlabs.org, Andrew Jeffery , Joel Stanley References: <45b6959c-5743-744f-d4d6-4f40984f1323@linux.intel.com> <1523521249.11062.168.camel@kernel.crashing.org> <5b09c4c7-e730-df2a-9b48-9787f5dcb620@linux.intel.com> <1523594598.11062.191.camel@kernel.crashing.org> <94260b45-7adc-a9ff-6300-e5bd3bd359bb@linux.intel.com> <1523598098.11062.202.camel@kernel.crashing.org> From: "Wang, Haiyue" Message-ID: <62a5aaf4-af21-b0a7-63e3-24f6a5d049ad@linux.intel.com> Date: Fri, 13 Apr 2018 13:55:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1523598098.11062.202.camel@kernel.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 05:55:20 -0000 On 2018-04-13 13:41, Benjamin Herrenschmidt wrote: > On Fri, 2018-04-13 at 13:11 +0800, Wang, Haiyue wrote: >> On 2018-04-13 12:43, Benjamin Herrenschmidt wrote: >>> On Thu, 2018-04-12 at 16:42 +0800, Wang, Haiyue wrote: >>>> I means the device tree merge time, putting things in kernel need long time >>>> to be passed code review. And people may want to export different range of >>>> registers, then they need to change the device tree, the development cycle >>>> may be long. >>> But that's not a big issue in practice though, you don't*need* all >>> your device-trees to be upstream and up to date especially if it's >>> stored separately from the kernel. >>> >>> Keep in mind this should be strictly limited to a few registers that >>> need that sort of manipulation, maybe a handful or two, that's it. >>> >>> Most things need proper kernel drivers. >>> >> Understood, NOT exposing like /dev/mem makes sense for security > Not just security. It's also plain gross ;-) > > It also means it's hard to locate which pieces of your userspace may > contain chip revision specific stuff. > > If something changes, you get a nice error bcs the named file is absent > rather than whacking the wrong register with underterminate results. > > The naming also makes the code more comprehensible & grep'able > > You also have an atomicity problem is the same register contains > multiple things that several fields (kernel, userspace) try to modify > at the same time, etc etc etc... > > It's never great to have userspace bang at the registers so directly. Yes, absolutely agree with this point. Another big thing I missed. ;-) > etc etc etc.. > > A minimum of abastraction is much more preferable in these cases. > > Cheers, > Ben. Very appreciate your time to talk more about this design. Thank you. BR, Haiyue