openwrt/package/kernel/qca-nss-dp/patches/0011-01-edma_v1-rework-hw_reset-logic-to-permit-rmmod-and-in.patch
Christian Marangi 918e2fca1e
qca-nss-dp: add patch fixing rmmod and insmod
Add patch fixing rmmod and insmod. Lots of flawed logic fixed that
permits the module to correctly rmmod and insmod later.

Just to quote some change, use phy_detach instead of phy_disconnect, fix
exclusive reset_control that could only be used once, fix kernel panic
on second edma_cleanup, stop traffic before module exit...

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-04-18 11:54:21 +02:00

44 lines
1.3 KiB
Diff

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;