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=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 8C633C433E9 for ; Tue, 16 Mar 2021 20:07:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60B6F64F70 for ; Tue, 16 Mar 2021 20:07:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240784AbhCPUHR (ORCPT ); Tue, 16 Mar 2021 16:07:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240775AbhCPUGw (ORCPT ); Tue, 16 Mar 2021 16:06:52 -0400 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39986C06174A; Tue, 16 Mar 2021 13:06:52 -0700 (PDT) Received: by mail-ot1-x32c.google.com with SMTP id l11so6154256otq.7; Tue, 16 Mar 2021 13:06:52 -0700 (PDT) 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=JuEjsE/RQ7aK7Knake7e4xVNMHMxV/R6u7Uv4C4ReeI=; b=f2TCyvl1YeRyq3H3nzZL9r4I+omOazRcZfgjwKhHGV5Tqjf7VaFsWv5WBh/O1D4pSr sXTd183iEjqtmSV1+K1AdS05ym5eRFPXAYqTUH64jIQGMfD41o2VXvVX6ZPlK3AJoseY J4dJ7wwYTAZvAS1tiviyReWoONWblrLHlJKvYb+DynEgIjAH8qd+zE3PiY6SB9E0XtoP 2bzAewawrwfRiDVcWZwED70gZ9Us634uPlXiUCpsT5A2zhMcwxNsq2MlMCeAM64LO/1Y I6HBgVcBsKl8fjc7JgjzZKa8hFAM2rKvJFLoXYhSZJP/i43uHjLDDuj3VxzHPdo/6t/3 a1EA== 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=JuEjsE/RQ7aK7Knake7e4xVNMHMxV/R6u7Uv4C4ReeI=; b=ec0bZzYDLUKpvkXRSuaiR35P2OBjB6TzM43VUcuhWBDKEpyPF4SFKSaZlBUejfLkYj 4ljdu9s3qvSMrRFza1Oqt8MGHpkp2ZSEFzt/LRChaJz34dbEvhrlcMpJOIpsJLrUceLC olfF/xyO1uICHDTQH55C1xkfSA+TmgGV8lkySzEJeLf8/hI2C7h8J3bxwnrGf/g3JuZm DTXklpdnKBpVnE0eLknAf02jKOSpTuzJWLIPBnhs2UVQWgZB/hWpmy7Ou85Sz50uFcCR jzn+GDrj3WM4u7WIzJW6lUSm2LT1kQScqYkgRHZLbOzck/t64M0jVwCZ/zkx/JAxy28d iUHw== X-Gm-Message-State: AOAM5317IU/Tm5yQcTqUpTesr1Hmno8AzhLVtuZYmtxt513jDrAu6pfV w7dhye145lOPb/OXPFBABPIiFRIeXto= X-Google-Smtp-Source: ABdhPJwBUXcjX7HUWZUQywrVCsFo5UaV7rajtmCIo9/M40UOU6De2ahKDaQh/QyCnEsJ0XfeVjiYDQ== X-Received: by 2002:a9d:6a91:: with SMTP id l17mr371897otq.297.1615925211269; Tue, 16 Mar 2021 13:06:51 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id g61sm8152898otb.65.2021.03.16.13.06.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Mar 2021 13:06:50 -0700 (PDT) Sender: Guenter Roeck Subject: Re: [PATCH v2] hwmon: corsair-psu: add support for critical values To: Wilken Gottwalt Cc: linux-kernel@vger.kernel.org, Jean Delvare , Jonathan Corbet , linux-hwmon@vger.kernel.org References: <20214c50-5c58-0d3e-5de5-115ed022750e@roeck-us.net> <20210315175509.55672ee7@monster.powergraphx.local> <20210316152150.5a712927@monster.powergraphx.local> 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+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPF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jv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: <3141c950-7764-4285-0e60-eef093ba3513@roeck-us.net> Date: Tue, 16 Mar 2021 13:06:48 -0700 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: <20210316152150.5a712927@monster.powergraphx.local> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/16/21 7:21 AM, Wilken Gottwalt wrote: > On Mon, 15 Mar 2021 11:00:53 -0700 > Guenter Roeck wrote: > >> On 3/15/21 9:55 AM, Wilken Gottwalt wrote: >>> On Mon, 15 Mar 2021 08:53:25 -0700 >>> Guenter Roeck wrote: >>> >>>> On 3/15/21 8:02 AM, Wilken Gottwalt wrote: >>>>> Adds support for reading the critical values of the temperature sensors >>>>> and the rail sensors (voltage and current) once and caches them. Updates >>>>> the naming of the constants following a more clear scheme. Also updates >>>>> the documentation and fixes a typo. >>>>> >>>>> The new sensors output of a Corsair HX850i will look like this: >>>>> corsairpsu-hid-3-1 >>>>> Adapter: HID adapter >>>>> v_in: 230.00 V >>>>> v_out +12v: 12.14 V (crit min = +8.41 V, crit max = +15.59 V) >>>>> v_out +5v: 5.03 V (crit min = +3.50 V, crit max = +6.50 V) >>>>> v_out +3.3v: 3.30 V (crit min = +2.31 V, crit max = +4.30 V) >>>>> psu fan: 0 RPM >>>>> vrm temp: +46.2°C (crit = +70.0°C) >>>>> case temp: +39.8°C (crit = +70.0°C) >>>>> power total: 152.00 W >>>>> power +12v: 108.00 W >>>>> power +5v: 41.00 W >>>>> power +3.3v: 5.00 W >>>>> curr in: N/A >>>> >>>> What does that mean ? If it isn't supported by the power supply, >>>> should we drop that entirely ? Maybe drop it via the is_visible >>>> function if it is available for some variants, but always displaying >>>> N/A doesn't add value. >>>> >>>> This is a bit odd, though, since I would assume it translates >>>> to the PSU_CMD_IN_AMPS command. Any chance to track down what is >>>> happening here ? >>> >>> I have one of the earliest PSUs of this series, it is just not supported on >>> mine. I'm not sure if it would be worth the trouble to catch that and turn >>> it off dynamically. >>> >> >> I think so, because otherwise we'll get complaints about it (people >> are really picky abut such things lately). Better not display it at all >> if it is not supported on a given PSU version. This should be relatively >> easy to catch in the is_visible function. > > So do you have any idea how to do it? The PSU does not tell you what is > supported or not, you only find out by running the commands. I mean the > only thing I think of is like I did it for the critical values, but only > keeping the *_support bits. But if I do it that way, I actually should do > it for all the commands. This is the point which I ment with "worth the > trouble." > It is not really necessary to do it for all commands; only for those known to not be supported on all power supplies. >> Nice PS, anyway. Too bad it is so expensive (and large). Do you know >> if the HX750i uses the same protocol ? > > All HX_num_i and RM_num_i PSUs support the same protocol. There are only > small differences in supported commands based on release version. What do > you mean by "large"? The size of the case? All HXi and RMi should have > the same size (standard ATX). Maybe you looked at one of the AXi series, They don't fit into my small mini-ATX chassis, and the "i" series all seem to be full-size ATX. [ ... ] >> >> Making the code less readable to meet a line limit isn't really that desirable. >> If you want to stick with one line, you could drop the "hwmon_" from function prefixes >> instead. Those don't really add any value. > > I know I know, it's a personal taste. I really dislike splitting functions > headers about serveral lines, especially if indenting is tab based. > Fortunately you can get there by dropping 'hwmon_' from the function names. Thanks, Guenter