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=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 05096C10F11 for ; Sat, 13 Apr 2019 18:42:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2B612084D for ; Sat, 13 Apr 2019 18:42:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="rONdFw9I" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727156AbfDMSmu (ORCPT ); Sat, 13 Apr 2019 14:42:50 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:60498 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726482AbfDMSmu (ORCPT ); Sat, 13 Apr 2019 14:42:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=tb5ldv0/uocS74fMZvOFrq7vdkHOr11KZv1FhrNUwhU=; b=rONdFw9IoLbpGTgPSkCMgpZ0ls iTJoeKRjHvF4kN0XN09SxdLuCyvSJ74UP93BYw2kx7hjJAJSoAeoDTGL2E3ZmTimBFZT7LUFHiRHd jjVqWLMx2E5a9JTZMWM5f66D2MWgfefYSswFOGt71xRAuXjceWX1XDWBdgg0Ltkijm68=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hFNby-0006pT-7n; Sat, 13 Apr 2019 20:42:46 +0200 Date: Sat, 13 Apr 2019 20:42:46 +0200 From: Andrew Lunn To: Igor Russkikh Cc: "David S . Miller" , "netdev@vger.kernel.org" , Nikita Danilov , Dmitry Bogdanov , Yana Esina Subject: Re: [PATCH netnext 02/16] net: aquantia: implement hwmon api for chip temperature Message-ID: <20190413184246.GA25980@lunn.ch> References: <436ffcfa4cee37fcea6aec12217166d47bfda3d0.1555158087.git.igor.russkikh@aquantia.com> <20190413175958.GP17901@lunn.ch> <08e5863b-fc4c-de4a-8488-16a3efbe793a@aquantia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <08e5863b-fc4c-de4a-8488-16a3efbe793a@aquantia.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, Apr 13, 2019 at 06:27:51PM +0000, Igor Russkikh wrote: > > >> + devm_hwmon_device_register_with_groups(&aq_nic->pdev->dev, > >> + ndev->name, > >> + dev_get_drvdata(&pdev->dev), > >> + aq_dev_groups); > >> + > > > > You should be using devm_hwmon_device_register_with_info(). > > > > I'm not sure how good an idea it is use nder->name. systemd is going > > to rename the device, so you have a sensor called eth0, and the > > interface called enp3s0. You might be better to use the pci bus > > address, which is fixed, or add code for the rename notifier, so you > > can destroy and recreate the hwmon device when the interface is > > renamed. > > Thanks for the suggestion, I'll investigate. > On my current system I however see it is named correctly after interface rename, > like 'enp1s0-pci-0100'. Interesting. So you register the hwmon device after registering the netdev. So it could be on your system that systemd has already renamed the interface by the time you register the hwmon device. But i don't think there is any guarantee about this. You could also try ip link set enp1s0-pci-0100 name eth42 to illustrate the point. Andrew