From 4bbe424cd7e3862908e672e47ecb1205539a6ed3 Mon Sep 17 00:00:00 2001
From: Nico <github@nicoboehr.de>
Date: Sat, 14 Dec 2024 22:43:53 +0000
Subject: [PATCH] add patch for reset on wdr3600

Retry the reset until it finally works.

Without patch failing reboots after 5, 20 and 250 tries.

With patch >1500 successfull reboots and counting.

Script for reboot loop:
https://gitlab.freifunk-stuttgart.de/-/snippets/8
---
 ...add-patch-for-reset-retry-on-wdr3600.patch | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 patches/openwrt/0012-add-patch-for-reset-retry-on-wdr3600.patch

diff --git a/patches/openwrt/0012-add-patch-for-reset-retry-on-wdr3600.patch b/patches/openwrt/0012-add-patch-for-reset-retry-on-wdr3600.patch
new file mode 100644
index 000000000..d8dfcdab5
--- /dev/null
+++ b/patches/openwrt/0012-add-patch-for-reset-retry-on-wdr3600.patch
@@ -0,0 +1,28 @@
+From: Nico <github@nicoboehr.de>
+Date: Sat, 14 Dec 2024 22:41:57 +0000
+Subject: add patch for reset retry on wdr3600
+
+Signed-off-by: Nico <github@nicoboehr.de>
+
+diff --git a/target/linux/ath79/patches-5.15/940-ath79-reset-retry-wdr3400.patch b/target/linux/ath79/patches-5.15/940-ath79-reset-retry-wdr3400.patch
+new file mode 100644
+index 0000000000000000000000000000000000000000..a95d47f6495cc4ac67951e88bd8811ccffff5898
+--- /dev/null
++++ b/target/linux/ath79/patches-5.15/940-ath79-reset-retry-wdr3400.patch
+@@ -0,0 +1,16 @@
++--- a/drivers/reset/reset-ath79.c
+++++ b/drivers/reset/reset-ath79.c
++@@ -79,8 +79,12 @@ static int ath79_reset_restart_handler(s
++ {
++ 	struct ath79_reset *ath79_reset =
++ 		container_of(nb, struct ath79_reset, restart_nb);
+++	unsigned int i = 0;
++ 
++-	ath79_reset_assert(&ath79_reset->rcdev, FULL_CHIP_RESET);
+++	while (1) {
+++		ath79_reset_assert(&ath79_reset->rcdev, FULL_CHIP_RESET);
+++		printk("reset: still alive after %u tries\n", i);
+++	}
++ 
++ 	return NOTIFY_DONE;
++ }
-- 
GitLab