kernel: backport phylink changes from mainline Linux

Let's pick a bunch of useful phylink changes which allow us to keep
drivers in sync with mainline Linux.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle
2024-01-28 03:36:40 +00:00
parent da970d63fb
commit d40756563c
91 changed files with 5582 additions and 335 deletions

View File

@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4942,6 +4942,8 @@ static int mtk_probe(struct platform_dev
@@ -4941,6 +4941,8 @@ static int mtk_probe(struct platform_dev
* for NAPI to work
*/
init_dummy_netdev(&eth->dummy_dev);

View File

@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1852,6 +1852,9 @@ void phy_detach(struct phy_device *phyde
@@ -1850,6 +1850,9 @@ void phy_detach(struct phy_device *phyde
struct module *ndev_owner = NULL;
struct mii_bus *bus;

View File

@@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1563,12 +1563,28 @@ static void mtk_wake_queue(struct mtk_et
@@ -1562,12 +1562,28 @@ static void mtk_wake_queue(struct mtk_et
}
}
@@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
bool gso = false;
int tx_num;
@@ -1590,6 +1606,18 @@ static netdev_tx_t mtk_start_xmit(struct
@@ -1589,6 +1605,18 @@ static netdev_tx_t mtk_start_xmit(struct
return NETDEV_TX_BUSY;
}
@@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* TSO: fill MSS info in tcp checksum field */
if (skb_is_gso(skb)) {
if (skb_cow_head(skb, 0)) {
@@ -1605,8 +1633,14 @@ static netdev_tx_t mtk_start_xmit(struct
@@ -1604,8 +1632,14 @@ static netdev_tx_t mtk_start_xmit(struct
}
}

View File

@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
switch (speed) {
case SPEED_2500:
case SPEED_1000:
@@ -3349,6 +3350,9 @@ found:
@@ -3348,6 +3349,9 @@ found:
if (dp->index >= MTK_QDMA_NUM_QUEUES)
return NOTIFY_DONE;

View File

@@ -476,9 +476,9 @@ 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,
@@ -4617,8 +4731,21 @@ static int mtk_add_mac(struct mtk_eth *e
.mac_config = mtk_mac_config,
@@ -4616,8 +4730,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);
@@ -500,7 +500,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);
@@ -4811,6 +4938,13 @@ static int mtk_probe(struct platform_dev
@@ -4810,6 +4937,13 @@ static int mtk_probe(struct platform_dev
if (err)
return err;

View 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
@@ -4886,7 +4886,10 @@ static int mtk_probe(struct platform_dev
@@ -4885,7 +4885,10 @@ static int mtk_probe(struct platform_dev
}
if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA)) {