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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 A4514C433E0 for ; Thu, 4 Mar 2021 13:34:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 651E164F09 for ; Thu, 4 Mar 2021 13:34:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241303AbhCDNdj (ORCPT ); Thu, 4 Mar 2021 08:33:39 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:39840 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233758AbhCDNdW (ORCPT ); Thu, 4 Mar 2021 08:33:22 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lHo5g-009I8K-7F; Thu, 04 Mar 2021 14:32:32 +0100 Date: Thu, 4 Mar 2021 14:32:32 +0100 From: Andrew Lunn To: Vladimir Oltean Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, vivien.didelot@gmail.com, f.fainelli@gmail.com, Vladimir Oltean Subject: Re: [PATCH net 1/2] net: dsa: sja1105: fix SGMII PCS being forced to SPEED_UNKNOWN instead of SPEED_10 Message-ID: References: <20210304105654.873554-1-olteanv@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210304105654.873554-1-olteanv@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Mar 04, 2021 at 12:56:53PM +0200, Vladimir Oltean wrote: > From: Vladimir Oltean > > When using MLO_AN_PHY or MLO_AN_FIXED, the MII_BMCR of the SGMII PCS is > read before resetting the switch so it can be reprogrammed afterwards. > This works for the speeds of 1Gbps and 100Mbps, but not for 10Mbps, > because SPEED_10 is actually 0, so AND-ing anything with 0 is false, > therefore that last branch is dead code. > > Do what others do (genphy_read_status_fixed, phy_mii_ioctl) and just > remove the check for SPEED_10, let it fall into the default case. > > Fixes: ffe10e679cec ("net: dsa: sja1105: Add support for the SGMII port") > Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Andrew