generic: 6.6: mtk_eth_soc: add support for flow-control settings
authorDaniel Golle <daniel@makrotopia.org>
Thu, 4 Jul 2024 01:19:01 +0000 (02:19 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Wed, 10 Jul 2024 12:57:37 +0000 (14:57 +0200)
Add patch implementing operations to get and set flow-control link
parameters of mtk_eth_soc via ethtool.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 4a2f712f85b5e29c5763e92a0cc47265580157a3)

target/linux/generic/backport-5.15/752-30-v6.10-net-ethernet-mtk_eth_soc-implement-.-get-set-_pausep.patch [new file with mode: 0644]
target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch
target/linux/generic/pending-5.15/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch
target/linux/generic/pending-5.15/738-net-ethernet-mtk_eth_soc-set-coherent-mask-to-get-PP.patch

diff --git a/target/linux/generic/backport-5.15/752-30-v6.10-net-ethernet-mtk_eth_soc-implement-.-get-set-_pausep.patch b/target/linux/generic/backport-5.15/752-30-v6.10-net-ethernet-mtk_eth_soc-implement-.-get-set-_pausep.patch
new file mode 100644 (file)
index 0000000..1045e4d
--- /dev/null
@@ -0,0 +1,55 @@
+From 064fbc4e9b5a6dbda7fe7b67dc7e9e95d31f8d75 Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel@makrotopia.org>
+Date: Thu, 4 Jul 2024 11:14:55 +0100
+Subject: [PATCH] net: ethernet: mtk_eth_soc: implement .{get,set}_pauseparam
+ ethtool ops
+
+Implement operations to get and set flow-control link parameters.
+Both is done by simply calling phylink_ethtool_{get,set}_pauseparam().
+Fix whitespace in mtk_ethtool_ops while at it.
+
+Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
+Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
+Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
+Link: https://patch.msgid.link/e3ece47323444631d6cb479f32af0dfd6d145be0.1720088047.git.daniel@makrotopia.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/ethernet/mediatek/mtk_eth_soc.c | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -4361,6 +4361,20 @@ static int mtk_set_rxnfc(struct net_devi
+       return ret;
+ }
++static void mtk_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
++{
++      struct mtk_mac *mac = netdev_priv(dev);
++
++      phylink_ethtool_get_pauseparam(mac->phylink, pause);
++}
++
++static int mtk_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
++{
++      struct mtk_mac *mac = netdev_priv(dev);
++
++      return phylink_ethtool_set_pauseparam(mac->phylink, pause);
++}
++
+ static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb,
+                           struct net_device *sb_dev)
+ {
+@@ -4389,8 +4403,10 @@ static const struct ethtool_ops mtk_etht
+       .get_strings            = mtk_get_strings,
+       .get_sset_count         = mtk_get_sset_count,
+       .get_ethtool_stats      = mtk_get_ethtool_stats,
++      .get_pauseparam         = mtk_get_pauseparam,
++      .set_pauseparam         = mtk_set_pauseparam,
+       .get_rxnfc              = mtk_get_rxnfc,
+-      .set_rxnfc              = mtk_set_rxnfc,
++      .set_rxnfc              = mtk_set_rxnfc,
+ };
+ static const struct net_device_ops mtk_netdev_ops = {
index cee9f8ad1e9cfd2ccd1762efebfbf7b7876e8e51..63e94abb73ad724f09baccaad8c6e4e0bb3ca567 100644 (file)
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        }
  
        return IRQ_HANDLED;
-@@ -4899,6 +4899,8 @@ static int mtk_probe(struct platform_dev
+@@ -4915,6 +4915,8 @@ static int mtk_probe(struct platform_dev
         * for NAPI to work
         */
        init_dummy_netdev(&eth->dummy_dev);
index 52648f08f0eab245a8b497f2c4a8bf0217c32993..0be9d5ff9b9a9ef1ec984165b69a6a64b5faa4e2 100644 (file)
@@ -479,7 +479,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  static const struct phylink_mac_ops mtk_phylink_ops = {
        .validate = phylink_generic_validate,
        .mac_select_pcs = mtk_mac_select_pcs,
-@@ -4574,8 +4689,21 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4590,8 +4705,21 @@ static int mtk_add_mac(struct mtk_eth *e
                phy_interface_zero(mac->phylink_config.supported_interfaces);
                __set_bit(PHY_INTERFACE_MODE_INTERNAL,
                          mac->phylink_config.supported_interfaces);
@@ -501,7 +501,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        phylink = phylink_create(&mac->phylink_config,
                                 of_fwnode_handle(mac->of_node),
                                 phy_mode, &mtk_phylink_ops);
-@@ -4768,6 +4896,13 @@ static int mtk_probe(struct platform_dev
+@@ -4784,6 +4912,13 @@ static int mtk_probe(struct platform_dev
  
                if (err)
                        return err;
index 9fda58c8abcb7e14a73f2a72ed581f9c19329aec..67290062990cf5dc38fb604929aa43d2deb4836a 100644 (file)
@@ -32,7 +32,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4844,7 +4844,10 @@ static int mtk_probe(struct platform_dev
+@@ -4860,7 +4860,10 @@ static int mtk_probe(struct platform_dev
        }
  
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA)) {