Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8538234rwl; Sat, 31 Dec 2022 07:27:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXujqswFZuC7JmqPiIpI01r/sC2j8W7JH4h2+ZPJUljwkRbB3Y2RnCZlGooELkxvgExTgYPL X-Received: by 2002:a05:6402:904:b0:47d:92ab:5a85 with SMTP id g4-20020a056402090400b0047d92ab5a85mr29167056edz.36.1672500446308; Sat, 31 Dec 2022 07:27:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672500446; cv=none; d=google.com; s=arc-20160816; b=lC5XYuSH6+cRbVOFIK4wbXJ/rwFA2fK502RmryIKuVWS9bRfXEdK+VUc1oJ6/sxhfx eW8XEtjfI8qk2DjpybKmO2k4rjmZbjeSV5+qstqW0H0+3BkGbAC9hLKNw9LduJJsC6el SXBLdkeiZ/gPbuyBfKrQey2DKahfbNS5P3u833br+4RQXumofRZFG+mYVm66RHBMMeqt 61MYnEiDU8+DGFqdUfPVF5YFvikzNVAK8uUxV/I/8bTCsWNfUWDH27uN2w52NyyACO2u f7+wfaKuNUM8GZmPo+RLHVBE4btFGKn43J7k6NQQNToLfCyPwaEeSoMJvk6lt8BcelJz 3fvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=T0+WY80iRNDRnBXULmWsIfhdxD6/IuyE4kKVn64bZwI=; b=KOr1eWpwqHEYAgz00HVgr7KvddUCSNN8dh7/Hl/aXk8RC798y9MgtbqOAD+CKr4xh/ x6MHYSYUxgyfEM1vVd8iihJvQdckIQKLIznN8xd9xamS+FqP8GibWlgy0lQ8LUAYKMom 05ikgj+vQ3UAk1OHBBpZgZHejucAlLo2yOUb1G9pPRlK+dkDPrW0QGDQOD3SeFqHsjAh syQSrnDiLqyO8OLdebxDR6Bb65bZKza18VGm8lmhxbSC8uJC+PE2H9l7sLOYa0PZrEbg EgYJ237ZXKTc7lmxHyx28lF7CXljM+KzUjzd22V3W4Jac8OsHh8d0o7gRwBoCV7AiLx9 TWZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AO+uJi5H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a0564021f8700b004690be1cef0si19539137edc.84.2022.12.31.07.27.11; Sat, 31 Dec 2022 07:27:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AO+uJi5H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235658AbiLaOwT (ORCPT + 62 others); Sat, 31 Dec 2022 09:52:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbiLaOwP (ORCPT ); Sat, 31 Dec 2022 09:52:15 -0500 Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0A02F6B; Sat, 31 Dec 2022 06:52:14 -0800 (PST) Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-1433ef3b61fso27644451fac.10; Sat, 31 Dec 2022 06:52:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=T0+WY80iRNDRnBXULmWsIfhdxD6/IuyE4kKVn64bZwI=; b=AO+uJi5Hmp6EvZfQOpRmI8uZGusZ5/Dq5ZSow+WUVpzzGIyI86x8vvTIAjXVFR4j3+ cMP9PqNf5mopJieq3i581RBK6ZnnI6c/OKKLKAFjxQuvbm81ASAIF/8sqc5WhCd+WcYD IH7E7KGOhK0gtJY41qnbMY0xJFlmUpI0gaa71OasAuzSCyolqrP4JTqg4sZvYzrxy/lm 2wh0ihm8SQ1VUKdT1noDl/9yb/qLpFwKUfiaxN6dGxzJ4nuWxk7kg0Ob7NZA7YIEhP0N MwvZpVrK9vojVVTKvme07bxNHheWqH+GcLYEwK+qVIUV9WhiKoaka+TW+UA1sVpgcgrk TTgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T0+WY80iRNDRnBXULmWsIfhdxD6/IuyE4kKVn64bZwI=; b=jfvNpCmcO7YqUqoaydrcTKv0JJGRqpwD5+ObaGDSPnjNNn3zY3r079h76U+QJix8pN rUHKxP2zPB/Jb7xyGZIhT+8o18iU19gzp5MQa7oN6fxUR5LMCi8HwO0fSNveUoUCthhM i7eqYok1MjaYsz4yVzI8X/H793yqy+SPYrksqUpMZfL2ocM0YskBKJ9abu28eFwSJRZ1 FPB9vGgFrE2+0eXVrI8KjceMRpPdFjeiE+vYWIm+engSKVO93fZJnyJbAiIX4V1oRMIc RY5Dicyhx3iyVe8eSHF0DsL/IS4wJ7I+jRq92SeDJ/q6dmPdSArqxeARRc29uPbq5Wbu Jszw== X-Gm-Message-State: AFqh2koyRA9H0wIZWxfIrvC/5xBPgv55AeQ17ovBHEy9wzWWu05U5Oeq onC56aD1/TQ6h7Oy4/N/ZxnJhpS8SVw= X-Received: by 2002:a05:6870:3d95:b0:14f:7756:1cbd with SMTP id lm21-20020a0568703d9500b0014f77561cbdmr15415000oab.26.1672498334004; Sat, 31 Dec 2022 06:52:14 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n38-20020a05687055a600b0013b9ee734dcsm10933245oao.35.2022.12.31.06.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Dec 2022 06:52:13 -0800 (PST) Sender: Guenter Roeck Date: Sat, 31 Dec 2022 06:52:11 -0800 From: Guenter Roeck To: Armin Wolf Cc: jdelvare@suse.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] hwmon: (ftsteutates) Convert to devm_hwmon_device_register_with_info() Message-ID: <20221231145211.GA2280076@roeck-us.net> References: <20221224041855.83981-1-W_Armin@gmx.de> <20221224041855.83981-3-W_Armin@gmx.de> <20221224151835.GA569106@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 31, 2022 at 12:40:40PM +0100, Armin Wolf wrote: > Am 24.12.22 um 16:18 schrieb Guenter Roeck: > > > On Sat, Dec 24, 2022 at 05:18:54AM +0100, Armin Wolf wrote: > > > Convert driver to use devm_hwmon_device_register_with_info() > > > to reduce module size by 40%. The non-standard fan_source > > > attribute is replaced with the standard pwmX_auto_channels_temp > > > attribute and its special behaviour being documented. > > > Also export fan present status as fanX_fault. > > There are multiple changes in this patch which are not related > > to the actual conversion. Please split into separate patches for > > each functional change. > > > > While I agree with the fan_source -> pwmX_auto_channels_temp > > change, it needs to be done separately after the conversion, > > because it is an ABI change which we may have to undo if someone > > complains. > > > > "export fan present status as fanX_fault" also needs to be a > > separate patch. > > > > In this context, normally alarms are supposed to auto-clear > > after reading an attribute, if the condition no longer exists. > > Is it really necessary to explicitly clear the condition, or > > would it be possible to auto-clear it after reading the attribute ? > > > > Thanks, > > Guenter > > According to the datasheet, the alarm flags are "sticky" and need to > be reset explicitly. Unfortunately, the BMC does not immediately reassign > those flags in case of the alarm condition being present, but does this at > the next "poll cycle". In order to emulate auto-clearable alarms, the driver > would have to constantly poll the BMC, which would still glitch since we do > not know the duration of a "poll cycle". Many chips have that problem. The solution is to either accept it (which many drivers do) or to work around it by cashing reported alarms and only clearing the alarm bit form the cache after a poll cycle. The lm90 driver is probably the most sophisticated of those. There is no need to do anything special, much less anything that prevents standard applications such as "sensors" from working. Guenter