firmware/build_patches/openwrt/0217-kernel-replace-QCA8081...

173 lines
8.1 KiB
Diff

From 3202c7d6107b5c09d1995a23e8fb0625922789b3 Mon Sep 17 00:00:00 2001
From: Stijn Segers <foss@volatilesystems.org>
Date: Sat, 29 Apr 2023 16:35:49 +0200
Subject: [PATCH 17/18] kernel: replace QCA8081 2.5Gb patch with upstream one
The v2 of this patch was merged into 5.17. Drop the old patch
and replace it with v2.
---
...a8081-with-speeds-lower-than-2.5Gb-s.patch | 59 +++++++++++++
...a8081-with-speeds-lower-than-2.5Gb-s.patch | 84 -------------------
2 files changed, 59 insertions(+), 84 deletions(-)
create mode 100644 target/linux/generic/backport-5.15/778-v5.17-net-phy-Fix-qca8081-with-speeds-lower-than-2.5Gb-s.patch
delete mode 100644 target/linux/generic/pending-5.15/790-net-net-phy-Fix-qca8081-with-speeds-lower-than-2.5Gb-s.patch
diff --git a/target/linux/generic/backport-5.15/778-v5.17-net-phy-Fix-qca8081-with-speeds-lower-than-2.5Gb-s.patch b/target/linux/generic/backport-5.15/778-v5.17-net-phy-Fix-qca8081-with-speeds-lower-than-2.5Gb-s.patch
new file mode 100644
index 0000000000..1d8e7997fd
--- /dev/null
+++ b/target/linux/generic/backport-5.15/778-v5.17-net-phy-Fix-qca8081-with-speeds-lower-than-2.5Gb-s.patch
@@ -0,0 +1,59 @@
+From 881cc731df6af99a21622e9be25a23b81adcd10b Mon Sep 17 00:00:00 2001
+From: Jonathan McDowell <noodles@earth.li>
+Date: Mon, 31 Jan 2022 13:56:41 +0000
+Subject: [PATCH] net: phy: Fix qca8081 with speeds lower than 2.5Gb/s
+
+A typo in qca808x_read_status means we try to set SMII mode on the port
+rather than SGMII when the link speed is not 2.5Gb/s. This results in no
+traffic due to the mismatch in configuration between the phy and the
+mac.
+
+v2:
+ Only change interface mode when the link is up
+
+Fixes: 79c7bc0521545 ("net: phy: add qca8081 read_status")
+Cc: stable@vger.kernel.org
+Signed-off-by: Jonathan McDowell <noodles@earth.li>
+Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/phy/at803x.c | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
+index 5b6c0d120e09e2..29aa811af430f0 100644
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -1688,19 +1688,19 @@ static int qca808x_read_status(struct phy_device *phydev)
+ if (ret < 0)
+ return ret;
+
+- if (phydev->link && phydev->speed == SPEED_2500)
+- phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
+- else
+- phydev->interface = PHY_INTERFACE_MODE_SMII;
+-
+- /* generate seed as a lower random value to make PHY linked as SLAVE easily,
+- * except for master/slave configuration fault detected.
+- * the reason for not putting this code into the function link_change_notify is
+- * the corner case where the link partner is also the qca8081 PHY and the seed
+- * value is configured as the same value, the link can't be up and no link change
+- * occurs.
+- */
+- if (!phydev->link) {
++ if (phydev->link) {
++ if (phydev->speed == SPEED_2500)
++ phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
++ else
++ phydev->interface = PHY_INTERFACE_MODE_SGMII;
++ } else {
++ /* generate seed as a lower random value to make PHY linked as SLAVE easily,
++ * except for master/slave configuration fault detected.
++ * the reason for not putting this code into the function link_change_notify is
++ * the corner case where the link partner is also the qca8081 PHY and the seed
++ * value is configured as the same value, the link can't be up and no link change
++ * occurs.
++ */
+ if (phydev->master_slave_state == MASTER_SLAVE_STATE_ERR) {
+ qca808x_phy_ms_seed_enable(phydev, false);
+ } else {
diff --git a/target/linux/generic/pending-5.15/790-net-net-phy-Fix-qca8081-with-speeds-lower-than-2.5Gb-s.patch b/target/linux/generic/pending-5.15/790-net-net-phy-Fix-qca8081-with-speeds-lower-than-2.5Gb-s.patch
deleted file mode 100644
index 2bec96d306..0000000000
--- a/target/linux/generic/pending-5.15/790-net-net-phy-Fix-qca8081-with-speeds-lower-than-2.5Gb-s.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From patchwork Sun Jan 30 10:25:28 2022
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Patchwork-Submitter: Jonathan McDowell <noodles@earth.li>
-X-Patchwork-Id: 12729797
-X-Patchwork-Delegate: kuba@kernel.org
-Return-Path: <netdev-owner@kernel.org>
-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 1DD5EC433EF
- for <netdev@archiver.kernel.org>; Sun, 30 Jan 2022 10:55:25 +0000 (UTC)
-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
- id S240477AbiA3KzX (ORCPT <rfc822;netdev@archiver.kernel.org>);
- Sun, 30 Jan 2022 05:55:23 -0500
-Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36812 "EHLO
- lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
- with ESMTP id S239076AbiA3KzV (ORCPT
- <rfc822;netdev@vger.kernel.org>); Sun, 30 Jan 2022 05:55:21 -0500
-X-Greylist: delayed 1780 seconds by postgrey-1.37 at
- lindbergh.monkeyblade.net; Sun, 30 Jan 2022 02:55:21 PST
-Received: from the.earth.li (the.earth.li
- [IPv6:2a00:1098:86:4d:c0ff:ee:15:900d])
- by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EAD9C061714;
- Sun, 30 Jan 2022 02:55:21 -0800 (PST)
-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=earth.li;
- s=the;
- h=Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date:Sender:
- Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date
- :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:
- References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:
- List-Owner:List-Archive;
- bh=zynwQsXAChbzANQqprwMGE7qGv9t50Oo07QICLYU9a0=; b=Z
- K8tRPtlmUhokQQlgSXpHDLec4xjYjkTQl6oFZ1GPCWgQy2YyrGnhNmtUr8GG4q3NR0jhiKh9A2y61
- pfq1eOPalgLqQ47fxD6JmCK8r/Sb6cXRKYN3OZ8NiEC9yhT8uxEqYe1tTUJL6RVfepb6+yFT5sp2Y
- Osx4iy/QAibB+/8I6lhU5Tb35eztlYgE+/Mky3gIAhyM5kvHjcj4/S6i6Sw2UW27P3tuvH0JetOT6
- OFx58fSC5azHX6pNGqx+Na+tHVtfBMkIiOpdumXyswfZDNqGvg6eXTMPsSZUJ269N1dkqPLBB7Mwz
- jtBcyMpAaEbN7MJWuh2h0DMYmTymlFFrg==;
-Received: from noodles by the.earth.li with local (Exim 4.94.2)
- (envelope-from <noodles@earth.li>)
- id 1nE7Oi-00A0XI-KA; Sun, 30 Jan 2022 10:25:28 +0000
-Date: Sun, 30 Jan 2022 10:25:28 +0000
-From: Jonathan McDowell <noodles@earth.li>
-To: Andrew Lunn <andrew@lunn.ch>,
- Heiner Kallweit <hkallweit1@gmail.com>,
- Russell King <linux@armlinux.org.uk>,
- David Miller <davem@davemloft.net>,
- Jakub Kicinski <kuba@kernel.org>, Luo Jie <luoj@codeaurora.org>
-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
- Robert Marko <robimarko@gmail.com>
-Subject: [PATCH net] net: phy: Fix qca8081 with speeds lower than 2.5Gb/s
-Message-ID: <YfZnmMteVry/A1XR@earth.li>
-MIME-Version: 1.0
-Content-Disposition: inline
-Precedence: bulk
-List-ID: <netdev.vger.kernel.org>
-X-Mailing-List: netdev@vger.kernel.org
-X-Patchwork-Delegate: kuba@kernel.org
-
-A typo in qca808x_read_status means we try to set SMII mode on the port
-rather than SGMII when the link speed is not 2.5Gb/s. This results in no
-traffic due to the mismatch in configuration between the phy and the
-mac.
-
-Fixes: 79c7bc0521545 ("net: phy: add qca8081 read_status")
-Signed-off-by: Jonathan McDowell <noodles@earth.li>
----
- drivers/net/phy/at803x.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
-index 5b6c0d120e09..7077e3a92d31 100644
---- a/drivers/net/phy/at803x.c
-+++ b/drivers/net/phy/at803x.c
-@@ -1691,7 +1691,7 @@ static int qca808x_read_status(struct phy_device *phydev)
- if (phydev->link && phydev->speed == SPEED_2500)
- phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
- else
-- phydev->interface = PHY_INTERFACE_MODE_SMII;
-+ phydev->interface = PHY_INTERFACE_MODE_SGMII;
-
- /* generate seed as a lower random value to make PHY linked as SLAVE easily,
- * except for master/slave configuration fault detected.
--
2.42.1