Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3324117pxf; Mon, 15 Mar 2021 07:09:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKMmEKBazlAcaPHWBUEaDxrTFLBogFJmV9LHNJe92jO15HzCwSwWCgVbTmhglaov5yny03 X-Received: by 2002:a17:906:22d4:: with SMTP id q20mr24507562eja.54.1615817356605; Mon, 15 Mar 2021 07:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817356; cv=none; d=google.com; s=arc-20160816; b=F3xpnSwDYA384+NUZEqH7yoWa+Lxd/HNFOddhsXfsGmXJNH76TsiThkftzOiNW+nh8 fvxEqTCFZ623kAjyMj8LdlhG9Z7kBnjXeEPEHUJq/i1M//u2i53l2CkRZAaVFf+N0O6+ yIIiW3xE/j3skHmu2ddjMQKdb2+UDON8W/3pH3S9sxiAEP3Ki95nEhRE4BkZox9rUvxR tcuQHXj3pw+R68excePV6MUrMc2toRpe0sQmmjySUibSCo2yoCTKVt/Yyjlks2uV27yY VOaAoamwDCpu5Jg0UkwlspWHs3xdNsusjatJ5Gs3t+9lKNGNNaa0sQsu12yBC4BoUdBq 67eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j8muievJcsEUDkjVYXLkdfeEYNShNTgWVLcUEhwMrro=; b=Fp2MPjWb0D2n9V7QqDwPlDtH1YJJuE6QQD5u1/ZaRIiATInA8wjak+A9I2IVAVdLLR 1/JacPzqMPezb2rwYGQ3QP68jhM8rIQ6lAH4s6L3KLlB4ZIfWmCDgJQorfcRHlaXMPcc uYrW1k2p9G/pNMyOd2i7EGK4yhEBMjZ59c0Sxb+mHKntSzTGtbSf76NiRALU4+5UDw56 /vZGbzDL+EZig3KPuw0YxVWDard8bQjQr7Y2//yCC/s2KjizKrGf0c0jV20ZHx5zRhcR SnQpmBi+/V4MvLuh7VSMqvnfc+NomPVxcS+YL3unCkO9YGQPCBEHMXX0OiM4+V1Bs23Y mGGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uT25Vqoy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si11032329ejf.626.2021.03.15.07.08.53; Mon, 15 Mar 2021 07:09:16 -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=@linuxfoundation.org header.s=korg header.b=uT25Vqoy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235167AbhCOOHQ (ORCPT + 99 others); Mon, 15 Mar 2021 10:07:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:35610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232225AbhCON56 (ORCPT ); Mon, 15 Mar 2021 09:57:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 908A764EF9; Mon, 15 Mar 2021 13:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816677; bh=oD4TM/SvGJHNIoZyCTwvQxsQZ3c7mMfWJYN44chZ208=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uT25VqoyQt1pDnk1D7hqckGkiCi2l2JcNXASRvOTGhuQkdpyVnqefnnY8WWB/o6My X80pDsD4t7PGDmbXeA0UVrLWJM0N9gM/tCxCAgGxs6Y5bAV2xDHtjySucHM9KT0MYo Tf4kJamIv++bSY3T2yzqs5dytEoDSQGFal/Xfrzg= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Oltean , Andrew Lunn , "David S. Miller" Subject: [PATCH 5.10 050/290] net: dsa: sja1105: fix SGMII PCS being forced to SPEED_UNKNOWN instead of SPEED_10 Date: Mon, 15 Mar 2021 14:52:23 +0100 Message-Id: <20210315135543.615398964@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Vladimir Oltean commit 053d8ad10d585adf9891fcd049637536e2fe9ea7 upstream. 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/sja1105/sja1105_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -1834,7 +1834,7 @@ out_unlock_ptp: speed = SPEED_1000; else if (bmcr & BMCR_SPEED100) speed = SPEED_100; - else if (bmcr & BMCR_SPEED10) + else speed = SPEED_10; sja1105_sgmii_pcs_force_speed(priv, speed);