watchdog: apple: Increase reset delay to 150ms
Subsystems (2)
v2 cover watchdog: apple: Increase reset delay to 150ms
Increase the reset delay to 150ms as the Apple A8X SoC can take up to 125ms to actually reset.
Since the code is being modified anyways, also fix a bug where watchdog writes were not actually getting flushed after requesting reset, depsite what the code comments said.
Changes since v1:
- Fix an existing bug where watchdog writes are not flushed
v1: https://lore.kernel.org/asahi/[email protected]/
Nick Chan
---
Nick Chan (2):
watchdog: apple: Actually flush writes after requesting watchdog
restart
watchdog: apple: Increase reset delay to 150ms
drivers/watchdog/apple_wdt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
base-commit: 77df9e4bb2224d8ffbddec04c333a9d7965dad6c
Signature · 1 line
2.46.0
PATCH v2 1/2 watchdog: apple: Actually flush writes after requesting watchdog restart
Although there is an existing code comment about flushing the writes, writes were not actually being flushed.
Actually flush the writes by changing readl_relaxed() to readl().
--- drivers/watchdog/apple_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/apple_wdt.c +1 -1
@@ -130,7 +130,7 @@ static int apple_wdt_restart(struct watchdog_device *wdd, unsigned long mode,* can take up to ~20-25ms until the SoC is actually reset. Just wait * 50ms here to be safe. */ - (void )readl_relaxed (wdt->regs +APPLE_WDT_WD1_CUR_TIME ); + (void )readl (wdt->regs +APPLE_WDT_WD1_CUR_TIME );mdelay (50 );return 0 ;
Signature · 1 line
2.46.0
Re: [PATCH v2 1/2] watchdog: apple: Actually flush writes after requesting watchdog restart
Quoted 8 lines · Nick Chan
Although there is an existing code comment about flushing the writes, writes were not actually being flushed.
Actually flush the writes by changing
readl_relaxed()toreadl().Fixes 4ed224aeaf661 ("watchdog: Add Apple SoC watchdog driver")Suggested-by Arnd Bergmann <[email protected]>Signed-off-by Nick Chan <[email protected]>
PATCH v2 2/2 watchdog: apple: Increase reset delay to 150ms
In reply to Nick ChanThe Apple A8X SoC seems to be slowest at resetting, taking up to around 125ms to reset. Wait 150ms to be safe here.
--- drivers/watchdog/apple_wdt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/watchdog/apple_wdt.c +3 -3
@@ -127,11 +127,11 @@ static int apple_wdt_restart(struct watchdog_device *wdd, unsigned long mode,/* * Flush writes and then wait for the SoC to reset. Even though the * reset is queued almost immediately experiments have shown that it -* can take up to ~20-25ms until the SoC is actually reset. Just wait -* 50ms here to be safe. +* can take up to ~120-125ms until the SoC is actually reset. Just +* wait 150ms here to be safe. */ (void )readl (wdt->regs +APPLE_WDT_WD1_CUR_TIME ); -mdelay (50 ); +mdelay (150 );return 0 ; }
Signature · 1 line
2.46.0