From ed16fc1b2f4388b2797e196d9d92d7a00c3322f6 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 21 May 2022 01:34:35 +0800 Subject: [PATCH] advance timer state by +1 ms on suspend to avoid double-interrupts on resume Issue #159 may be caused by queueing a connection to respond to when the timer expires, but if the timer expires twice then it tries to respond to a null connection id. And if it goes to suspend in the same millisecond as it services the condvar, then it'll reissue the interrupt when it comes back from suspend. --- services/susres/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/susres/src/main.rs b/services/susres/src/main.rs index 7b9e32a8a..10a0074e7 100644 --- a/services/susres/src/main.rs +++ b/services/susres/src/main.rs @@ -243,7 +243,7 @@ mod implementation { self.stored_time = Some( (self.csr.r(utra::susres::TIME0) as u64 | (self.csr.r(utra::susres::TIME1) as u64) << 32) - + 0 // a placeholder in case we need to advance time on save + + 1 // a placeholder in case we need to advance time on save ); #[cfg(feature = "debugprint")] println!("Stored time: {}", self.stored_time.unwrap());