From 1082c6556ea824ec6ff3cae05b4f0764d28552db Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Tue, 21 May 2024 11:28:07 +0200 Subject: [PATCH] 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 --- ...nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch | 3 ++- ...nss_dp_switchdev-correctly-unregister-notifier-on-dp.patch | 2 +- .../0011-03-nss_dp_main-swap-dp_exit-function-call.patch | 4 ++-- ...nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch | 4 ++-- ...nss_dp_main-use-phy_detach-instead-of-disconnect-in-.patch | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch b/package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch index 20a7e6b350..518e961760 100644 --- a/package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch +++ b/package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch @@ -149,7 +149,7 @@ Signed-off-by: Robert Marko #if defined(NSS_DP_PPE_SUPPORT) uint32_t vsi_id; fal_port_t port_id; -@@ -940,22 +883,15 @@ static int32_t nss_dp_probe(struct platf +@@ -940,22 +883,16 @@ static int32_t nss_dp_probe(struct platf dp_priv->drv_flags |= NSS_DP_PRIV_FLAG(INIT_DONE); @@ -177,6 +177,7 @@ Signed-off-by: Robert Marko + netdev_err(netdev, "failed to connect to phy device\n"); + goto phy_setup_fail; + } ++ phy_attached_info(dp_priv->phydev); } #if defined(NSS_DP_PPE_SUPPORT) diff --git a/package/kernel/qca-nss-dp/patches/0011-02-nss_dp_switchdev-correctly-unregister-notifier-on-dp.patch b/package/kernel/qca-nss-dp/patches/0011-02-nss_dp_switchdev-correctly-unregister-notifier-on-dp.patch index 8379fcf20c..5abf178d38 100644 --- a/package/kernel/qca-nss-dp/patches/0011-02-nss_dp_switchdev-correctly-unregister-notifier-on-dp.patch +++ b/package/kernel/qca-nss-dp/patches/0011-02-nss_dp_switchdev-correctly-unregister-notifier-on-dp.patch @@ -26,7 +26,7 @@ Signed-off-by: Christian Marangi --- a/nss_dp_main.c +++ b/nss_dp_main.c -@@ -972,6 +972,10 @@ static int nss_dp_remove(struct platform +@@ -970,6 +970,10 @@ static int nss_dp_remove(struct platform if (!dp_priv) continue; diff --git a/package/kernel/qca-nss-dp/patches/0011-03-nss_dp_main-swap-dp_exit-function-call.patch b/package/kernel/qca-nss-dp/patches/0011-03-nss_dp_main-swap-dp_exit-function-call.patch index 68a9821ceb..08088954fb 100644 --- a/package/kernel/qca-nss-dp/patches/0011-03-nss_dp_main-swap-dp_exit-function-call.patch +++ b/package/kernel/qca-nss-dp/patches/0011-03-nss_dp_main-swap-dp_exit-function-call.patch @@ -15,7 +15,7 @@ Signed-off-by: Christian Marangi --- a/nss_dp_main.c +++ b/nss_dp_main.c -@@ -1163,6 +1163,8 @@ int __init nss_dp_init(void) +@@ -1161,6 +1161,8 @@ int __init nss_dp_init(void) */ void __exit nss_dp_exit(void) { @@ -24,7 +24,7 @@ Signed-off-by: Christian Marangi /* * TODO Move this to soc_ops */ -@@ -1170,8 +1172,6 @@ void __exit nss_dp_exit(void) +@@ -1168,8 +1170,6 @@ void __exit nss_dp_exit(void) nss_dp_hal_cleanup(); dp_global_ctx.common_init_done = false; } diff --git a/package/kernel/qca-nss-dp/patches/0011-04-nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch b/package/kernel/qca-nss-dp/patches/0011-04-nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch index 2721d2cfba..f8daa525fe 100644 --- a/package/kernel/qca-nss-dp/patches/0011-04-nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch +++ b/package/kernel/qca-nss-dp/patches/0011-04-nss_dp_main-call-unregister_netdev-first-in-dp_remov.patch @@ -15,7 +15,7 @@ Signed-off-by: Christian Marangi --- a/nss_dp_main.c +++ b/nss_dp_main.c -@@ -979,6 +979,9 @@ static int nss_dp_remove(struct platform +@@ -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; @@ -25,7 +25,7 @@ Signed-off-by: Christian Marangi if (dp_priv->phydev) phy_disconnect(dp_priv->phydev); -@@ -990,7 +993,6 @@ static int nss_dp_remove(struct platform +@@ -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); diff --git a/package/kernel/qca-nss-dp/patches/0011-05-nss_dp_main-use-phy_detach-instead-of-disconnect-in-.patch b/package/kernel/qca-nss-dp/patches/0011-05-nss_dp_main-use-phy_detach-instead-of-disconnect-in-.patch index 3c99cae2d5..1633e009ea 100644 --- a/package/kernel/qca-nss-dp/patches/0011-05-nss_dp_main-use-phy_detach-instead-of-disconnect-in-.patch +++ b/package/kernel/qca-nss-dp/patches/0011-05-nss_dp_main-use-phy_detach-instead-of-disconnect-in-.patch @@ -15,7 +15,7 @@ Signed-off-by: Christian Marangi --- a/nss_dp_main.c +++ b/nss_dp_main.c -@@ -983,7 +983,7 @@ static int nss_dp_remove(struct platform +@@ -981,7 +981,7 @@ static int nss_dp_remove(struct platform unregister_netdev(dp_priv->netdev); if (dp_priv->phydev) -- 2.30.2