From: Daniel Golle Date: Mon, 1 Jul 2024 19:28:14 +0000 (+0100) Subject: net: ethernet: mediatek: Allow gaps in MAC allocation X-Git-Tag: v6.11-rc1~163^2~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b2aef99221d395ce37efa426d7b50e7dcd621d6;p=thirdparty%2Flinux.git net: ethernet: mediatek: Allow gaps in MAC allocation Some devices with MediaTek SoCs don't use the first but only the second MAC in the chip. Especially with MT7981 which got a built-in 1GE PHY connected to the second MAC this is quite common. Make sure to reset and enable PSE also in those cases by skipping gaps using 'continue' instead of aborting the loop using 'break'. Fixes: dee4dd10c79a ("net: ethernet: mtk_eth_soc: ppe: add support for multiple PPEs") Suggested-by: Elad Yifee Signed-off-by: Daniel Golle Reviewed-by: Przemek Kitszel Link: https://patch.msgid.link/379ae584cea112db60f4ada79c7e5ba4f3364a64.1719862038.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 13d78d9b31972..2529b5b607c89 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -3396,7 +3396,7 @@ static int mtk_open(struct net_device *dev) for (i = 0; i < MTK_MAX_DEVS; i++) { if (!eth->netdev[i]) - break; + continue; target_mac = netdev_priv(eth->netdev[i]); if (!soc->offload_version) {