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=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 09A41C433FF for ; Mon, 5 Aug 2019 15:31:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4E0020B1F for ; Mon, 5 Aug 2019 15:31:03 +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="uXIsqssj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729805AbfHEPbC (ORCPT ); Mon, 5 Aug 2019 11:31:02 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:34466 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728939AbfHEPbC (ORCPT ); Mon, 5 Aug 2019 11:31:02 -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=gl1e0DAfh8g9b9ah5STjd2Zeh92eqoUeJ7vLy3eAWZo=; b=uXIsqssj3khLZ27sybWP7psCpR O4ohKMstle//0j1xFo4zCF1BMCMNXODoC4qNcfv1eoQ8TrGQmS7zG+dgxot0zS4X1s98/VTJ9KJTE qyANtw6BIwJWOewiw2WW8xQKk2bsgk4UJ8x4YxTO3PMeEM/X+L8Wb7zPwIXvh1CCvISc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1huews-0007xd-DM; Mon, 05 Aug 2019 17:30:58 +0200 Date: Mon, 5 Aug 2019 17:30:58 +0200 From: Andrew Lunn To: Alexandru Ardelean Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, robh+dt@kernel.org, mark.rutland@arm.com, f.fainelli@gmail.com, hkallweit1@gmail.com Subject: Re: [PATCH 15/16] net: phy: adin: add ethtool get_stats support Message-ID: <20190805153058.GU24275@lunn.ch> References: <20190805165453.3989-1-alexandru.ardelean@analog.com> <20190805165453.3989-16-alexandru.ardelean@analog.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190805165453.3989-16-alexandru.ardelean@analog.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 05, 2019 at 07:54:52PM +0300, Alexandru Ardelean wrote: > This change implements retrieving all the error counters from the PHY. > The PHY supports several error counters/stats. The `Mean Square Errors` > status values are only valie when a link is established, and shouldn't be > incremented. These values characterize the quality of a signal. I think you mean accumulated, not incremented? > > The rest of the error counters are self-clearing on read. > Most of them are reports from the Frame Checker engine that the PHY has. > > Not retrieving the `LPI Wake Error Count Register` here, since that is used > by the PHY framework to check for any EEE errors. And that register is > self-clearing when read (as per IEEE spec). > > Signed-off-by: Alexandru Ardelean > --- > drivers/net/phy/adin.c | 108 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 108 insertions(+) > > diff --git a/drivers/net/phy/adin.c b/drivers/net/phy/adin.c > index a1f3456a8504..04896547dac8 100644 > --- a/drivers/net/phy/adin.c > +++ b/drivers/net/phy/adin.c > @@ -103,6 +103,32 @@ static struct clause22_mmd_map clause22_mmd_map[] = { > { MDIO_MMD_PCS, MDIO_PCS_EEE_WK_ERR, ADIN1300_LPI_WAKE_ERR_CNT_REG }, > }; > > +struct adin_hw_stat { > + const char *string; > + u16 reg1; > + u16 reg2; > + bool do_not_inc; do_not_accumulate? or reverse its meaning, clear_on_read? Andrew