Re: [Qemu-devel] [PATCH][TRIVIAL] i6300esb: fix timer overflow

2015-09-06 Thread Laurent Vivier
Le 06/09/2015 16:35, Paolo Bonzini a écrit : > > > On 06/09/2015 12:29, Michael Tokarev wrote: >> 04.08.2015 11:27, Laurent Vivier wrote: >>> We use muldiv64() to compute the time to wait: >>> >>> timeout = muldiv64(get_ticks_per_sec(), timeout, 3300); >> ... >> >> Applied to -trivial,

Re: [Qemu-devel] [PATCH][TRIVIAL] i6300esb: fix timer overflow

2015-09-06 Thread Paolo Bonzini
On 06/09/2015 12:29, Michael Tokarev wrote: > 04.08.2015 11:27, Laurent Vivier wrote: >> We use muldiv64() to compute the time to wait: >> >> timeout = muldiv64(get_ticks_per_sec(), timeout, 3300); > ... > > Applied to -trivial, thank you! I think this was superseded by a later patch.

Re: [Qemu-devel] [PATCH][TRIVIAL] i6300esb: fix timer overflow

2015-09-06 Thread Michael Tokarev
04.08.2015 11:27, Laurent Vivier wrote: > We use muldiv64() to compute the time to wait: > > timeout = muldiv64(get_ticks_per_sec(), timeout, 3300); ... Applied to -trivial, thank you! /mjt

Re: [Qemu-devel] [PATCH][TRIVIAL] i6300esb: fix timer overflow

2015-08-04 Thread David Gibson
On Tue, Aug 04, 2015 at 10:27:31AM +0200, Laurent Vivier wrote: > We use muldiv64() to compute the time to wait: > > timeout = muldiv64(get_ticks_per_sec(), timeout, 3300); > > but get_ticks_per_sec() is 10^9 (30 bit value) and timeout > is a 35 bit value. > > Whereas muldiv64 is: > >

Re: [Qemu-devel] [PATCH][TRIVIAL] i6300esb: fix timer overflow

2015-08-04 Thread Richard W.M. Jones
On Tue, Aug 04, 2015 at 10:27:31AM +0200, Laurent Vivier wrote: > --- a/hw/watchdog/wdt_i6300esb.c > +++ b/hw/watchdog/wdt_i6300esb.c > @@ -136,7 +136,7 @@ static void i6300esb_restart_timer(I6300State *d, int > stage) > * multiply here can exceed 64-bits, before we divide by 33MHz, so >

[Qemu-devel] [PATCH][TRIVIAL] i6300esb: fix timer overflow

2015-08-04 Thread Laurent Vivier
We use muldiv64() to compute the time to wait: timeout = muldiv64(get_ticks_per_sec(), timeout, 3300); but get_ticks_per_sec() is 10^9 (30 bit value) and timeout is a 35 bit value. Whereas muldiv64 is: uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c) So we loose 3 bits of time