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,URIBL_BLOCKED,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 2AC3EC2BB1D for ; Tue, 14 Apr 2020 19:48:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CEB7B206E9 for ; Tue, 14 Apr 2020 19:48:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="EwMFDQ+3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505186AbgDNTpv (ORCPT ); Tue, 14 Apr 2020 15:45:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2505166AbgDNTph (ORCPT ); Tue, 14 Apr 2020 15:45:37 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D997C061A0C for ; Tue, 14 Apr 2020 12:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: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=hMfQ+65HG0cJkLQAR6mE83QrTHNuxx43H/oTwNmSl/4=; b=EwMFDQ+39fHzy8f7cgZkRzyB/ uq7calQayn646UWIUk5N8d/8JO2MHVX2HtPY0PwayjMGQCqlKaGyEUrov/JswoMVvqCrjUlXX36ov xqL4Gw/dYr6hKFIrPeRZiCK48qFDlAODAiRnGIHwmrNkqSHc2m1ncO7MbYplLcekp4Z0YSiboGSb1 yyP2vZ4uE59xgR/+N5Nz4IY7Vc6lnqvs5UDW/Os+/RwVrLgR1AKBwoiG8hlDtmXMxa7hkfJCkFFh6 KzixzyyEDxxDjdcCYJ6e8PqRmbvIUwAhhQaYj8rpDe/fg/sKONQ1Ds6UoaPA/D2PMV3I5uzUaisiX OuCEE0ACA==; Received: from shell.armlinux.org.uk ([2002:4e20:1eda:1:5054:ff:fe00:4ec]:45944) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jORUr-0001kN-0z; Tue, 14 Apr 2020 20:45:25 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jORUm-0008OH-Qm; Tue, 14 Apr 2020 20:45:20 +0100 Date: Tue, 14 Apr 2020 20:45:20 +0100 From: Russell King - ARM Linux admin To: Andrew Lunn Cc: Florian Fainelli , Heiner Kallweit , Matteo Croce , "David S. Miller" , netdev@vger.kernel.org Subject: Re: [PATCH net 1/2] net: marvell10g: report firmware version Message-ID: <20200414194520.GA25745@shell.armlinux.org.uk> References: <20200414182935.GY25745@shell.armlinux.org.uk> <20200414184739.GD637127@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200414184739.GD637127@lunn.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Apr 14, 2020 at 08:47:39PM +0200, Andrew Lunn wrote: > On Tue, Apr 14, 2020 at 07:30:15PM +0100, Russell King wrote: > > Report the firmware version when probing the PHY to allow issues > > attributable to firmware to be diagnosed. > > > > Tested-by: Matteo Croce > > Signed-off-by: Russell King > > --- > > drivers/net/phy/marvell10g.c | 21 +++++++++++++++++++++ > > 1 file changed, 21 insertions(+) > > > > diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c > > index 7621badae64d..ee60417cdc55 100644 > > --- a/drivers/net/phy/marvell10g.c > > +++ b/drivers/net/phy/marvell10g.c > > @@ -33,6 +33,8 @@ > > #define MV_PHY_ALASKA_NBT_QUIRK_REV (MARVELL_PHY_ID_88X3310 | 0xa) > > > > enum { > > + MV_PMA_FW_VER0 = 0xc011, > > + MV_PMA_FW_VER1 = 0xc012, > > MV_PMA_BOOT = 0xc050, > > MV_PMA_BOOT_FATAL = BIT(0), > > > > @@ -83,6 +85,8 @@ enum { > > }; > > > > struct mv3310_priv { > > + u32 firmware_ver; > > + > > struct device *hwmon_dev; > > char *hwmon_name; > > }; > > @@ -355,6 +359,23 @@ static int mv3310_probe(struct phy_device *phydev) > > > > dev_set_drvdata(&phydev->mdio.dev, priv); > > > > + ret = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MV_PMA_FW_VER0); > > + if (ret < 0) > > + return ret; > > + > > + priv->firmware_ver = ret << 16; > > + > > + ret = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MV_PMA_FW_VER1); > > + if (ret < 0) > > + return ret; > > + > > + priv->firmware_ver |= ret; > > + > > + dev_info(&phydev->mdio.dev, > > + "Firmware version %u.%u.%u.%u\n", > > + priv->firmware_ver >> 24, (priv->firmware_ver >> 16) & 255, > > + (priv->firmware_ver >> 8) & 255, priv->firmware_ver & 255); > > + > > Hi Russell > > Did you consider using phydev_info()? Or is it too early, and you > don't get a sensible name? No, I keep forgetting those exist! I'll resend shortly. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up