Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1010729iob; Fri, 13 May 2022 19:31:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNc9njUC3BZPYIPNi2hZKUUmycNe6y/k2gX4DzNt7efVdbW1KcIsxFX/ZEpBzhVfwZAkn7 X-Received: by 2002:a7b:c403:0:b0:38e:7c57:9af7 with SMTP id k3-20020a7bc403000000b0038e7c579af7mr6862912wmi.144.1652495481814; Fri, 13 May 2022 19:31:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652495481; cv=none; d=google.com; s=arc-20160816; b=YiVXH/+qyiMPYGd4nlKa7MWpVPwoDU5frASDwScOgRG78drH6XkKLpawGT9I0ab+rT V0cdtmqBnpCGNHoKVt6JYf5d+Ma6EmiR5oVXPVYVxd6ZQal30X9hdDl5sjXCyJgBW2sr q5crYDeKPrON3ZG+Er7sOF7iPX1cM1EyX1o1wD59QpkVw3sR0hHVBTxLhyU4hqwbHzoa 85Gsz0unPHpInh9o2g4L6uNLCb0MzQt3R50r3cS6ZfQ9qte2MsVetzQ7GZPGthI1zbcr F7pwByqrZYo68LIMhg5gbgSj5Omjsd5YikwCelsMXNQYANk9qrU0c1qEGGa6OwYrNOCv jNEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=kvr3Begq22WBEyGxs8maYiCPrh4so4dTPZyog74y3T0=; b=Tlxu1JLxjQV4pnn8Lb/LEAF3WmofErFm3IkkvLbPIichHZ8jzdJkLfS+9Dxenn2hpu aZd/C+gXtx/qoJEH1p7QK8L5C+48Y8wmvUYn1kQfdAnb7B6qHIWKxIX/91mo7v+ktdR1 3FQ/NS3FCCzLCn4Go2cp385b0tobdfWTKvQUcD/sEPhSn1Asx8KAW6TH0+Y2TFNZ1hxi +rpL8Whc5NtnbcwlOdz2M7+sRurke+Z6rcBaFiMn+E+aXb4vBLvP/yx/Gzz1exdigV7r KTxoGmd8+uSvOMLWR6jad38UzNPGp6lVXEGGmWmHA2m8CSps19b8uTprYVt83pQ+nzFM shRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YEwfmmly; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b11-20020adfd1cb000000b0020adfb12968si5487371wrd.1038.2022.05.13.19.31.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:31:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YEwfmmly; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A3E0A4E1309; Fri, 13 May 2022 17:44:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380527AbiEMNDl (ORCPT + 99 others); Fri, 13 May 2022 09:03:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240402AbiEMNDi (ORCPT ); Fri, 13 May 2022 09:03:38 -0400 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0664F46143; Fri, 13 May 2022 06:03:38 -0700 (PDT) Received: by mail-oi1-x230.google.com with SMTP id y63so10022429oia.7; Fri, 13 May 2022 06:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=kvr3Begq22WBEyGxs8maYiCPrh4so4dTPZyog74y3T0=; b=YEwfmmlyZgqYrhuuDmRqATA6c7fMLLPBB8Q4BEMYK9Q6dPk4H60yVoLqKvQ3McY3LX LlnqOlKnORu4h0Su6I99mUzvs2ZzOjbgFH1MIjRAH+bilFShhl3GQpSFIWcSWkaTobQy I17wACj+3C+EPBxzi1oIVp4g1Qid9PZ/DjO0MH0yiIwDpC1sGDKVWeXqcbwIBszoQShc hmH1K9r23wJNvnMbLzDCg4jC+nMP2OumCdld6ZYXg+Ps2JYsiC7LeVuJk1as+ymHuBbo prGUjklpod1UeSBpDe+pYmZ+2lf0gpe7ikxTsKqRwytDeKenJTxGOSmHM+0PTb+Iq1R/ C3aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=kvr3Begq22WBEyGxs8maYiCPrh4so4dTPZyog74y3T0=; b=DtmyMAmWJ7cCo7NYZb0bYxeF53zJVVi8jzcjqemXzh7nnrN5NCfqO4bgwyHErHKjmJ MNfdlQHf8n7D7cnjRsP4Pe7UXXcrnwwDH6MhcU5S6QJO6MtUQ/M+mGa1I/lwJR/tYens C3vrbmwFUGD/RZJIT1V1UcDqBG+2t6xlVgA0ZbvtphSkWHSpc1+WAblTmvHpCKHAAuDq mQlAMkxk4IAjXRBRclDMyIq2c7FHXcsLPn2HBHJKJSONOg/cYb4qf/n8jjFQiTmMdhJM JkMgCiYfaRrfovdipY6X5D8j0Q+HrWLPJ/ZrFejj8weosWpOhxgJGmM1hxIgP9ltNkKG E+HQ== X-Gm-Message-State: AOAM531ESnpn4xIgb0KWB7s4P9VUcQy7HUZeW54GOdG+rV27tHGzrlKy LP+TjSk9U/HH/IWSBtlfAmI= X-Received: by 2002:a54:4505:0:b0:325:e50c:a71 with SMTP id l5-20020a544505000000b00325e50c0a71mr7274438oil.70.1652447015822; Fri, 13 May 2022 06:03:35 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id ep36-20020a056870a9a400b000e686d1387bsm999102oab.21.2022.05.13.06.03.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 May 2022 06:03:35 -0700 (PDT) Sender: Guenter Roeck Message-ID: <83c22b32-d3e0-eb85-02b5-0068dcf0412f@roeck-us.net> Date: Fri, 13 May 2022 06:03:33 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v3 2/2] hwmon: acpi_power_meter: convert to hwmon_device_register_with_info Content-Language: en-US To: LABBE Corentin Cc: jdelvare@suse.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Rui References: <20220509063010.3878134-1-clabbe@baylibre.com> <20220509063010.3878134-3-clabbe@baylibre.com> From: Guenter Roeck In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 5/13/22 01:02, LABBE Corentin wrote: > Le Wed, May 11, 2022 at 07:10:29PM -0700, Guenter Roeck a écrit : >> Corentin, >> >> On 5/8/22 23:30, Corentin Labbe wrote: >>> Booting lead to a hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info(). >>> So let's convert the driver to use hwmon_device_register_with_info(). >>> >>> Signed-off-by: Corentin Labbe >>> --- >> [ ... ] >> >>> @@ -836,20 +740,20 @@ static void acpi_power_meter_notify(struct acpi_device *device, u32 event) >>> if (res) >>> break; >>> >>> - remove_attrs(resource); >>> + remove_domain_devices(resource); >>> setup_attrs(resource); >> >> Zhang Rui found an interesting problem with this code: >> It needs a call to sysfs_update_groups(hwmon_dev->groups) >> to update sysfs attribute visibility, probably between >> remove_domain_devices() and setup_attrs(). >> >>> break; >>> case METER_NOTIFY_TRIP: >>> - sysfs_notify(&device->dev.kobj, NULL, POWER_AVERAGE_NAME); >>> + hwmon_notify_event(&device->dev, hwmon_power, hwmon_power_average, 0); >> >> ... which makes realize: The notification device should be the hwmon device. >> That would be resource->hwmon_dev, not the acpi device. >> > > Hello > > I will fix this, but do you have an example how to test thoses code path easily ? > No, sorry. Guenter