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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61CE1C433F5 for ; Wed, 13 Apr 2022 19:29:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232431AbiDMTcS (ORCPT ); Wed, 13 Apr 2022 15:32:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235925AbiDMTcM (ORCPT ); Wed, 13 Apr 2022 15:32:12 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9920D25C8 for ; Wed, 13 Apr 2022 12:29:37 -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-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To: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=NSRLcO0ZZFlZh7mQFDRSMBndI491Jw/AOweQw0H/N2A=; b=T//mkpYqoo+cZej34GccBGHLHX AWcKx2Csuw7+sHuesp4v9O6fcuQ+BwMclDJRc0CW2YPcERbqdZ8/vbWdhXc7ry4riA4PANWA8ss38 8plLTB1MMUMkl+1SQSgc/mbV/dfcK695M6538KDoP+TLaYV+FhyRfjwaInYdYDCezpsYYYZ9PKuco zPiczY3CGEHns5QuMoHYK10jaPf6cMt/4Fz4Ofd+FisSx4z8lM5fXjvgU5pd+vxVYfD/836MxGlCR HsKONRKJ6L450u520+JZI1dYf1LxBkkcxlB3F7MkvSYZ4FPZHxJ/RBT1G07VIuuYCIlWDo0USSPC3 xYd7jJig==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58250) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1neigG-0003dO-5k; Wed, 13 Apr 2022 20:29:31 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1neigE-0003b4-0V; Wed, 13 Apr 2022 20:29:30 +0100 Date: Wed, 13 Apr 2022 20:29:29 +0100 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Marek =?iso-8859-1?Q?Beh=FAn?= , netdev@vger.kernel.org Subject: Re: [PATCH net 1/3] net: dsa: mv88e6xxx: use BMSR_ANEGCOMPLETE bit for filling an_complete Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Apr 13, 2022 at 08:46:32PM +0200, Andrew Lunn wrote: > On Wed, Apr 13, 2022 at 05:53:52PM +0100, Russell King wrote: > > From: =?UTF-8?q?Marek=20Beh=C3=BAn?= > > Hi Russell > > Does git am parse that correctly? At least it is something > Jakub/DaveM/Paolo needs to keep an eye on when they accept the series. If it doesn't git is rather brain-dead - the above is generated by git format-patch... if git produces emails that it can't accept then there's definitely something wrong with git! > > Commit ede359d8843a ("net: dsa: mv88e6xxx: Link in pcs_get_state() if AN > > is bypassed") added the ability to link if AN was bypassed, and added > > filling of state->an_complete field, but set it to true if AN was > > enabled in BMCR, not when AN was reported complete in BMSR. > > > > This was done because for some reason, when I wanted to use BMSR value > > to infer an_complete, I was looking at BMSR_ANEGCAPABLE bit (which was > > always 1), instead of BMSR_ANEGCOMPLETE bit. > > > > Use BMSR_ANEGCOMPLETE for filling state->an_complete. > > > > Fixes: ede359d8843a ("net: dsa: mv88e6xxx: Link in pcs_get_state() if AN is bypassed") > > Signed-off-by: Marek Behún > > Signed-off-by: Russell King (Oracle) > > --- > > drivers/net/dsa/mv88e6xxx/serdes.c | 27 +++++++++++---------------- > > 1 file changed, 11 insertions(+), 16 deletions(-) > > > > diff --git a/drivers/net/dsa/mv88e6xxx/serdes.c b/drivers/net/dsa/mv88e6xxx/serdes.c > > index 7b37d45bc9fb..1a19c5284f2c 100644 > > --- a/drivers/net/dsa/mv88e6xxx/serdes.c > > +++ b/drivers/net/dsa/mv88e6xxx/serdes.c > > @@ -50,22 +50,17 @@ static int mv88e6390_serdes_write(struct mv88e6xxx_chip *chip, > > } > > > > static int mv88e6xxx_serdes_pcs_get_state(struct mv88e6xxx_chip *chip, > > - u16 ctrl, u16 status, u16 lpa, > > + u16 bmsr, u16 lpa, u16 status, > > struct phylink_link_state *state) > > { > > state->link = !!(status & MV88E6390_SGMII_PHY_STATUS_LINK); > > + state->an_complete = !!(bmsr & BMSR_ANEGCOMPLETE); > > > > if (status & MV88E6390_SGMII_PHY_STATUS_SPD_DPL_VALID) { > > /* The Spped and Duplex Resolved register is 1 if AN is enabled > > It looks like there is a typ0 here for speed. Will fix. > Reviewed-by: Andrew Lunn Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!