Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qemu: aspeed_timer: Use signed muldiv for timer resets
If the host decrements the counter register that results in a negative delta. This is then passed to muldiv64 which only handles unsigned numbers resulting in bogus results. This fix ensures the data being operated on is signed before it is ultimately casted to the final unsigned value. Test case: kexec a kernel using aspeed_timer and it will freeze on the second bootup when the kernel initializes the timer. With this patch that no longer happens and the timer appears to run OK. Signed-off-by: Christian Svensson <[email protected]> Signed-off-by: Cédric Le Goater <[email protected]>
- Loading branch information