7aa501514df8a690b44f9ac4b172026478d86029
[openwrt/openwrt.git] / target / linux / ath79 / patches-6.6 / 100-reset-ath79-read-back-reset-register.patch
1 From 661edfc3dab943a67c8821353b63cc23057f7ce9 Mon Sep 17 00:00:00 2001
2 From: David Bauer <mail@david-bauer.net>
3 Date: Tue, 9 Jan 2024 20:48:46 +0100
4 Subject: [PATCH] reset: ath79: read back reset register
5
6 Read back the reset register in order to flush the cache. This fixes
7 spurious reboot hangs on TP-Link TL-WDR3600 and TL-WDR4300 with Zentel
8 DRAM chips.
9
10 This issue was fixed in the past, but switching to the reset-driver
11 specific implementation removed the old fix.
12
13 Link: https://github.com/freifunk-gluon/gluon/issues/2904
14 Link: https://github.com/openwrt/openwrt/issues/13043
15 Link: https://dev.archive.openwrt.org/ticket/17839
16 Link: f8a7bfe1cb2c ("MIPS: ath79: fix system restart")
17
18 Signed-off-by: David Bauer <mail@david-bauer.net>
19 ---
20 drivers/reset/reset-ath79.c | 2 ++
21 1 file changed, 2 insertions(+)
22
23 --- a/drivers/reset/reset-ath79.c
24 +++ b/drivers/reset/reset-ath79.c
25 @@ -37,6 +37,8 @@ static int ath79_reset_update(struct res
26 else
27 val &= ~BIT(id);
28 writel(val, ath79_reset->base);
29 + /* Flush cache */
30 + readl(ath79_reset->base);
31 spin_unlock_irqrestore(&ath79_reset->lock, flags);
32
33 return 0;