The .mac_link_down() in phylink callback disable MAC TX and RX
unconditionally. This is not suitable for devices using NCSI, where the
MAC needs to remain enabled after the link goes down to support the
corresponding functionality.
Skip disabling MAC TX and RX when the subsystem device ID indicates an
NCSI device. Keep the existing link-down handling for other devices.
Fixes: 6f8b4c01a8cd ("net: txgbe: Implement PHYLINK for AML 25G/10G devices")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
index 26d0cfc58ee2c..16b166b010ef6 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
@@ -458,8 +458,10 @@ static void txgbe_mac_link_down_aml(struct phylink_config *config,
{
struct wx *wx = phylink_to_wx(config);
- wr32m(wx, TXGBE_AML_MAC_TX_CFG, TXGBE_AML_MAC_TX_CFG_TE, 0);
- wr32m(wx, WX_MAC_RX_CFG, WX_MAC_RX_CFG_RE, 0);
+ if (!((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP)) {
+ wr32m(wx, TXGBE_AML_MAC_TX_CFG, TXGBE_AML_MAC_TX_CFG_TE, 0);
+ wr32m(wx, WX_MAC_RX_CFG, WX_MAC_RX_CFG_RE, 0);
+ }
wx->speed = SPEED_UNKNOWN;
if (test_bit(WX_STATE_PTP_RUNNING, wx->state))--
2.51.0