Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2834078imm; Thu, 24 May 2018 17:10:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrEqDmtT0II//y9Q8sN8KD6wcOJu4UImp4eN8IxriX7yU0oT7f0fm7bW/rK6VLPdocMJfPU X-Received: by 2002:a63:81c7:: with SMTP id t190-v6mr128006pgd.378.1527207043939; Thu, 24 May 2018 17:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527207043; cv=none; d=google.com; s=arc-20160816; b=RiyMO7bFgQuzEj3dm0CHKNI8CjiXT1lVi6gqqtIqeeyd+Azdt0vgGMXCUgQub70vHZ uXj4D2gNikPEsvXjWXv2i8JT+NsFpAzhufUQCYmIvWK+WSS6z6haWIyhFiFNfuA3wCQS IA5uVBYAHdN3u7hMrLoThGGCasOstSjgbW1QPscueLJWOG7JLln8iENT+2zXbPPTmps5 6m10cY5RMlEDILByRZzxVvKWb8LtyhsVgZyrYJHFaN+GA5fxI54UnGk50OuVYP4oUXvA mMpEuBGtgBVbpTF54PW8H/Rp95yy5F2zdOSoY3W9juQ79MIZNKOCOo3MgQWXexAdF1Zq B80Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=LfuttvmjzekczBrTg/Pit0jlSVhh3rttTbm57ks1B9Q=; b=JkTQm9T+ZHMDE0evt4yZH5thery1PjLYvyo9DGoJ91zit76QBSQO38ly5Ay01r/Dt5 nmnVyQsUfwESClX2RK+TBOkfRu6WRUJnI5X16PxGKdm7R349vpTi67xEZeBTeJkMKPQW bX1vwNVbOHL7EnPaPgAhD5ArbvwwV+xt/hTplPzSB+Zy+6i++Az7eJw9vQcpGia7t0mA hVrJJ5G8NijcGHuU8fTqr42ePsR848wfvg7Ujk2MiG+2UTa1ZfRG5Yxv9RzpdAaKVmmG KO8NqA4rxIpKQmMSe7z823iG0QUXL6VFKwaZHlaqVyUE7W7uEJf83EOgJ/205A+g0Jo9 3mKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QT2SUFnD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r6-v6si22692538pfi.147.2018.05.24.17.09.49; Thu, 24 May 2018 17:10:43 -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; dkim=pass header.i=@kernel.org header.s=default header.b=QT2SUFnD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969775AbeEXNsH (ORCPT + 99 others); Thu, 24 May 2018 09:48:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:33582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966066AbeEXNsF (ORCPT ); Thu, 24 May 2018 09:48:05 -0400 Received: from mail-qt0-f174.google.com (mail-qt0-f174.google.com [209.85.216.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 21F0820848; Thu, 24 May 2018 13:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527169685; bh=sxtSHw/vJsxj6L9AahW9hWcDSKB4j7ad5JoRTccl7OA=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=QT2SUFnDu7BtyfLASbG+StHW08oNgPJ0dn3I/yuf5GOepF/gl4dlZ7T6mZkREbH8/ LEyKjVV5N0vxyGN7P9J66hm5iGJsUNNUnz9VO80d44pvae27aPCUqAfaZwW123yU3H sNaV1CBfy22/WlSdRXEgWypGVkKRNBo5bvQyvN6Q= Received: by mail-qt0-f174.google.com with SMTP id f13-v6so2042368qtp.10; Thu, 24 May 2018 06:48:05 -0700 (PDT) X-Gm-Message-State: ALKqPwe/TYYWFBQ2kxCRcJg/7ZvqktrETtPGPjI7vYMrvC7mmk5LIA+s XtX+rGCe4DVuuS3R0Wqce4LtxI1pIeFVDJrl5Q== X-Received: by 2002:aed:26c3:: with SMTP id q61-v6mr7393476qtd.60.1527169684243; Thu, 24 May 2018 06:48:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9b02:0:0:0:0:0 with HTTP; Thu, 24 May 2018 06:47:43 -0700 (PDT) In-Reply-To: <8b56c103-fdab-fc98-f4d8-9bf435a9b59b@linux.intel.com> References: <20180521195905.27983-1-jae.hyun.yoo@linux.intel.com> <20180522164230.GA11707@rob-hp-laptop> <51752610-d2c1-7fbc-101e-e99346fa29e4@linux.intel.com> <22bd0e23-69ad-5858-656e-16c77007913c@linux.intel.com> <8b56c103-fdab-fc98-f4d8-9bf435a9b59b@linux.intel.com> From: Rob Herring Date: Thu, 24 May 2018 08:47:43 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [v4 07/11] dt-bindings: hwmon: Add documents for PECI hwmon client drivers To: Jae Hyun Yoo Cc: Mark Rutland , Haiyue Wang , Vernon Mauery , James Feist , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Andrew Jeffery , Arnd Bergmann , Jason M Biils , Joel Stanley Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 23, 2018 at 4:56 PM, Jae Hyun Yoo wrote: > On 5/23/2018 1:03 PM, Jae Hyun Yoo wrote: >> >> On 5/23/2018 12:33 PM, Rob Herring wrote: >>> >>> On Wed, May 23, 2018 at 11:37 AM, Jae Hyun Yoo >>> wrote: >>>> >>>> On 5/23/2018 8:11 AM, Rob Herring wrote: >>>>> >>>>> >>>>> On Tue, May 22, 2018 at 12:18 PM, Jae Hyun Yoo >>>>> wrote: >>>>>> >>>>>> >>>>>> On 5/22/2018 9:42 AM, Rob Herring wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Mon, May 21, 2018 at 12:59:05PM -0700, Jae Hyun Yoo wrote: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> This commit adds dt-bindings documents for PECI hwmon client >>>>>>>> drivers. >>>>>>>> >>>>>>>> Signed-off-by: Jae Hyun Yoo >>>>>>>> Reviewed-by: Haiyue Wang >>>>>>>> Reviewed-by: James Feist >>>>>>>> Reviewed-by: Vernon Mauery >>>>>>>> Cc: Andrew Jeffery >>>>>>>> Cc: Arnd Bergmann >>>>>>>> Cc: Jason M Biils >>>>>>>> Cc: Joel Stanley >>>>>>>> --- >>>>>>>> .../bindings/hwmon/peci-cputemp.txt | 23 >>>>>>>> ++++++++++++++++++ >>>>>>>> .../bindings/hwmon/peci-dimmtemp.txt | 24 >>>>>>>> +++++++++++++++++++ >>>>>>>> 2 files changed, 47 insertions(+) >>>>>>>> create mode 100644 >>>>>>>> Documentation/devicetree/bindings/hwmon/peci-cputemp.txt >>>>>>>> create mode 100644 >>>>>>>> Documentation/devicetree/bindings/hwmon/peci-dimmtemp.txt >>>>>>>> >>>>>>>> diff --git >>>>>>>> a/Documentation/devicetree/bindings/hwmon/peci-cputemp.txt >>>>>>>> b/Documentation/devicetree/bindings/hwmon/peci-cputemp.txt >>>>>>>> new file mode 100644 >>>>>>>> index 000000000000..2f59aee12d9e >>>>>>>> --- /dev/null >>>>>>>> +++ b/Documentation/devicetree/bindings/hwmon/peci-cputemp.txt >>>>>>>> @@ -0,0 +1,23 @@ >>>>>>>> +Bindings for Intel PECI (Platform Environment Control Interface) >>>>>>>> cputemp >>>>>>>> driver. >>>>>>>> + >>>>>>>> +Required properties: >>>>>>>> +- compatible : Should be "intel,peci-cputemp". >>>>>>>> +- reg : Should contain address of a client CPU. Address >>>>>>>> range >>>>>>>> of >>>>>>>> CPU >>>>>>>> + clients is starting from 0x30 based on PECI >>>>>>>> specification. >>>>>>>> + >>>>>>>> +Example: >>>>>>>> + peci-bus@0 { >>>>>>>> + #address-cells = <1>; >>>>>>>> + #size-cells = <0>; >>>>>>>> + < more properties > >>>>>>>> + >>>>>>>> + peci-cputemp@30 { >>>>>>>> + compatible = "intel,peci-cputemp"; >>>>>>>> + reg = <0x30>; >>>>>>>> + }; >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> [...] >>>>>>> >>>>>>>> + peci-dimmtemp@30 { >>>>>>>> + compatible = "intel,peci-dimmtemp"; >>>>>>>> + reg = <0x30>; >>>>>>>> + }; >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> As I said in the prior version, 2 nodes at the same address is wrong. >>>>>>> >>>>>>> Rob >>>>>>> >>>>>> >>>>>> In PECI bus, there is one and only bus host (adapter) and multiple >>>>>> clients on a PECI bus, and PECI spec doesn't allow multiple >>>>>> originators >>>>>> so only the host device can originate message. >>>>> >>>>> >>>>> >>>>> Yes, I get that. A single host still has to address slave devices. >>>>> >>>>>> In this implementation, >>>>>> all message transactions on a bus from client driver modules and user >>>>>> space will be serialized well in the PECI core bus driver so bus >>>>>> occupation and traffic arbitration will be managed well in the PECI >>>>>> core >>>>>> bus driver even in case of a bus has 2 client drivers at the same >>>>>> address. I'm sure that this implementation doesn't make that kind of >>>>>> problem to OS. >>>>> >>>>> >>>>> >>>>> Multiple clients to a single device is common, but that is a software >>>>> problem and doesn't belong in DT. >>>>> >>>>> I don't think there is a single other case in the kernel where >>>>> multiple drivers can bind to the same device at a given bus address. >>>>> That is why we have things like MFD. Though in this case, why can't >>>>> one hwmon driver register multiple hwmon devices (cpu and dimm temps)? >>>>> >>>> >>>> It was implemented as a single driver until v2 but dimm temps need >>>> delayed creation unlikely the cpu temps on hwmon subsystem because of >>>> memory training behavior of remote x86 cpus. Since hwmon doesn't allow >>>> incremental creation, I had to divide it into two, cputemp and dimmtemp, >>>> so that cputemp can be registered immediately when the remote x86 cpu >>>> turns on and dimmtemp can be registered by delayed creation. It is the >>>> reason why I had to make the two hwmon driver modules that sharing a >>>> single device address. >>> >>> >>> That all sounds like kernel problems to me. Stop designing your DT >>> binding around what the kernel can or can't *currently* support. >>> >>>> Additionally, PECI isn't limited for temperature >>>> monitoring feature but it can be used for other functions such as >>>> platform management, cpu interface tuning and diagnostics and failure >>>> analysis, so in case of adding a new driver for the functions, we should >>>> add an another DT node which is sharing the same cpu address. >>> >>> >>> No, the driver should add support for those additional functions. >>> Perhaps you will need to use MFD. >>> >> >> Do you mean that the device address sharing is acceptable if I make >> these nodes under "simple-mfd"? >> >> Thanks, >> >> -Jae > > > Hi Rob, > > I'm planning to change the whole PECI node like below: > > peci: peci@1e78b000 { > compatible = "simple-bus"; > #address-cells = <1>; > #size-cells = <1>; > ranges = <0x0 0x1e78b000 0x60>; > > peci0: peci-bus@0 { > compatible = "aspeed,ast2500-peci"; > reg = <0x0 0x60>; > #address-cells = <1>; > #size-cells = <0>; > interrupts = <15>; > clocks = <&syscon ASPEED_CLK_GATE_REFCLK>; > resets = <&syscon ASPEED_RESET_PECI>; > clock-frequency = <24000000>; > msg-timing = <1>; > addr-timing = <1>; > rd-sampling-point = <8>; > cmd-timeout-ms = <1000>; > status = "disabled"; > > peci-client@30 { > compatible = "simple-mfd", "syscon"; These compatibles alone is not correct. There should be a specific compatible for the device. Also, I don't think "syscon" even makes sense in this case. > reg = <0x30>; > > cputemp: cputemp { > compatible = "intel,peci-cputemp"; > }; There is no point in this node being in DT. It doesn't define any resources. All it does is provide you a convenient way to bind your driver, but that is not the purpose of DT. Put a specific compatible in the parent and its driver can instantiate whatever child devices it wants. Rob