Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1238210imm; Wed, 23 May 2018 12:35:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr8kuEIuj4lDP3kxJe9Tg+rBKeWsluFZUTdAkRgU2gkg2/AKoI2yxGVc1CRE61TIFyAFCGO X-Received: by 2002:a63:6887:: with SMTP id d129-v6mr3407109pgc.128.1527104135027; Wed, 23 May 2018 12:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527104134; cv=none; d=google.com; s=arc-20160816; b=AQig0mh7SUtaxAEiUenwiU6LrG6JIKFZOjv+ZrFGLi2HYvx8M2WYT5f+PxUvKIBPjC t/h0ShwxRhN/5+v8e62lS18OtqqzVAyOgv50+oYLlNOoPJNcZilQwV8fppPQpV47B4MX yUDEvqsgP5FxBAU41isZ3jiSskVMU2OvnNl0XERkRX2fqCqKMA+UpEwNXcA/Nl4k8yC+ QmgE05ZpROoMPuaoTvgzEkTCPTiQoKpUSMxNiD10Bnz5tH6p19i6RtXMq8tPx914mqqp dbXi6dSuH1gQL5O9lG31FxO2NW9FxIjHtWQbBxUhruh/fB6nw0smzQisyipIe2bECDV0 aEeA== 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=oujoSf5TOOSckZkZmXPId//dKQCgfm6ox+K5nzgRTZU=; b=SlopD9h8yiRj9DpZqKXkvgFAbOYmrCEhOQaGWvJwPvumOfrNaWM4iS7uxXhnCSlk5F XeI+OGgfH53R6rYbO5dwkC50pmP/AMbezEBuYPtigaybJwlFD+HReno0DX5Tl8NuCpNB 7EeBk1LQsyy81z4xok8wHEyJD4rkjgFCBJEagyPupLeZJJSfMHD81g3RrqEhrwT1CWnn Kvel/69sxzBG8bz4ZblPDFpPXfiUajTvJ9JxwO/GNtys2lIne9+9yjDwEpThmyuLcjoG fC/OzO8x6qlFZdUw0QR7+6PruZjPge6b8LADzn/mDMLEZo6Ycjzs2G9VqRJlfLOtWT7E u+vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WreYA2S8; 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 m11-v6si15394396pgt.565.2018.05.23.12.35.20; Wed, 23 May 2018 12:35:34 -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=WreYA2S8; 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 S934361AbeEWTd6 (ORCPT + 99 others); Wed, 23 May 2018 15:33:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:40976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934288AbeEWTdv (ORCPT ); Wed, 23 May 2018 15:33:51 -0400 Received: from mail-qt0-f182.google.com (mail-qt0-f182.google.com [209.85.216.182]) (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 2B3E020873; Wed, 23 May 2018 19:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527104031; bh=THpMrR11Evv7onx5Rw1BhQuDtGo+YEqvXle+KexNCNo=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=WreYA2S8cBEDuu2JTV0wtpwnziSMjwOMDtDPuA7gBdVYzUfieIruJ4QF4nkJujbTm xZt+kKslawVHaUhlkDED+FqWubTgyxxHsvihGprlD27RTtv6m/OEvDYRQFNwoNHMLb 8XU9wf7U/iWujFO2lo+9GvLE+hZKySrnJC6WtZYw= Received: by mail-qt0-f182.google.com with SMTP id m9-v6so29654767qtb.5; Wed, 23 May 2018 12:33:51 -0700 (PDT) X-Gm-Message-State: ALKqPwc5zgCedXepINe1lZqxCp1WZQ+rU2XA2JG+iVSafosyhxt4IU7Q oTuyIz2oXXenD2iWgHvJT5WkkGNNec/yBOuIzw== X-Received: by 2002:aed:3a46:: with SMTP id n64-v6mr4161529qte.118.1527104025397; Wed, 23 May 2018 12:33:45 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9b02:0:0:0:0:0 with HTTP; Wed, 23 May 2018 12:33:24 -0700 (PDT) In-Reply-To: <51752610-d2c1-7fbc-101e-e99346fa29e4@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> From: Rob Herring Date: Wed, 23 May 2018 14:33:24 -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 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. Rob