Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1282033imm; Wed, 18 Jul 2018 21:37:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpclIl3Qu18gBhQ0w6JfIEwOp8veT+W0ICTaLUS8V5fSdgHQedZ0Coc7/uxYoRo28eSuLY2r X-Received: by 2002:a17:902:5857:: with SMTP id f23-v6mr8609011plj.206.1531975027966; Wed, 18 Jul 2018 21:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531975027; cv=none; d=google.com; s=arc-20160816; b=Opc++ipAfRt28WPqr0ZWWomNzz1ZoayimeSXSb7C/k1QTSfG7aHy/oga8DnxlUYT/i 3rZN5hi8xa4Hg5wcs9xFkF0g0jAZjkKDz90lkUzUepRDSEk66DiJJrrzOfwfMKD6zT7S plgagYxL+yRl/l2PatEF26cB4iZgg8Y2P/nZ/yjG+VuuIpT+U8fQwJ7rFlIlNhbt1daJ 19Zn0lB7vulmSudJyzMEFZMCCKPHVjrg72yB7igAbpFOyYUNsfI2OlJidQA23R820Zh2 uoSpXo/1l9CfGP1tP3psQm3OH7dp9ZOybPML2aTaDsZ6p2FbITzheYkN3hUUA3gHXmrV fgHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=r6aDqUmCr84OZmm31/BXVYWuhc6rfAghfc95waNRvcQ=; b=QLadWIevVoqUS76xcetF978tGxF0rm16hnSlG/WUhLnt1AcxEOm+YZQDXW/0LqbjB7 U+JJYTGYSgNvOBIaLpe6aJHckUqwkK+d/27hIISyr/rAUL7r57eTUFDw0hiE3FBYm1Cj MAsC0QC0yzQtQBxCAM4q8ApmWc0chMkrD5kT/2wYlyZrmhv7VFJYhszw4gE//m0UrMND PIu1U3R1BUeTqGgHqzHudhMKfCKtBCXdEX0exDJ+VggJvk/jHZjUyg5NmeGJpDiZQQU7 s/3wzDihOsUClJgcdSQlW/qBXBRQufPhbduRIkLkztDb5oyNXyArL+HlYTmBJLKBLp4V 4mGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e186-v6si5010323pfc.176.2018.07.18.21.36.53; Wed, 18 Jul 2018 21:37:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727475AbeGSFRT (ORCPT + 99 others); Thu, 19 Jul 2018 01:17:19 -0400 Received: from gate.crashing.org ([63.228.1.57]:59530 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbeGSFRT (ORCPT ); Thu, 19 Jul 2018 01:17:19 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w6J4ZOEF020357; Wed, 18 Jul 2018 23:35:25 -0500 Message-ID: <9787b471abc49c0b3db60e3471473a7a5b45ade7.camel@kernel.crashing.org> Subject: Re: [RFC PATCH v2 1/4] dt-bindings: misc: Add bindings for misc. BMC control fields From: Benjamin Herrenschmidt To: Andrew Jeffery , Rob Herring Cc: Mark Rutland , devicetree@vger.kernel.org, Greg Kroah-Hartman , Eugene.Cho@dell.com, a.amelkin@yadro.com, linux-kernel@vger.kernel.org, Joel Stanley , stewart@linux.ibm.com, OpenBMC Maillist , linux-arm-kernel@lists.infradead.org Date: Thu, 19 Jul 2018 14:35:24 +1000 In-Reply-To: <1531967302.2140539.1445583600.0F5ED287@webmail.messagingengine.com> References: <20180711053122.30773-1-andrew@aj.id.au> <20180711053122.30773-2-andrew@aj.id.au> <20180711200450.GB17291@rob-hp-laptop> <1531356830.3551458.1437853280.551CA8C5@webmail.messagingengine.com> <1531463489.747186.1439263128.075AECE1@webmail.messagingengine.com> <1531967302.2140539.1445583600.0F5ED287@webmail.messagingengine.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.3 (3.28.3-1.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-07-19 at 11:58 +0930, Andrew Jeffery wrote: > > > I agree > > > that not using /dev/mem is a good thing, but there are several ways > > > you could do that independent of any DT binding. > > > > Such as ? The only other option is to have one or more kernel drivers > > that have built-in the precise and complete list of those tunables that > > need to be exposed. > > > > It's not impossible, but I worry that it's not going to scale terribly > > well, and that vendors will constantly "fork" that driver to add > > different things to that list. > > Picking on that last point, "different things" doesn't necessarily > mean "different fields in the SoC" (though it may). We could just > need to use different initial values for the fields already > described. I don't worry about initial values too much. Those could be specified by userspace. It would be trivial to have something akin to /etc/sysctl.conf that contains the initial values and a script blasting them early. In fact I prefer this being in userspace to be frank. It could be in the initramfs if we want it done early enough, maybe with a usermode helper. Unless we have some demonstrable reasons why some of these must be set before the various kernel drivers initialize. > So taking that into account, the field descriptions could vary wildly > from platform to platform - where "platform" here is the combination > of the BMC, its host system, and the host system's required > configuration - not just referring to the BMC in isolation. That in > turn may cause a fork of the driver (changes that are incompatible > with other platforms), or not scale terribly well as Ben suggests. I really only worry about the actual set of registers/fields. I think folding in initial values goes a bit too far. > The initial value concept can help reduce the impact on userspace as > userpace may no-longer need to care about it, so I think it's a > desirable property. I don't worry too much about userspace containing system specific bits and pieces such as a config file with the appropriate initial values for the platform. Userspace will have to contain platform specific stuff regardless (if anything, stuff like thermal control is intrinsicly different from one platform to the next). > With respect to devicetree, the field definitions will stay in the > SoC dtsi, but the initial values would be described on a per-platform > basis in the dts. If the fields are in the SoC dtsi, then Rob has a reasonable argument that the list of fields is rather fixed for a given SoC and thus could be hard wired in the driver.... I think at this stage, we need to create more clarity. In order to do that, I think we need to come up with a list, as exhaustive as we can, of what are the fields/register we need for our platforms, and find any reason why userspace wouldn't be a good enough location to stick the initial values. Then we need Dell and Yadro (and maybe others) to help with their variant of that list for the same SoCs to begin with. With that, we'll get an idea of whether we think we can get a reasonable stable long term list that's appropriate for most vendors. If that's the case, then my objections to have it in the kernel instead of the DT fade away a bit. If one or two of those fields absolutely must have their defaults early, then we can consider a specific set of one or two properties in the SoC node for that SoC family that provides those specific defaults. But unless we have that list, I think we'll be throwing too many hypotheticals around to convince Rob and others. Andrew, can you start with a list that shows what you expect us to need on our systems ? Cheers, Ben