openwrt-cghmn-mt300n/package/kernel/qca-nss-dp/patches/0011-04-nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch
Robert Marko 1082c6556e kernel: qca-nss-dp: add back printing attached PHY-s
During the last update to 12.5.r2 printing of the attached PHY-s was
removed, so lets bring it back as it is very helpfull for debugging
OpenWrt issues without users having to modify NSS-DP to know if a PHY
was attached.

Refresh patches since nss_dp_main.c was edited.

Link: https://github.com/openwrt/openwrt/pull/15537
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-21 12:29:33 +02:00

36 lines
1.1 KiB
Diff

From 33dd3aa6d0f9cd240d63f53a49157ae44ebccf87 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Tue, 16 Apr 2024 16:12:11 +0200
Subject: [PATCH 4/6] nss_dp_main: call unregister_netdev first in dp_remove
and carrifer_off
In dp_remove move unregister_netdev up before calling exit and deinit
and first call netif_carrier_off to stop any traffic from happening and
prevent kernel panics for napi in the middle of transfer.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
nss_dp_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/nss_dp_main.c
+++ b/nss_dp_main.c
@@ -977,6 +977,9 @@ static int nss_dp_remove(struct platform
dp_ops = dp_priv->data_plane_ops;
hal_ops = dp_priv->gmac_hal_ops;
+ netif_carrier_off(dp_priv->netdev);
+ unregister_netdev(dp_priv->netdev);
+
if (dp_priv->phydev)
phy_disconnect(dp_priv->phydev);
@@ -988,7 +991,6 @@ static int nss_dp_remove(struct platform
#endif
hal_ops->exit(dp_priv->gmac_hal_ctx);
dp_ops->deinit(dp_priv->dpc);
- unregister_netdev(dp_priv->netdev);
free_netdev(dp_priv->netdev);
dp_global_ctx.nss_dp[i] = NULL;
}