diff mbox series

MIPS: ath79: drop _machine_restart again

Message ID 20220110224844.2329275-1-lech.perczak@gmail.com (mailing list archive)
State Accepted
Commit d3115128bdafb62628ab41861a4f06f6d02ac320
Headers show
Series MIPS: ath79: drop _machine_restart again | expand

Commit Message

Lech Perczak Jan. 10, 2022, 10:48 p.m. UTC
Commit 81424d0ad0d4 ("MIPS: ath79: Use the reset controller to restart
OF machines") removed setup of _machine_restart on OF machines to use
reset handler in reset controller driver.
While removing remnants of non-OF machines in commit 3a77e0d75eed
("MIPS: ath79: drop machfiles"), this was introduced again, making it
impossible to use additional restart handlers registered through device
tree. Drop setting _machine_restart altogether, and ath79_restart
function, which is no longer used after this.

Fixes: 3a77e0d75eed ("MIPS: ath79: drop machfiles")
Cc: John Crispin <john@phrozen.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
---

Side note: a lot of code, that was previously encompassed by
"if (mips_machtype != ATH79_MACH_GENERIC_OF) {...} " seems to be
unnecessary at the time of dropping the non-OF machine definitions.
However it was retained for some reason, and I see a lot of references
to it by the drivers. OTOH, OF part of ath79 platform - basically whole ath79
target of OpenWrt works well without this code in 19.07 release, using 4.14.y
tree, on which the bug I'm fixing here is absent as well.

I tested this change on several devices:
TP-Link TL-WDR4300, TP-Link Archer C7v2, Meraki MR18 using OF,
and on ZTE MF286 - using OF as well - which is the very reason I discovered
this issue, as it requires registration of  gpio-restart handler,
ineffective due to this issue.

 arch/mips/ath79/setup.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Thomas Bogendoerfer Jan. 11, 2022, 3:18 p.m. UTC | #1
On Mon, Jan 10, 2022 at 11:48:44PM +0100, Lech Perczak wrote:
> Commit 81424d0ad0d4 ("MIPS: ath79: Use the reset controller to restart
> OF machines") removed setup of _machine_restart on OF machines to use
> reset handler in reset controller driver.
> While removing remnants of non-OF machines in commit 3a77e0d75eed
> ("MIPS: ath79: drop machfiles"), this was introduced again, making it
> impossible to use additional restart handlers registered through device
> tree. Drop setting _machine_restart altogether, and ath79_restart
> function, which is no longer used after this.
> 
> Fixes: 3a77e0d75eed ("MIPS: ath79: drop machfiles")
> Cc: John Crispin <john@phrozen.org>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
> ---
> 
> Side note: a lot of code, that was previously encompassed by
> "if (mips_machtype != ATH79_MACH_GENERIC_OF) {...} " seems to be
> unnecessary at the time of dropping the non-OF machine definitions.
> However it was retained for some reason, and I see a lot of references
> to it by the drivers. OTOH, OF part of ath79 platform - basically whole ath79
> target of OpenWrt works well without this code in 19.07 release, using 4.14.y
> tree, on which the bug I'm fixing here is absent as well.
> 
> I tested this change on several devices:
> TP-Link TL-WDR4300, TP-Link Archer C7v2, Meraki MR18 using OF,
> and on ZTE MF286 - using OF as well - which is the very reason I discovered
> this issue, as it requires registration of  gpio-restart handler,
> ineffective due to this issue.
> 
>  arch/mips/ath79/setup.c | 10 ----------
>  1 file changed, 10 deletions(-)

applied to mips-next.

Thomas.
diff mbox series

Patch

diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
index 891f495c4c3c..0ac435fe2dc9 100644
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
@@ -34,15 +34,6 @@ 
 
 static char ath79_sys_type[ATH79_SYS_TYPE_LEN];
 
-static void ath79_restart(char *command)
-{
-	local_irq_disable();
-	ath79_device_reset_set(AR71XX_RESET_FULL_CHIP);
-	for (;;)
-		if (cpu_wait)
-			cpu_wait();
-}
-
 static void ath79_halt(void)
 {
 	while (1)
@@ -234,7 +225,6 @@  void __init plat_mem_setup(void)
 
 	detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX);
 
-	_machine_restart = ath79_restart;
 	_machine_halt = ath79_halt;
 	pm_power_off = ath79_halt;
 }