b62586b992f6c988246fe343297537f2b721e3d6
[openwrt/staging/wigyori.git] /
1 From 3b2aef99221d395ce37efa426d7b50e7dcd621d6 Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Mon, 1 Jul 2024 20:28:14 +0100
4 Subject: [PATCH] net: ethernet: mediatek: Allow gaps in MAC allocation
5
6 Some devices with MediaTek SoCs don't use the first but only the second
7 MAC in the chip. Especially with MT7981 which got a built-in 1GE PHY
8 connected to the second MAC this is quite common.
9 Make sure to reset and enable PSE also in those cases by skipping gaps
10 using 'continue' instead of aborting the loop using 'break'.
11
12 Fixes: dee4dd10c79a ("net: ethernet: mtk_eth_soc: ppe: add support for multiple PPEs")
13 Suggested-by: Elad Yifee <eladwf@gmail.com>
14 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
15 Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
16 Link: https://patch.msgid.link/379ae584cea112db60f4ada79c7e5ba4f3364a64.1719862038.git.daniel@makrotopia.org
17 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
18 ---
19 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
23 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
24 @@ -3396,7 +3396,7 @@ static int mtk_open(struct net_device *d
25
26 for (i = 0; i < MTK_MAX_DEVS; i++) {
27 if (!eth->netdev[i])
28 - break;
29 + continue;
30
31 target_mac = netdev_priv(eth->netdev[i]);
32 if (!soc->offload_version) {