Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3716505pxt; Tue, 10 Aug 2021 09:41:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF39UQzr/Woz9UZ1ntypUdd3JU0jDhPbgdhu9Cf59UGlCSxy3bDyHfOBsY4tJaEiCb4XF+ X-Received: by 2002:a17:906:1685:: with SMTP id s5mr28134994ejd.370.1628613693830; Tue, 10 Aug 2021 09:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628613693; cv=none; d=google.com; s=arc-20160816; b=QU+KaeBb0qyQcmu0qJpT2mA68GOfF/86ZNTEzNZdNhhpQa17LBwWRn/X45JBOI8taP EfFREK1FezhO/FNchkbt9DfqyW6avCRjgP7pkkMN0pdI5xTPtCgaRV821xRYzrwmd5Q+ hX7S8voAdAukXsbZTi3IZfHUgz9qqUYvRsMKVfP7tJYd4+xcRqkvRs6lpWSYeXz/hd5c QE+YrY8xdTiCMy/64hdhDaFg2hInwB54JXrZdDRaCG0wvWEFmZ9tuqkSL9nRubCpZ8sv tF6ASBf/Lsdeba8ctGBtJS1rNHwbPQSWqjMoHke6TyTpC0pKse5GR3xjvQRFuR6riiVR YKYQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dtySB9rjcxH7bxKw5rZgefC4uBmGW785dtYYNm9V7pY=; b=0yc0di5lYxc97s8OCWeOKBr7FpPvUy+NKy+NuADzrSGpISRf/4ZypjWRxB1eWOtkxI a2S1BP+mD1ILrQX/eB8hYjTNf/acDwZnhIjxb6R9Gf3spelIH6L/l39iMIAs8UrXlG8U HH1PL0rM+WuT3JKa0L4n7EQ6si/bDaowQw/x1+/bVs0yGCDMy/QUl6EHa1Jb8alU03Bc XZE3nhJ4W0H70MH1/v1zdgqp2ZJd1S26FaSFbAg3a72hJT65VYq0zexk1wu1WrZECCsC WDfPxbt3hkRxgpYDPCmDHHrNWmy5CPV1QsOUmzON1sPIIT14wuwWOIA18y9HgHX3tgIG Pnqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=nqHzm31S; 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 g8si22780090eds.597.2021.08.10.09.41.07; Tue, 10 Aug 2021 09:41:33 -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=nqHzm31S; 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 S242219AbhHJPGg (ORCPT + 99 others); Tue, 10 Aug 2021 11:06:36 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:43014 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241917AbhHJPGf (ORCPT ); Tue, 10 Aug 2021 11:06:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding: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=dtySB9rjcxH7bxKw5rZgefC4uBmGW785dtYYNm9V7pY=; b=nq Hzm31SVDVhMomio9sKwpp33QpzqLna0pZOu0cYQ1ET87R9oaWvwLfH+lcywouk0338tcnnR74LTaO FG7gC6c8p8szDknYV7bpH0nCxT9+lD0v691DkEZqm8k+3cHXTZdTZqK/+g4OweHINcO1tWDoShtwK 7b4kQcFLsHizbw4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mDTKF-00GvYZ-Ol; Tue, 10 Aug 2021 17:05:55 +0200 Date: Tue, 10 Aug 2021 17:05:55 +0200 From: Andrew Lunn To: Oleksij Rempel Cc: Heiner Kallweit , "David S. Miller" , Jakub Kicinski , Jean Delvare , Guenter Roeck , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210810125618.20255-1-o.rempel@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Oleksij > @@ -89,6 +91,12 @@ static struct tja11xx_phy_stats tja11xx_hw_stats[] = { > { "phy_polarity_detect", 25, 6, BIT(6) }, > { "phy_open_detect", 25, 7, BIT(7) }, > { "phy_short_detect", 25, 8, BIT(8) }, > + { "phy_temp_warn (temp > 155C?)", 25, 9, BIT(9) }, > + { "phy_temp_high (temp > 180C?)", 25, 10, BIT(10) }, > + { "phy_uv_vddio", 25, 11, BIT(11) }, > + { "phy_uv_vddd_1v8", 25, 13, BIT(13) }, > + { "phy_uv_vdda_3v3", 25, 14, BIT(14) }, > + { "phy_uv_vddd_3v3", 25, 15, BIT(15) }, > { "phy_rem_rcvr_count", 26, 0, GENMASK(7, 0) }, > { "phy_loc_rcvr_count", 26, 8, GENMASK(15, 8) }, 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. > @@ -630,6 +640,11 @@ static irqreturn_t tja11xx_handle_interrupt(struct phy_device *phydev) > return IRQ_NONE; > } > > + if (irq_status & MII_INTSRC_TEMP_ERR) > + dev_err(dev, "Overtemperature error detected (temp > 155C?).\n"); > + if (irq_status & MII_INTSRC_UV_ERR) > + dev_err(dev, "Undervoltage error detected.\n"); > + These are not actual errors, in the linux sense. So dev_warn() or maybe dev_info(). Andrew