Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3806958pxt; Tue, 10 Aug 2021 11:44:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxupL6LKcHL2dqgmAfKYudk/M2yeO+zxFyugGsLsMPXsqh1OKADBfVgYxmAQPCWWoxXnsve X-Received: by 2002:a05:6638:240d:: with SMTP id z13mr14888581jat.8.1628621042921; Tue, 10 Aug 2021 11:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628621042; cv=none; d=google.com; s=arc-20160816; b=UULgOIuMRAg8ENUqUoZnIEOpJasjdzdXRDsJ5lxareq3dJLzMXsEPrE6+67SDFXtEY f0CDQVUJSI+SyqS1GOGhHye/lmrMReF9NiwbyGbPJxee1cgiDfJUcU2ZRy6C8JjRTE7k /sLOL6rxGSOY66pVBvJfKdqO7vIl/KleZTd/bqBBeTF6tFWObGE5j8BO/Ik3cRJwDhaP 2emBAJyKyfbyCy0Voah6fBObmlfx+akYLqioGq7GgyCEybWLZAdnjwBIpPjeoi7gsiqT fujYT2waTu9Sotqk1q+7aIRaipgmbTP+HqY/HSeO98ibFf/E+Mj/fV2poyPJKak5ZdBB PXtQ== 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:dkim-signature; bh=vuY4CU2wqTh4MiNOaeRz1+bUXIW8uOlvfPoVeU/k6qY=; b=k4CJHp5uojuewuj5EqIH/xFO3x55k7p/oZgai3pvi/m3nt801DzWwQb06QBkuUBgZH gqq1xaN8yuM7K6tgT+FmI7CGBv2yXPm8vLamCIXCaJr71lmh9Xre/HBZIcxUUqGXITjN NTZxxlvVw+oHMa9jG4SdlwlRD8+hdKXwy8hLCS4MxjLoftoAymw+mf4OrtnRtdp3zIJU qBHPujvaHDwD2AoYaRzTP+KDm2dajsovMOvQSXqRDOCgtR6LCe7uSdhtYmfXn+GGIChi FLGXFji1ZLdgSPpKDTHcJOuQcPNcQ5/alMsWrddn0e+x9iJPbDuU4QbLPM22gq9YEbpJ obUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=b7DMOqRE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si21671271jao.11.2021.08.10.11.43.50; Tue, 10 Aug 2021 11:44:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=b7DMOqRE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230317AbhHJSnb (ORCPT + 99 others); Tue, 10 Aug 2021 14:43:31 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:43368 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbhHJSna (ORCPT ); Tue, 10 Aug 2021 14:43:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=vuY4CU2wqTh4MiNOaeRz1+bUXIW8uOlvfPoVeU/k6qY=; b=b7DMOqREteJbMkdZnjrSvBb+i/ kW+1wtYwdvcdmYrcehORUYKTu3xXLeYgTg0X8imZx2IZvFh4XxZ6h2YmJg75FknEdRWRDS9YN4YXk 8ULqbKcKkqG1MwuX8NsAYDVB/BKcIHRaD3kblDoU/nTXfziLorKDDfFu/pjKqghsSUlM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mDWi5-00GxZx-R1; Tue, 10 Aug 2021 20:42:45 +0200 Date: Tue, 10 Aug 2021 20:42:45 +0200 From: Andrew Lunn To: Guenter Roeck Cc: Oleksij Rempel , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , Jean Delvare , Pengutronix Kernel Team , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Marek Vasut , David Jander , linux-hwmon@vger.kernel.org Subject: Re: [PATCH net-next v1] net: phy: nxp-tja11xx: log critical health state Message-ID: References: <20210810125618.20255-1-o.rempel@pengutronix.de> <04df44d9-f049-e87b-81de-5a9fe888a49b@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04df44d9-f049-e87b-81de-5a9fe888a49b@roeck-us.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > I'm not so happy abusing the statistic counters like this. Especially > > when we have a better API for temperature and voltage: hwmon. > > > > phy_temp_warn maps to hwmon_temp_max_alarm. phy_temp_high maps to > > either hwmon_temp_crit_alarm or hwmon_temp_emergency_alarm. > > > > The under voltage maps to hwmon_in_lcrit_alarm. > > > > FWIW, the statistics counters in this driver are already abused > (phy_polarity_detect, phy_open_detect, phy_short_detect), so > I am not sure if adding more abuse makes a difference (and/or > if such abuse is common for phy drivers in general). Hi Guenter Abuse is not common in general. I think this is the only driver abusing stats to return flags. At the time those where added, we did not have phy cable test support. Now we do, i would also suggest that the driver makes use of that infrastructure to issue a cable test report. These 'stats' need to stay, since they are ABI, but we should not add more. That is also why i said "Especially when we have a better API". Andrew