From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFA62C433DB for ; Thu, 25 Feb 2021 16:45:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B54EE64F03 for ; Thu, 25 Feb 2021 16:45:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233644AbhBYQo7 (ORCPT ); Thu, 25 Feb 2021 11:44:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233491AbhBYQn6 (ORCPT ); Thu, 25 Feb 2021 11:43:58 -0500 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88507C0617AA; Thu, 25 Feb 2021 08:42:52 -0800 (PST) Received: by mail-ot1-x329.google.com with SMTP id g8so2639613otk.4; Thu, 25 Feb 2021 08:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vF7Sr8k6T1GIk11C2IVF7kon90r3481y7roC0/ZPwhg=; b=mAu36UQooRjl3tsctsIBh3jB6R1Omw0/dQOmKEBz636LJYpvPWvb+oUAfDIb2eMc0w cM798f5Bm/1ykvy5GOLMqOylxHPJbGLFkgzGwuGOHwfr72lEIA69PUqgWUmeMFvVQUYC iLu1H73SkK6v7Pkiey/XHSDOQjyZS+YrptvLyt8rLIl2M2oqWw21Hv5jWc3qruJtbiJk gHM7e3o4c849feRLbbhICd7rxeiwdNJl+788qCO9qN2qrMW5KiaTRm69d/os0JyYcxyu kPf+ZwpX5dyn/i5iy09DAQ14RF+LQ2PPXNxiCA+nRuyPBhYY88yuF/SbBv1Gfx0P/ias gsOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=vF7Sr8k6T1GIk11C2IVF7kon90r3481y7roC0/ZPwhg=; b=Zsk4BK4WlCekvwptQ0sXEy9s8bUxQ2xX0YrXW6nHV2KKw6J3QZpk4uk4tWlTWHJ/w5 ztjt5TXon0ymwSQf3r7ka4ue8A/7E94qwCLkOrlbFEiSEPmsFjJYXXqpzMmvWHPAxXhP A2+/2r9b474gS1IHorcVbFuWowrWi/JSYVOjAEhxBRcyzGavITmQmX0ArbiSUXegO+p8 2+cPD6Uo3q9sBKQzzTp8s/X73MFR/smF4OfL5dHc9+TLQN3FMT4JVpRygsW19Y/Mo+Sz OdQ09jO2nzluNr59T9e9zEMRP9p4XTDKD/gykd78+WqY2ktSsiVcdr7wIORks62fwWoo aT/g== X-Gm-Message-State: AOAM530dtxuOQIhDHa4VhoK2DPpWKe/O18I/w05S+TB1fRE9ci7I0HVG YAc0DBFE90ybf969IY6ua0A= X-Google-Smtp-Source: ABdhPJwbI7qWysZeUMz3ZE0h5wFCF7D78MHpK9XO1djLaiz1MMmG9BHm8+5LkrNLp5Ppq8T+j25VRw== X-Received: by 2002:a9d:1465:: with SMTP id h92mr2936956oth.141.1614271371869; Thu, 25 Feb 2021 08:42:51 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id u15sm995990oiu.28.2021.02.25.08.42.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Feb 2021 08:42:51 -0800 (PST) Sender: Guenter Roeck Subject: Re: [PATCH 4/4] docs: hwmon: (smpro-hwmon) Add documentation To: Quan Nguyen , Joel Stanley , Andrew Jeffery , Jean Delvare , Rob Herring , Lee Jones , Jonathan Corbet , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org Cc: Open Source Submission , Phong Vo , "Thang Q . Nguyen" References: <20210225101854.13896-1-quan@os.amperecomputing.com> <20210225101854.13896-5-quan@os.amperecomputing.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNy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FBtKNPtj2EE4DNV4s7k0Zy+6iRQ8G8ng QjsSqYJx8iAR8JRB7Gm2rQOMv8lSRdjva++GT0VLXtHULdlzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: <00d6d57e-86a4-bd61-335c-3ff42c0dc1f7@roeck-us.net> Date: Thu, 25 Feb 2021 08:42:48 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210225101854.13896-5-quan@os.amperecomputing.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 2/25/21 2:18 AM, Quan Nguyen wrote: > Add documentation for the Ampere(R)'s Altra(R) SMpro hwmon driver. > > Signed-off-by: Thu Nguyen > Signed-off-by: Quan Nguyen > --- > Documentation/hwmon/index.rst | 1 + > Documentation/hwmon/smpro-hwmon.rst | 100 ++++++++++++++++++++++++++++ > 2 files changed, 101 insertions(+) > create mode 100644 Documentation/hwmon/smpro-hwmon.rst > > diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst > index 8d5a2df1ecb6..b48a980ed08b 100644 > --- a/Documentation/hwmon/index.rst > +++ b/Documentation/hwmon/index.rst > @@ -164,6 +164,7 @@ Hardware Monitoring Kernel Drivers > sis5595 > sl28cpld > smm665 > + smpro-hwmon "hwmon" seems a bit redundant here. > smsc47b397 > smsc47m192 > smsc47m1 > diff --git a/Documentation/hwmon/smpro-hwmon.rst b/Documentation/hwmon/smpro-hwmon.rst > new file mode 100644 > index 000000000000..d546b90982e5 > --- /dev/null > +++ b/Documentation/hwmon/smpro-hwmon.rst > @@ -0,0 +1,100 @@ > +.. SPDX-License-Identifier: GPL-2.0-or-later > + > +Kernel driver Ampere(R)'s Altra(R) SMpro hwmon > +============================================== > + > +Supported chips: > + > + * Ampere(R) Altra(R) > + > + Prefix: 'smpro' > + > + Reference: Altra SoC BMC Interface Specification > + > +Author: Thu Nguyen > + > +Description > +----------- > +This driver supports hardware monitoring for Ampere(R) Altra(R) SoC's based on the > +SMpro co-processor (SMpro). > +The following sensor types are supported by the driver: > + > + * temperature > + * voltage > + * current > + * power > + > +The SMpro interface provides the registers to query the various sensors and > +their values which are then exported to userspace by this driver. > + > +Usage Notes > +----------- > + > +SMpro hwmon driver creates two sysfs files for each sensor. > + > +* File ``_label`` reports the sensor label. > +* File ``_input`` returns the sensor value. > + > +The sysfs files are allocated in the SMpro root fs folder. > +There is one root folder for each SMpro instance. > + > +When the SoC is turned off, the driver is failed to read the registers. > +It returns TIMEDOUT Error(-110) for the read sensors. > + Maybe better something like When the SoC is turned off, the driver will fail to read registers and return -ETIMEDOUT. Can that indeed happen ? That seems to be highly undesirable. > +Sysfs entries > +------------- > + > +The following sysfs files are supported: > + > +* Ampere(R) Altra(R): > + > +=============== ============= ======= =============================================== > +Name Unit Perm Description > +temp1_input mili Celsius RO SoC temperature s/mili/milli/ throughout > +temp2_input mili Celsius RO Highest temperature reported by the SoC VRDs > +temp3_input mili Celsius RO Highest temperature reported by the DIMM VRDs > +temp4_input mili Celsius RO Highest temperature reported by the Core VRDs What does "highest" stand for here ? Is it the _current_ highest temperature, added up by the hardware/firmware, or is it the historic highest temperature ? Historic data should be reported as tempX_highest. > +temp5_input mili Celsius RO Highest temperature of DIMM Channel 0 to 3 drop; reported individually. > +temp6_input mili Celsius RO Temperature of DIMM0 on CH0 > +temp7_input mili Celsius RO Temperature of DIMM0 on CH1 > +temp8_input mili Celsius RO Temperature of DIMM0 on CH2 > +temp9_input mili Celsius RO Temperature of DIMM0 on CH3 > +temp10_input mili Celsius RO Highest temperature of DIMM Channel 4 to 7 drop; reported individually. > +temp11_input mili Celsius RO Temperature of DIMM0 on CH4 > +temp12_input mili Celsius RO Temperature of DIMM0 on CH5 > +temp13_input mili Celsius RO Temperature of DIMM0 on CH6 > +temp14_input mili Celsius RO Temperature of DIMM0 on CH7 > +temp15_input mili Celsius RO MEM HOT Threshold > +temp16_input mili Celsius RO SoC VRD HOT Threshold Report as tempX_max or tempX_crit, as appropriate (eg temp2_max or temp2_crit for SoC VRD HOT Threshold). If there is a single threshold temperature for all DIMMs, report the same limit value for all DIMM temperature sensors. > +temp17_input mili Celsius RO Highest temperature reported by the RCA VRD Same question about "highest" as above. Either "highest" is inappropriate, or there are multiple RCA VRDs and only the highest temperature of those is reported (which should be explicitly stated). > +in0_input mili Volt RO Core voltage > +in1_input mili Volt RO SoC voltage > +in2_input mili Volt RO DIMM VRD1 voltage > +in3_input mili Volt RO DIMM VRD2 voltage > +in4_input mili Volt RO Maximum voltage of DIMM VRD1 and VRD2 drop; reported individually. > +in5_input mili Volt RO RCA VRD voltage > +cur1_input mili Ampere RO Core VRD current > +cur2_input mili Ampere RO SoC VRD current > +cur3_input mili Ampere RO DIMM VRD1 current > +cur4_input mili Ampere RO DIMM VRD2 current > +cur5_input mili Ampere RO RCA VRD current > +power1_input nano Wat RO Core VRD power Expected scale is micro-Watt. > +power2_input nano Wat RO SoC VRD power > +power3_input nano Wat RO DIMM VRD1 power > +power4_input nano Wat RO DIMM VRD2 power > +power5_input nano Wat RO CPU VRD power, total of SoC and Core VRD power drop > +power6_input nano Wat RO Total of DIMM VRD1 and VRD2 power drop > +power7_input nano Wat RO RCA VRD power > +power8_input nano Wat RO Socket TDP Report as max attribute > +=============== ============= ======= =============================================== > + > +Example:: > + > + # cat in0_input > + 830 > + # cat temp1_input > + 37000 > + # cat curr1_input > + 9000 > + # cat power5_input > + 19500000 >