forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: backport two fixes for MediaTek Ethernet driver
Fix PSE port assignment for 3rd GMAC on MT7988 and make sure dma_addr is always initialized to prevent potentially accessing uninitialized stack memory in the error path. Signed-off-by: Daniel Golle <[email protected]>
- Loading branch information
Showing
15 changed files
with
178 additions
and
24 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...neric/backport-5.15/750-v6.5-20-net-ethernet-mtk_eth_soc-fix-uninitialized-variable.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
From e10a35abb3da12b812cfb6fc6137926a0c81e39a Mon Sep 17 00:00:00 2001 | ||
From: Daniel Golle <[email protected]> | ||
Date: Sun, 10 Sep 2023 22:40:30 +0100 | ||
Subject: [PATCH] net: ethernet: mtk_eth_soc: fix uninitialized variable | ||
|
||
Variable dma_addr in function mtk_poll_rx can be uninitialized on | ||
some of the error paths. In practise this doesn't matter, even random | ||
data present in uninitialized stack memory can safely be used in the | ||
way it happens in the error path. | ||
|
||
However, in order to make Smatch happy make sure the variable is | ||
always initialized. | ||
|
||
Signed-off-by: Daniel Golle <[email protected]> | ||
Signed-off-by: David S. Miller <[email protected]> | ||
--- | ||
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 5 +++-- | ||
1 file changed, 3 insertions(+), 2 deletions(-) | ||
|
||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
@@ -1941,11 +1941,11 @@ static int mtk_poll_rx(struct napi_struc | ||
u8 *data, *new_data; | ||
struct mtk_rx_dma_v2 *rxd, trxd; | ||
int done = 0, bytes = 0; | ||
+ dma_addr_t dma_addr = DMA_MAPPING_ERROR; | ||
|
||
while (done < budget) { | ||
unsigned int pktlen, *rxdcsum; | ||
struct net_device *netdev; | ||
- dma_addr_t dma_addr; | ||
u32 hash, reason; | ||
int mac = 0; | ||
|
||
@@ -2122,7 +2122,8 @@ release_desc: | ||
else | ||
rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size); | ||
|
||
- if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA)) | ||
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA) && | ||
+ likely(dma_addr != DMA_MAPPING_ERROR)) | ||
rxd->rxd2 |= RX_DMA_PREP_ADDR64(dma_addr); | ||
|
||
ring->calc_idx = idx; |
33 changes: 33 additions & 0 deletions
33
...eric/backport-5.15/750-v6.5-21-net-ethernet-mtk_eth_soc-fix-pse_port-configuration-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
From 5a124b1fd3e6cb15a943f0cdfe96aa8f6d3d2f39 Mon Sep 17 00:00:00 2001 | ||
From: Lorenzo Bianconi <[email protected]> | ||
Date: Sat, 9 Sep 2023 20:41:56 +0200 | ||
Subject: [PATCH] net: ethernet: mtk_eth_soc: fix pse_port configuration for | ||
MT7988 | ||
|
||
MT7988 SoC support 3 NICs. Fix pse_port configuration in | ||
mtk_flow_set_output_device routine if the traffic is offloaded to eth2. | ||
Rely on mtk_pse_port definitions. | ||
|
||
Fixes: 88efedf517e6 ("net: ethernet: mtk_eth_soc: enable nft hw flowtable_offload for MT7988 SoC") | ||
Signed-off-by: Lorenzo Bianconi <[email protected]> | ||
Signed-off-by: David S. Miller <[email protected]> | ||
--- | ||
drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 6 ++++-- | ||
1 file changed, 4 insertions(+), 2 deletions(-) | ||
|
||
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
@@ -214,9 +214,11 @@ mtk_flow_set_output_device(struct mtk_et | ||
dsa_port = mtk_flow_get_dsa_port(&dev); | ||
|
||
if (dev == eth->netdev[0]) | ||
- pse_port = 1; | ||
+ pse_port = PSE_GDM1_PORT; | ||
else if (dev == eth->netdev[1]) | ||
- pse_port = 2; | ||
+ pse_port = PSE_GDM2_PORT; | ||
+ else if (dev == eth->netdev[2]) | ||
+ pse_port = PSE_GDM3_PORT; | ||
else | ||
return -EOPNOTSUPP; | ||
|
44 changes: 44 additions & 0 deletions
44
...eneric/backport-6.1/750-v6.5-20-net-ethernet-mtk_eth_soc-fix-uninitialized-variable.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
From e10a35abb3da12b812cfb6fc6137926a0c81e39a Mon Sep 17 00:00:00 2001 | ||
From: Daniel Golle <[email protected]> | ||
Date: Sun, 10 Sep 2023 22:40:30 +0100 | ||
Subject: [PATCH] net: ethernet: mtk_eth_soc: fix uninitialized variable | ||
|
||
Variable dma_addr in function mtk_poll_rx can be uninitialized on | ||
some of the error paths. In practise this doesn't matter, even random | ||
data present in uninitialized stack memory can safely be used in the | ||
way it happens in the error path. | ||
|
||
However, in order to make Smatch happy make sure the variable is | ||
always initialized. | ||
|
||
Signed-off-by: Daniel Golle <[email protected]> | ||
Signed-off-by: David S. Miller <[email protected]> | ||
--- | ||
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 5 +++-- | ||
1 file changed, 3 insertions(+), 2 deletions(-) | ||
|
||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
@@ -1989,11 +1989,11 @@ static int mtk_poll_rx(struct napi_struc | ||
u8 *data, *new_data; | ||
struct mtk_rx_dma_v2 *rxd, trxd; | ||
int done = 0, bytes = 0; | ||
+ dma_addr_t dma_addr = DMA_MAPPING_ERROR; | ||
|
||
while (done < budget) { | ||
unsigned int pktlen, *rxdcsum; | ||
struct net_device *netdev; | ||
- dma_addr_t dma_addr; | ||
u32 hash, reason; | ||
int mac = 0; | ||
|
||
@@ -2170,7 +2170,8 @@ release_desc: | ||
else | ||
rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size); | ||
|
||
- if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA)) | ||
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA) && | ||
+ likely(dma_addr != DMA_MAPPING_ERROR)) | ||
rxd->rxd2 |= RX_DMA_PREP_ADDR64(dma_addr); | ||
|
||
ring->calc_idx = idx; |
33 changes: 33 additions & 0 deletions
33
...neric/backport-6.1/750-v6.5-21-net-ethernet-mtk_eth_soc-fix-pse_port-configuration-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
From 5a124b1fd3e6cb15a943f0cdfe96aa8f6d3d2f39 Mon Sep 17 00:00:00 2001 | ||
From: Lorenzo Bianconi <[email protected]> | ||
Date: Sat, 9 Sep 2023 20:41:56 +0200 | ||
Subject: [PATCH] net: ethernet: mtk_eth_soc: fix pse_port configuration for | ||
MT7988 | ||
|
||
MT7988 SoC support 3 NICs. Fix pse_port configuration in | ||
mtk_flow_set_output_device routine if the traffic is offloaded to eth2. | ||
Rely on mtk_pse_port definitions. | ||
|
||
Fixes: 88efedf517e6 ("net: ethernet: mtk_eth_soc: enable nft hw flowtable_offload for MT7988 SoC") | ||
Signed-off-by: Lorenzo Bianconi <[email protected]> | ||
Signed-off-by: David S. Miller <[email protected]> | ||
--- | ||
drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 6 ++++-- | ||
1 file changed, 4 insertions(+), 2 deletions(-) | ||
|
||
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
@@ -214,9 +214,11 @@ mtk_flow_set_output_device(struct mtk_et | ||
dsa_port = mtk_flow_get_dsa_port(&dev); | ||
|
||
if (dev == eth->netdev[0]) | ||
- pse_port = 1; | ||
+ pse_port = PSE_GDM1_PORT; | ||
else if (dev == eth->netdev[1]) | ||
- pse_port = 2; | ||
+ pse_port = PSE_GDM2_PORT; | ||
+ else if (dev == eth->netdev[2]) | ||
+ pse_port = PSE_GDM3_PORT; | ||
else | ||
return -EOPNOTSUPP; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
|
||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
@@ -3095,8 +3095,8 @@ static irqreturn_t mtk_handle_irq_rx(int | ||
@@ -3096,8 +3096,8 @@ static irqreturn_t mtk_handle_irq_rx(int | ||
|
||
eth->rx_events++; | ||
if (likely(napi_schedule_prep(ð->rx_napi))) { | ||
|
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
} | ||
|
||
return IRQ_HANDLED; | ||
@@ -3108,8 +3108,8 @@ static irqreturn_t mtk_handle_irq_tx(int | ||
@@ -3109,8 +3109,8 @@ static irqreturn_t mtk_handle_irq_tx(int | ||
|
||
eth->tx_events++; | ||
if (likely(napi_schedule_prep(ð->tx_napi))) { | ||
|
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
} | ||
|
||
return IRQ_HANDLED; | ||
@@ -4883,6 +4883,8 @@ static int mtk_probe(struct platform_dev | ||
@@ -4884,6 +4884,8 @@ static int mtk_probe(struct platform_dev | ||
* for NAPI to work | ||
*/ | ||
init_dummy_netdev(ð->dummy_dev); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
switch (speed) { | ||
case SPEED_2500: | ||
case SPEED_1000: | ||
@@ -3288,6 +3289,9 @@ found: | ||
@@ -3289,6 +3290,9 @@ found: | ||
if (dp->index >= MTK_QDMA_NUM_QUEUES) | ||
return NOTIFY_DONE; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
|
||
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
@@ -235,7 +235,8 @@ out: | ||
@@ -237,7 +237,8 @@ out: | ||
} | ||
|
||
static int | ||
|
@@ -36,15 +36,15 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
{ | ||
struct flow_rule *rule = flow_cls_offload_flow_rule(f); | ||
struct flow_action_entry *act; | ||
@@ -452,6 +453,7 @@ mtk_flow_offload_replace(struct mtk_eth | ||
@@ -454,6 +455,7 @@ mtk_flow_offload_replace(struct mtk_eth | ||
entry->cookie = f->cookie; | ||
memcpy(&entry->data, &foe, sizeof(entry->data)); | ||
entry->wed_index = wed_index; | ||
+ entry->ppe_index = ppe_index; | ||
|
||
err = mtk_foe_entry_commit(eth->ppe[entry->ppe_index], entry); | ||
if (err < 0) | ||
@@ -520,25 +522,15 @@ mtk_flow_offload_stats(struct mtk_eth *e | ||
@@ -522,25 +524,15 @@ mtk_flow_offload_stats(struct mtk_eth *e | ||
|
||
static DEFINE_MUTEX(mtk_flow_offload_mutex); | ||
|
||
|
@@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
break; | ||
case FLOW_CLS_DESTROY: | ||
err = mtk_flow_offload_destroy(eth, cls); | ||
@@ -556,6 +548,23 @@ mtk_eth_setup_tc_block_cb(enum tc_setup_ | ||
@@ -558,6 +550,23 @@ mtk_eth_setup_tc_block_cb(enum tc_setup_ | ||
} | ||
|
||
static int | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,7 +308,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
seq_printf(m, "%05x %s %7s", i, | ||
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
@@ -499,24 +499,21 @@ static int | ||
@@ -501,24 +501,21 @@ static int | ||
mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f) | ||
{ | ||
struct mtk_flow_entry *entry; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -478,7 +478,7 @@ Signed-off-by: Daniel Golle <[email protected]> | |
static const struct phylink_mac_ops mtk_phylink_ops = { | ||
.validate = phylink_generic_validate, | ||
.mac_select_pcs = mtk_mac_select_pcs, | ||
@@ -4558,8 +4672,21 @@ static int mtk_add_mac(struct mtk_eth *e | ||
@@ -4559,8 +4673,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 <[email protected]> | |
phylink = phylink_create(&mac->phylink_config, | ||
of_fwnode_handle(mac->of_node), | ||
phy_mode, &mtk_phylink_ops); | ||
@@ -4752,6 +4879,13 @@ static int mtk_probe(struct platform_dev | ||
@@ -4753,6 +4880,13 @@ static int mtk_probe(struct platform_dev | ||
|
||
if (err) | ||
return err; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
|
||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
@@ -3151,8 +3151,8 @@ static irqreturn_t mtk_handle_irq_rx(int | ||
@@ -3152,8 +3152,8 @@ static irqreturn_t mtk_handle_irq_rx(int | ||
|
||
eth->rx_events++; | ||
if (likely(napi_schedule_prep(ð->rx_napi))) { | ||
|
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
} | ||
|
||
return IRQ_HANDLED; | ||
@@ -3164,8 +3164,8 @@ static irqreturn_t mtk_handle_irq_tx(int | ||
@@ -3165,8 +3165,8 @@ static irqreturn_t mtk_handle_irq_tx(int | ||
|
||
eth->tx_events++; | ||
if (likely(napi_schedule_prep(ð->tx_napi))) { | ||
|
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
} | ||
|
||
return IRQ_HANDLED; | ||
@@ -4937,6 +4937,8 @@ static int mtk_probe(struct platform_dev | ||
@@ -4938,6 +4938,8 @@ static int mtk_probe(struct platform_dev | ||
* for NAPI to work | ||
*/ | ||
init_dummy_netdev(ð->dummy_dev); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
switch (speed) { | ||
case SPEED_2500: | ||
case SPEED_1000: | ||
@@ -3344,6 +3345,9 @@ found: | ||
@@ -3345,6 +3346,9 @@ found: | ||
if (dp->index >= MTK_QDMA_NUM_QUEUES) | ||
return NOTIFY_DONE; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
|
||
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
@@ -235,7 +235,8 @@ out: | ||
@@ -237,7 +237,8 @@ out: | ||
} | ||
|
||
static int | ||
|
@@ -41,15 +41,15 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
{ | ||
struct flow_rule *rule = flow_cls_offload_flow_rule(f); | ||
struct flow_action_entry *act; | ||
@@ -452,6 +453,7 @@ mtk_flow_offload_replace(struct mtk_eth | ||
@@ -454,6 +455,7 @@ mtk_flow_offload_replace(struct mtk_eth | ||
entry->cookie = f->cookie; | ||
memcpy(&entry->data, &foe, sizeof(entry->data)); | ||
entry->wed_index = wed_index; | ||
+ entry->ppe_index = ppe_index; | ||
|
||
err = mtk_foe_entry_commit(eth->ppe[entry->ppe_index], entry); | ||
if (err < 0) | ||
@@ -520,25 +522,15 @@ mtk_flow_offload_stats(struct mtk_eth *e | ||
@@ -522,25 +524,15 @@ mtk_flow_offload_stats(struct mtk_eth *e | ||
|
||
static DEFINE_MUTEX(mtk_flow_offload_mutex); | ||
|
||
|
@@ -78,7 +78,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
break; | ||
case FLOW_CLS_DESTROY: | ||
err = mtk_flow_offload_destroy(eth, cls); | ||
@@ -556,6 +548,23 @@ mtk_eth_setup_tc_block_cb(enum tc_setup_ | ||
@@ -558,6 +550,23 @@ mtk_eth_setup_tc_block_cb(enum tc_setup_ | ||
} | ||
|
||
static int | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,7 +308,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
seq_printf(m, "%05x %s %7s", i, | ||
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c | ||
@@ -499,24 +499,21 @@ static int | ||
@@ -501,24 +501,21 @@ static int | ||
mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f) | ||
{ | ||
struct mtk_flow_entry *entry; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -478,7 +478,7 @@ Signed-off-by: Daniel Golle <[email protected]> | |
static const struct phylink_mac_ops mtk_phylink_ops = { | ||
.validate = phylink_generic_validate, | ||
.mac_select_pcs = mtk_mac_select_pcs, | ||
@@ -4612,8 +4726,21 @@ static int mtk_add_mac(struct mtk_eth *e | ||
@@ -4613,8 +4727,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 <[email protected]> | |
phylink = phylink_create(&mac->phylink_config, | ||
of_fwnode_handle(mac->of_node), | ||
phy_mode, &mtk_phylink_ops); | ||
@@ -4806,6 +4933,13 @@ static int mtk_probe(struct platform_dev | ||
@@ -4807,6 +4934,13 @@ static int mtk_probe(struct platform_dev | ||
|
||
if (err) | ||
return err; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,15 @@ Signed-off-by: René van Dorst <[email protected]> | |
|
||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
@@ -4553,6 +4553,7 @@ static const struct net_device_ops mtk_n | ||
@@ -4554,6 +4554,7 @@ static const struct net_device_ops mtk_n | ||
|
||
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) | ||
{ | ||
+ const char *name = of_get_property(np, "label", NULL); | ||
const __be32 *_id = of_get_property(np, "reg", NULL); | ||
phy_interface_t phy_mode; | ||
struct phylink *phylink; | ||
@@ -4724,6 +4725,9 @@ static int mtk_add_mac(struct mtk_eth *e | ||
@@ -4725,6 +4726,9 @@ static int mtk_add_mac(struct mtk_eth *e | ||
register_netdevice_notifier(&mac->device_notifier); | ||
} | ||
|
||
|