From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 105BA351FBD; Fri, 21 Nov 2025 13:51:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763733087; cv=none; b=oLpEHAMGyqL4IRXOazEmzIT2g2fLZ+SRp4D0Ye8Q7rLEyfubB9zgtiNJZYU3R0GUcRmHForgyUghC239GocW7uUENpOG2GW59duEwsOhUlJY0JKzwp3qiCkvcBW+3V76aUDnB8K5qlq+hlQb6aZgFiJEpmU2WTNriv5saU2tZv0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763733087; c=relaxed/simple; bh=kLZwovezZ4RKE/xnfyFv9zvudLdt5x4m9+bHkrwG9eQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lg4JSMHx2TGwPNk2tOZNS2qtS5OALGK1ZRt+LKE1W4COp9LVkEvGhS3mmn9jMiwPCH7gQQp5Dd8K5Q3tpfcFc1qB7bOb3zy/k66Xau0R+HSAG/mAkyQt3FGDocYXIWkv8jQE7YJC7dQextVfWjqfWmlszwyFwzqMv9KDOU9GvAs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kck0sOxM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kck0sOxM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BF51C4CEF1; Fri, 21 Nov 2025 13:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1763733086; bh=kLZwovezZ4RKE/xnfyFv9zvudLdt5x4m9+bHkrwG9eQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kck0sOxMXBhDUxjxfUdDcgI2mnYZ76IRpxfi5J/I4kFPPCh7D4eedzy7PlNWV7Mej h41DGg2AKx95c/yl68Vzn5wUpe5dmb0Le027AdM35qXWuE+ul6vc4KVJFeOd+VP/hh piBmjjFA4QMHkdR0X4mJ2y4jDvNYcvkRKoYO1XAQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jonas Gorski , Florian Fainelli , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 345/529] net: dsa: b53: fix resetting speed and pause on forced link Date: Fri, 21 Nov 2025 14:10:44 +0100 Message-ID: <20251121130243.306215756@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121130230.985163914@linuxfoundation.org> References: <20251121130230.985163914@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jonas Gorski [ Upstream commit b6a8a5477fe9bd6be2b594a88f82f8bba41e6d54 ] There is no guarantee that the port state override registers have their default values, as not all switches support being reset via register or have a reset GPIO. So when forcing port config, we need to make sure to clear all fields, which we currently do not do for the speed and flow control configuration. This can cause flow control stay enabled, or in the case of speed becoming an illegal value, e.g. configured for 1G (0x2), then setting 100M (0x1), results in 0x3 which is invalid. For PORT_OVERRIDE_SPEED_2000M we need to make sure to only clear it on supported chips, as the bit can have different meanings on other chips, e.g. for BCM5389 this controls scanning PHYs for link/speed configuration. Fixes: 5e004460f874 ("net: dsa: b53: Add helper to set link parameters") Signed-off-by: Jonas Gorski Reviewed-by: Florian Fainelli Link: https://patch.msgid.link/20251101132807.50419-2-jonas.gorski@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/dsa/b53/b53_common.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index b00bac4686773..4e850e5f7d220 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1215,6 +1215,10 @@ static void b53_force_port_config(struct b53_device *dev, int port, else reg &= ~PORT_OVERRIDE_FULL_DUPLEX; + reg &= ~(0x3 << GMII_PO_SPEED_S); + if (is5301x(dev) || is58xx(dev)) + reg &= ~PORT_OVERRIDE_SPEED_2000M; + switch (speed) { case 2000: reg |= PORT_OVERRIDE_SPEED_2000M; @@ -1233,6 +1237,11 @@ static void b53_force_port_config(struct b53_device *dev, int port, return; } + if (is5325(dev)) + reg &= ~PORT_OVERRIDE_LP_FLOW_25; + else + reg &= ~(PORT_OVERRIDE_RX_FLOW | PORT_OVERRIDE_TX_FLOW); + if (rx_pause) { if (is5325(dev)) reg |= PORT_OVERRIDE_LP_FLOW_25; -- 2.51.0