-
Notifications
You must be signed in to change notification settings - Fork 19.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: qca-ssdk/qca-nss-dp: update to 12.5 for kernel 6.6 support
- Loading branch information
1 parent
f2e1532
commit 2b10822
Showing
40 changed files
with
4,750 additions
and
127 deletions.
There are no files selected for viewing
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
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
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
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
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
10 changes: 10 additions & 0 deletions
10
package/qca/qca-nss-dp/patches/0010-nss-dp-add-vlan-if.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,10 @@ | ||
--- a/nss_dp_main.c | ||
+++ b/nss_dp_main.c | ||
@@ -18,6 +18,7 @@ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/module.h> | ||
+#include <linux/if_vlan.h> | ||
#include <linux/version.h> | ||
#include <linux/of.h> | ||
#include <linux/of_net.h> |
43 changes: 43 additions & 0 deletions
43
...qca/qca-nss-dp/patches/0011-01-edma_v1-rework-hw_reset-logic-to-permit-rmmod-and-in.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,43 @@ | ||
From c318c90b824c59539bf2e33618e381293398616c Mon Sep 17 00:00:00 2001 | ||
From: Christian Marangi <ansuelsmth@gmail.com> | ||
Date: Tue, 16 Apr 2024 15:02:49 +0200 | ||
Subject: [PATCH 1/6] edma_v1: rework hw_reset logic to permit rmmod and insmod | ||
|
||
Rework hw_reset logic for edma v1 to permit rmmod and insmod by using | ||
get_exclusive_released variant (assuming the reset control was released) | ||
and manually acquire and release it. | ||
|
||
This permits rmmod and insmod without triggering warning or receiving | ||
-EBUSY errors. | ||
|
||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> | ||
--- | ||
hal/dp_ops/edma_dp/edma_v1/edma_cfg.c | 6 +++++- | ||
1 file changed, 5 insertions(+), 1 deletion(-) | ||
|
||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c | ||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c | ||
@@ -719,18 +719,22 @@ int edma_hw_reset(struct edma_hw *ehw) | ||
struct reset_control *rst; | ||
struct platform_device *pdev = ehw->pdev; | ||
|
||
- rst = devm_reset_control_get(&pdev->dev, EDMA_HW_RESET_ID); | ||
+ rst = devm_reset_control_get_exclusive_released(&pdev->dev, EDMA_HW_RESET_ID); | ||
if (IS_ERR(rst)) { | ||
pr_warn("DTS Node: %s does not exist\n", EDMA_HW_RESET_ID); | ||
return -EINVAL; | ||
} | ||
|
||
+ reset_control_acquire(rst); | ||
+ | ||
reset_control_assert(rst); | ||
udelay(100); | ||
|
||
reset_control_deassert(rst); | ||
udelay(100); | ||
|
||
+ reset_control_release(rst); | ||
+ | ||
pr_info("EDMA HW Reset completed succesfully\n"); | ||
|
||
return 0; |
59 changes: 59 additions & 0 deletions
59
...qca/qca-nss-dp/patches/0011-02-nss_dp_switchdev-correctly-unregister-notifier-on-dp.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,59 @@ | ||
From 079bfe441b274a8c06474be82e4ccc88599a5e0e Mon Sep 17 00:00:00 2001 | ||
From: Christian Marangi <ansuelsmth@gmail.com> | ||
Date: Tue, 16 Apr 2024 16:08:46 +0200 | ||
Subject: [PATCH 2/6] nss_dp_switchdev: correctly unregister notifier on | ||
dp_remove | ||
|
||
Correctly unregister notifier on dp_remove to fix kernel panic on system | ||
reboot. | ||
|
||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> | ||
--- | ||
include/nss_dp_dev.h | 1 + | ||
nss_dp_main.c | 4 ++++ | ||
nss_dp_switchdev.c | 13 +++++++++++++ | ||
3 files changed, 18 insertions(+) | ||
|
||
--- a/include/nss_dp_dev.h | ||
+++ b/include/nss_dp_dev.h | ||
@@ -349,6 +349,7 @@ void nss_dp_set_ethtool_ops(struct net_d | ||
*/ | ||
#ifdef CONFIG_NET_SWITCHDEV | ||
void nss_dp_switchdev_setup(struct net_device *dev); | ||
+void nss_dp_switchdev_remove(struct net_device *dev); | ||
bool nss_dp_is_phy_dev(struct net_device *dev); | ||
#endif | ||
|
||
--- a/nss_dp_main.c | ||
+++ b/nss_dp_main.c | ||
@@ -970,6 +970,10 @@ static int nss_dp_remove(struct platform | ||
if (!dp_priv) | ||
continue; | ||
|
||
+ #ifdef CONFIG_NET_SWITCHDEV | ||
+ nss_dp_switchdev_remove(dp_priv->netdev); | ||
+ #endif | ||
+ | ||
dp_ops = dp_priv->data_plane_ops; | ||
hal_ops = dp_priv->gmac_hal_ops; | ||
|
||
--- a/nss_dp_switchdev.c | ||
+++ b/nss_dp_switchdev.c | ||
@@ -648,4 +648,17 @@ void nss_dp_switchdev_setup(struct net_d | ||
|
||
switch_init_done = true; | ||
} | ||
+ | ||
+void nss_dp_switchdev_remove(struct net_device *dev) | ||
+{ | ||
+ if (!switch_init_done) | ||
+ return; | ||
+ | ||
+ if (nss_dp_sw_ev_nb) | ||
+ unregister_switchdev_notifier(nss_dp_sw_ev_nb); | ||
+ | ||
+ unregister_switchdev_blocking_notifier(&nss_dp_switchdev_notifier); | ||
+ | ||
+ switch_init_done = false; | ||
+} | ||
#endif |
35 changes: 35 additions & 0 deletions
35
package/qca/qca-nss-dp/patches/0011-03-nss_dp_main-swap-dp_exit-function-call.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,35 @@ | ||
From ab7b1a361d51157118e1a61ce6530a59bcef4b61 Mon Sep 17 00:00:00 2001 | ||
From: Christian Marangi <ansuelsmth@gmail.com> | ||
Date: Tue, 16 Apr 2024 16:10:09 +0200 | ||
Subject: [PATCH 3/6] nss_dp_main: swap dp_exit function call | ||
|
||
First unregister nss_dp platform devices then cleanup the HAL. | ||
|
||
This is to fix kernel panic by cleaning data that needs to be used by | ||
platform driver unregister functions. | ||
|
||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> | ||
--- | ||
nss_dp_main.c | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
--- a/nss_dp_main.c | ||
+++ b/nss_dp_main.c | ||
@@ -1161,6 +1161,8 @@ int __init nss_dp_init(void) | ||
*/ | ||
void __exit nss_dp_exit(void) | ||
{ | ||
+ platform_driver_unregister(&nss_dp_drv); | ||
+ | ||
/* | ||
* TODO Move this to soc_ops | ||
*/ | ||
@@ -1168,8 +1170,6 @@ void __exit nss_dp_exit(void) | ||
nss_dp_hal_cleanup(); | ||
dp_global_ctx.common_init_done = false; | ||
} | ||
- | ||
- platform_driver_unregister(&nss_dp_drv); | ||
} | ||
|
||
module_init(nss_dp_init); |
35 changes: 35 additions & 0 deletions
35
...qca/qca-nss-dp/patches/0011-04-nss_dp_main-call-unregister_netdev-first-in-dp_remov.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,35 @@ | ||
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; | ||
} |
26 changes: 26 additions & 0 deletions
26
...qca/qca-nss-dp/patches/0011-05-nss_dp_main-use-phy_detach-instead-of-disconnect-in-.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,26 @@ | ||
From 655b07b701271bc00952fe64aeb14f993a48a50e Mon Sep 17 00:00:00 2001 | ||
From: Christian Marangi <ansuelsmth@gmail.com> | ||
Date: Tue, 16 Apr 2024 16:17:36 +0200 | ||
Subject: [PATCH 5/6] nss_dp_main: use phy_detach instead of disconnect in | ||
dp_remove | ||
|
||
Use phy_detach instead of disconnect in dp_remove. On Module remove, phy | ||
are already disconnected but they need to be detached to be correctly | ||
reattached later with an insmod. | ||
|
||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> | ||
--- | ||
nss_dp_main.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
--- a/nss_dp_main.c | ||
+++ b/nss_dp_main.c | ||
@@ -981,7 +981,7 @@ static int nss_dp_remove(struct platform | ||
unregister_netdev(dp_priv->netdev); | ||
|
||
if (dp_priv->phydev) | ||
- phy_disconnect(dp_priv->phydev); | ||
+ phy_detach(dp_priv->phydev); | ||
|
||
#if defined(NSS_DP_PPE_SUPPORT) | ||
/* |
Oops, something went wrong.