forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New patch was added which will go as fix via netdev tree. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
- Loading branch information
Showing
2 changed files
with
71 additions
and
20 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
.../linux/generic/pending-6.6/735-net-mediatek-mtk_eth_soc-release-MAC_MCR_FORCE_LINK-.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,50 @@ | ||
From ef5976ae4e117fae9a61bb3c0f8319a917a425ea Mon Sep 17 00:00:00 2001 | ||
From: Daniel Golle <daniel@makrotopia.org> | ||
Date: Mon, 11 Mar 2024 17:43:28 +0000 | ||
Subject: [PATCH] net: mediatek: mtk_eth_soc: release MAC_MCR_FORCE_LINK only when MAC is up | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
Clearing bit MAC_MCR_FORCE_LINK which forces the link down too early | ||
can result in MAC ending up in a broken/blocked state. | ||
|
||
Fix this by handling this bit in the .mac_link_up and .mac_link_down | ||
calls instead of in .mac_finish. | ||
|
||
Fixes: b8fc9f30821ec ("net: ethernet: mediatek: Add basic PHYLINK support") | ||
Signed-off-by: Daniel Golle <daniel@makrotopia.org> | ||
--- | ||
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 +++---- | ||
1 file changed, 3 insertions(+), 4 deletions(-) | ||
|
||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
@@ -678,8 +678,7 @@ static int mtk_mac_finish(struct phylink | ||
mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id)); | ||
mcr_new = mcr_cur; | ||
mcr_new |= MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE | | ||
- MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_FORCE_LINK | | ||
- MAC_MCR_RX_FIFO_CLR_DIS; | ||
+ MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_RX_FIFO_CLR_DIS; | ||
|
||
/* Only update control register when needed! */ | ||
if (mcr_new != mcr_cur) | ||
@@ -695,7 +694,7 @@ static void mtk_mac_link_down(struct phy | ||
phylink_config); | ||
u32 mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id)); | ||
|
||
- mcr &= ~(MAC_MCR_TX_EN | MAC_MCR_RX_EN); | ||
+ mcr &= ~(MAC_MCR_TX_EN | MAC_MCR_RX_EN | MAC_MCR_FORCE_LINK); | ||
mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id)); | ||
} | ||
|
||
@@ -804,7 +803,7 @@ static void mtk_mac_link_up(struct phyli | ||
if (rx_pause) | ||
mcr |= MAC_MCR_FORCE_RX_FC; | ||
|
||
- mcr |= MAC_MCR_TX_EN | MAC_MCR_RX_EN; | ||
+ mcr |= MAC_MCR_TX_EN | MAC_MCR_RX_EN | MAC_MCR_FORCE_LINK; | ||
mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id)); | ||
} | ||
|
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