kernel: move mv88e6xxx fix to generic backports master
authorStijn Tintel <stijn@linux-ipv6.be>
Fri, 26 Apr 2024 16:40:17 +0000 (19:40 +0300)
committerStijn Tintel <stijn@linux-ipv6.be>
Fri, 26 Apr 2024 16:56:19 +0000 (19:56 +0300)
The backports introduced in commit d40756563c46 ("kernel: backport
phylink changes from mainline Linux") broke the mv88e6xxx DSA driver.
A backport to fix this was added to the kirkwood target, but as it is
used in multiple targets, and there's a kmod package for it, the fix
should be in generic backports.

This fixes the switch on the WatchGuard Firebox M300 when running the
6.1 testing kernel.

There is no need to backport the fix for the 6.6 kernel, as it was
included in 6.6.5.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
target/linux/generic/backport-6.1/797-6.7-net-dsa-mv88e6xxx-fix-marvell-6350-switch-probing.patch [new file with mode: 0644]
target/linux/generic/backport-6.1/807-v6.5-01-net-dsa-mv88e6xxx-pass-directly-chip-structure-to-mv.patch
target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch
target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch
target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch
target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch
target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch
target/linux/kirkwood/patches-6.1/005-6.7-net-dsa-mv88e6xxx-fix-marvell-6350-switch-probing.patch [deleted file]

diff --git a/target/linux/generic/backport-6.1/797-6.7-net-dsa-mv88e6xxx-fix-marvell-6350-switch-probing.patch b/target/linux/generic/backport-6.1/797-6.7-net-dsa-mv88e6xxx-fix-marvell-6350-switch-probing.patch
new file mode 100644 (file)
index 0000000..40e857d
--- /dev/null
@@ -0,0 +1,89 @@
+From b3f1a164c7f742503dc7159011f7ad6b092b660e Mon Sep 17 00:00:00 2001
+From: Greg Ungerer <gerg@kernel.org>
+Date: Fri, 24 Nov 2023 14:15:28 +1000
+Subject: [PATCH] net: dsa: mv88e6xxx: fix marvell 6350 switch probing
+
+As of commit de5c9bf40c45 ("net: phylink: require supported_interfaces to
+be filled") Marvell 88e6350 switches fail to be probed:
+
+    ...
+    mv88e6085 d0072004.mdio-mii:11: switch 0x3710 detected: Marvell 88E6350, revision 2
+    mv88e6085 d0072004.mdio-mii:11: phylink: error: empty supported_interfaces
+    error creating PHYLINK: -22
+    mv88e6085: probe of d0072004.mdio-mii:11 failed with error -22
+    ...
+
+The problem stems from the use of mv88e6185_phylink_get_caps() to get
+the device capabilities. Create a new dedicated phylink_get_caps for the
+6351 family (which the 6350 is one of) to properly support their set of
+capabilities.
+
+According to chip.h the 6351 switch family includes the 6171, 6175, 6350
+and 6351 switches, so update each of these to use the correct
+phylink_get_caps.
+
+Fixes: de5c9bf40c45 ("net: phylink: require supported_interfaces to be filled")
+Signed-off-by: Greg Ungerer <gerg@kernel.org>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/dsa/mv88e6xxx/chip.c | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/dsa/mv88e6xxx/chip.c
++++ b/drivers/net/dsa/mv88e6xxx/chip.c
+@@ -652,6 +652,18 @@ static void mv88e6250_phylink_get_caps(s
+       config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100;
+ }
++static void mv88e6351_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
++                                     struct phylink_config *config)
++{
++      unsigned long *supported = config->supported_interfaces;
++
++      /* Translate the default cmode */
++      mv88e6xxx_translate_cmode(chip->ports[port].cmode, supported);
++
++      config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100 |
++                                 MAC_1000FD;
++}
++
+ static int mv88e6352_get_port4_serdes_cmode(struct mv88e6xxx_chip *chip)
+ {
+       u16 reg, val;
+@@ -4489,7 +4501,7 @@ static const struct mv88e6xxx_ops mv88e6
+       .vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
+       .stu_getnext = mv88e6352_g1_stu_getnext,
+       .stu_loadpurge = mv88e6352_g1_stu_loadpurge,
+-      .phylink_get_caps = mv88e6185_phylink_get_caps,
++      .phylink_get_caps = mv88e6351_phylink_get_caps,
+ };
+ static const struct mv88e6xxx_ops mv88e6172_ops = {
+@@ -4590,7 +4602,7 @@ static const struct mv88e6xxx_ops mv88e6
+       .vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
+       .stu_getnext = mv88e6352_g1_stu_getnext,
+       .stu_loadpurge = mv88e6352_g1_stu_loadpurge,
+-      .phylink_get_caps = mv88e6185_phylink_get_caps,
++      .phylink_get_caps = mv88e6351_phylink_get_caps,
+ };
+ static const struct mv88e6xxx_ops mv88e6176_ops = {
+@@ -5247,7 +5259,7 @@ static const struct mv88e6xxx_ops mv88e6
+       .vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
+       .stu_getnext = mv88e6352_g1_stu_getnext,
+       .stu_loadpurge = mv88e6352_g1_stu_loadpurge,
+-      .phylink_get_caps = mv88e6185_phylink_get_caps,
++      .phylink_get_caps = mv88e6351_phylink_get_caps,
+ };
+ static const struct mv88e6xxx_ops mv88e6351_ops = {
+@@ -5293,7 +5305,7 @@ static const struct mv88e6xxx_ops mv88e6
+       .stu_loadpurge = mv88e6352_g1_stu_loadpurge,
+       .avb_ops = &mv88e6352_avb_ops,
+       .ptp_ops = &mv88e6352_ptp_ops,
+-      .phylink_get_caps = mv88e6185_phylink_get_caps,
++      .phylink_get_caps = mv88e6351_phylink_get_caps,
+ };
+ static const struct mv88e6xxx_ops mv88e6352_ops = {
index 58777cd280be9f4433a8d08f11b893d217ef183e..8c062dc3b4c6eb02ff9b07d5ee413be4566594f7 100644 (file)
@@ -44,7 +44,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                __set_bit(PHY_INTERFACE_MODE_MII, config->supported_interfaces);
        } else {
                if (cmode < ARRAY_SIZE(mv88e6185_phy_interface_modes) &&
-@@ -839,7 +837,7 @@ static void mv88e6xxx_get_caps(struct ds
+@@ -851,7 +849,7 @@ static void mv88e6xxx_get_caps(struct ds
        chip->info->ops->phylink_get_caps(chip, port, config);
        mv88e6xxx_reg_unlock(chip);
  
@@ -53,7 +53,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                __set_bit(PHY_INTERFACE_MODE_INTERNAL,
                          config->supported_interfaces);
                /* Internal ports with no phy-mode need GMII for PHYLIB */
-@@ -860,7 +858,7 @@ static void mv88e6xxx_mac_config(struct
+@@ -872,7 +870,7 @@ static void mv88e6xxx_mac_config(struct
  
        mv88e6xxx_reg_lock(chip);
  
index 12ea3ebda077c7fb013f92c995af561aec909157..b50cb0845483c77d2e6353ba4270383b3cf504b9 100644 (file)
@@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/dsa/mv88e6xxx/chip.c
 +++ b/drivers/net/dsa/mv88e6xxx/chip.c
-@@ -5944,7 +5944,8 @@ static const struct mv88e6xxx_info mv88e
+@@ -5956,7 +5956,8 @@ static const struct mv88e6xxx_info mv88e
                .name = "Marvell 88E6191X",
                .num_databases = 4096,
                .num_ports = 11,        /* 10 + Z80 */
@@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                .max_vid = 8191,
                .max_sid = 63,
                .port_base_addr = 0x0,
-@@ -5967,7 +5968,8 @@ static const struct mv88e6xxx_info mv88e
+@@ -5979,7 +5980,8 @@ static const struct mv88e6xxx_info mv88e
                .name = "Marvell 88E6193X",
                .num_databases = 4096,
                .num_ports = 11,        /* 10 + Z80 */
@@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                .max_vid = 8191,
                .max_sid = 63,
                .port_base_addr = 0x0,
-@@ -6286,7 +6288,8 @@ static const struct mv88e6xxx_info mv88e
+@@ -6298,7 +6300,8 @@ static const struct mv88e6xxx_info mv88e
                .name = "Marvell 88E6393X",
                .num_databases = 4096,
                .num_ports = 11,        /* 10 + Z80 */
index 72dfcee82c13ac13ce4509fa06304449b42a10b4..d027bd3a8bbe7ee80df6602879b9630c481eb608 100644 (file)
@@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/dsa/mv88e6xxx/chip.c
 +++ b/drivers/net/dsa/mv88e6xxx/chip.c
-@@ -3328,7 +3328,7 @@ static int mv88e6xxx_setup_port(struct m
+@@ -3340,7 +3340,7 @@ static int mv88e6xxx_setup_port(struct m
                caps = pl_config.mac_capabilities;
  
                if (chip->info->ops->port_max_speed_mode)
index dc6d5497f21178a63b4eddbcd5a01cb7b6786932..220fec68c32c7f4a4ba43fd926a2612e44b17ee0 100644 (file)
@@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/dsa/mv88e6xxx/chip.c
 +++ b/drivers/net/dsa/mv88e6xxx/chip.c
-@@ -797,6 +797,8 @@ static void mv88e6393x_phylink_get_caps(
+@@ -809,6 +809,8 @@ static void mv88e6393x_phylink_get_caps(
        unsigned long *supported = config->supported_interfaces;
        bool is_6191x =
                chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6191X;
@@ -35,7 +35,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
        mv88e6xxx_translate_cmode(chip->ports[port].cmode, supported);
  
-@@ -811,13 +813,17 @@ static void mv88e6393x_phylink_get_caps(
+@@ -823,13 +825,17 @@ static void mv88e6393x_phylink_get_caps(
                /* 6191X supports >1G modes only on port 10 */
                if (!is_6191x || port == 10) {
                        __set_bit(PHY_INTERFACE_MODE_2500BASEX, supported);
@@ -58,7 +58,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                }
        }
  
-@@ -6231,6 +6237,32 @@ static const struct mv88e6xxx_info mv88e
+@@ -6243,6 +6249,32 @@ static const struct mv88e6xxx_info mv88e
                .ptp_support = true,
                .ops = &mv88e6352_ops,
        },
index f09ad117b0d18dc64f73649e8fa0c44ffd4efb4d..54f654ccabc561c2332138acce89ba7332bd1b5c 100644 (file)
@@ -9,7 +9,7 @@ Subject: [PATCH] net/dsa/mv88e6xxx: disable ATU violation
 
 --- a/drivers/net/dsa/mv88e6xxx/chip.c
 +++ b/drivers/net/dsa/mv88e6xxx/chip.c
-@@ -3488,6 +3488,9 @@ static int mv88e6xxx_setup_port(struct m
+@@ -3500,6 +3500,9 @@ static int mv88e6xxx_setup_port(struct m
        else
                reg = 1 << port;
  
index 9556c90b5791b71d70e75530d7001e1a87f428ac..1d4b18653eb3f1510880480fe1d205d2b29e08f5 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
 
 --- a/drivers/net/dsa/mv88e6xxx/chip.c
 +++ b/drivers/net/dsa/mv88e6xxx/chip.c
-@@ -7025,6 +7025,7 @@ static int mv88e6xxx_register_switch(str
+@@ -7037,6 +7037,7 @@ static int mv88e6xxx_register_switch(str
        ds->ops = &mv88e6xxx_switch_ops;
        ds->ageing_time_min = chip->info->age_time_coeff;
        ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX;
diff --git a/target/linux/kirkwood/patches-6.1/005-6.7-net-dsa-mv88e6xxx-fix-marvell-6350-switch-probing.patch b/target/linux/kirkwood/patches-6.1/005-6.7-net-dsa-mv88e6xxx-fix-marvell-6350-switch-probing.patch
deleted file mode 100644 (file)
index cd83839..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-From b3f1a164c7f742503dc7159011f7ad6b092b660e Mon Sep 17 00:00:00 2001
-From: Greg Ungerer <gerg@kernel.org>
-Date: Fri, 24 Nov 2023 14:15:28 +1000
-Subject: [PATCH] net: dsa: mv88e6xxx: fix marvell 6350 switch probing
-
-As of commit de5c9bf40c45 ("net: phylink: require supported_interfaces to
-be filled") Marvell 88e6350 switches fail to be probed:
-
-    ...
-    mv88e6085 d0072004.mdio-mii:11: switch 0x3710 detected: Marvell 88E6350, revision 2
-    mv88e6085 d0072004.mdio-mii:11: phylink: error: empty supported_interfaces
-    error creating PHYLINK: -22
-    mv88e6085: probe of d0072004.mdio-mii:11 failed with error -22
-    ...
-
-The problem stems from the use of mv88e6185_phylink_get_caps() to get
-the device capabilities. Create a new dedicated phylink_get_caps for the
-6351 family (which the 6350 is one of) to properly support their set of
-capabilities.
-
-According to chip.h the 6351 switch family includes the 6171, 6175, 6350
-and 6351 switches, so update each of these to use the correct
-phylink_get_caps.
-
-Fixes: de5c9bf40c45 ("net: phylink: require supported_interfaces to be filled")
-Signed-off-by: Greg Ungerer <gerg@kernel.org>
-Reviewed-by: Andrew Lunn <andrew@lunn.ch>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- drivers/net/dsa/mv88e6xxx/chip.c | 20 ++++++++++++++++----
- 1 file changed, 16 insertions(+), 4 deletions(-)
-
---- a/drivers/net/dsa/mv88e6xxx/chip.c
-+++ b/drivers/net/dsa/mv88e6xxx/chip.c
-@@ -652,6 +652,18 @@ static void mv88e6250_phylink_get_caps(s
-       config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100;
- }
-+static void mv88e6351_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
-+                                     struct phylink_config *config)
-+{
-+      unsigned long *supported = config->supported_interfaces;
-+
-+      /* Translate the default cmode */
-+      mv88e6xxx_translate_cmode(chip->ports[port].cmode, supported);
-+
-+      config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100 |
-+                                 MAC_1000FD;
-+}
-+
- static int mv88e6352_get_port4_serdes_cmode(struct mv88e6xxx_chip *chip)
- {
-       u16 reg, val;
-@@ -4498,7 +4510,7 @@ static const struct mv88e6xxx_ops mv88e6
-       .vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
-       .stu_getnext = mv88e6352_g1_stu_getnext,
-       .stu_loadpurge = mv88e6352_g1_stu_loadpurge,
--      .phylink_get_caps = mv88e6185_phylink_get_caps,
-+      .phylink_get_caps = mv88e6351_phylink_get_caps,
- };
- static const struct mv88e6xxx_ops mv88e6172_ops = {
-@@ -4599,7 +4611,7 @@ static const struct mv88e6xxx_ops mv88e6
-       .vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
-       .stu_getnext = mv88e6352_g1_stu_getnext,
-       .stu_loadpurge = mv88e6352_g1_stu_loadpurge,
--      .phylink_get_caps = mv88e6185_phylink_get_caps,
-+      .phylink_get_caps = mv88e6351_phylink_get_caps,
- };
- static const struct mv88e6xxx_ops mv88e6176_ops = {
-@@ -5256,7 +5268,7 @@ static const struct mv88e6xxx_ops mv88e6
-       .vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
-       .stu_getnext = mv88e6352_g1_stu_getnext,
-       .stu_loadpurge = mv88e6352_g1_stu_loadpurge,
--      .phylink_get_caps = mv88e6185_phylink_get_caps,
-+      .phylink_get_caps = mv88e6351_phylink_get_caps,
- };
- static const struct mv88e6xxx_ops mv88e6351_ops = {
-@@ -5302,7 +5314,7 @@ static const struct mv88e6xxx_ops mv88e6
-       .stu_loadpurge = mv88e6352_g1_stu_loadpurge,
-       .avb_ops = &mv88e6352_avb_ops,
-       .ptp_ops = &mv88e6352_ptp_ops,
--      .phylink_get_caps = mv88e6185_phylink_get_caps,
-+      .phylink_get_caps = mv88e6351_phylink_get_caps,
- };
- static const struct mv88e6xxx_ops mv88e6352_ops = {