Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3325765pxf; Mon, 15 Mar 2021 07:11:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNtwH6trhfC5FJGB3NtwVU7rpa2gXAkVZWkTr6Gi6LpppEiCnpHZOW/l8BPdYKQZgUk/V9 X-Received: by 2002:aa7:c4cc:: with SMTP id p12mr29473201edr.325.1615817467988; Mon, 15 Mar 2021 07:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817467; cv=none; d=google.com; s=arc-20160816; b=FFA/Cp8qk3j+/lKkxafeWzIsfkM0AiYR9ePpHkLPz2d4E92xLc1uNwocRTFvfczzqh qgZJpUA+vFNaSUmWxaaZ0lK3pbO52IEVX7kF5ATsgcgy0s8XPMvAA800z7gcxQ4vwPpy 94PVKwCon5grWeVvBwPP890sFjiFTomFj3VluWoxw51l+DMImA4oveyxNI469P5eJLx7 jjo4QVRrZexG1I+XXlNHP7f69DvhvND3uY8NEAzE5ELSqKDQCC4GV0zvfCuaihLjG9ar TELl+zCGC0pz33b/1FRsKCQ8bG6lBmmWtzq7dYwCRbXL2Uq3Oh4JPqDEt/YKSvGLQVG1 Iy7A== 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=dp155S2F4xCA0Cuf24q9rIs6Jf/NlwMvKzaGvWLw6cUbUo2RmCSRoqgaNHV1zhg3IS cBZvdmUXYA42wCO8hZa0dTzrhbsqMjoPnCFzzSzeFwS6c5y6Cx2mcXNOnRMMUXl2fcku z+mA327RmssuihtxJXdzoT5AAIqya0wG9GFMJZda7VHxjbgVt7KGIgdLYpvZ0nG9Q7/K rpim3ycaafBpGsEYzi+AWAGiZBqkS9IUMs9lKgRnd4mRLdl+FXWFDf7BKDpsvQegJjmA 9U0T0VTuuHK6LO6JAXIsAa5RK5o+I72MAd2JbhvcmnL8mSZyjx1YTuULd36CEL2IO9RI iNgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I4faj6V1; 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 y22si11461125edc.181.2021.03.15.07.10.43; Mon, 15 Mar 2021 07:11:07 -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=I4faj6V1; 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 S235491AbhCOOJB (ORCPT + 99 others); Mon, 15 Mar 2021 10:09:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:36656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230250AbhCON6C (ORCPT ); Mon, 15 Mar 2021 09:58:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 06A2964EF0; Mon, 15 Mar 2021 13:58:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816682; bh=oD4TM/SvGJHNIoZyCTwvQxsQZ3c7mMfWJYN44chZ208=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I4faj6V1Q6iASl09LXkO8WBP8LTL8POoD35KK7RCMjunZhn3T7Ukyrcd22pLF5zks DHv8SF6i7MAZ1cbCq4LnGZyweeFktVvx+UJfgNeD7MeCui7ptzY2E/xWI615YxtlCz 8In8MZgxorIVQCdWFHj3LHcnU+rjPsa3UcZsXxWg= 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.11 061/306] net: dsa: sja1105: fix SGMII PCS being forced to SPEED_UNKNOWN instead of SPEED_10 Date: Mon, 15 Mar 2021 14:52:04 +0100 Message-Id: <20210315135509.716461345@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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);