From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMcYm-0007wa-4p for qemu-devel@nongnu.org; Tue, 04 Aug 2015 09:47:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMcYg-0005wx-2w for qemu-devel@nongnu.org; Tue, 04 Aug 2015 09:47:16 -0400 Date: Tue, 4 Aug 2015 14:47:07 +0100 From: "Richard W.M. Jones" Message-ID: <20150804134707.GT29283@redhat.com> References: <1438609948-3744-1-git-send-email-lvivier@redhat.com> <1438676851-10684-1-git-send-email-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438676851-10684-1-git-send-email-lvivier@redhat.com> Subject: Re: [Qemu-devel] [PATCH][TRIVIAL] i6300esb: fix timer overflow List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: qemu-trivial@nongnu.org, Paolo Bonzini , qemu-devel@nongnu.org, David Gibson 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 > * we use a higher-precision intermediate result. > */ > - timeout = muldiv64(get_ticks_per_sec(), timeout, 33000000); > + timeout = muldiv64(timeout, get_ticks_per_sec(), 33000000); > > i6300esb_debug("stage %d, timeout %" PRIi64 "\n", d->stage, timeout); Here are the test results for this (v2) patch: Requested timeout Observed timeout 60 58 120 120 250 253 270 274 500 507 520 529 1010 1026 1030 1045 2046 2078 2500 ioctl: WDIOC_SETTIMEOUT: error setting timeout: Invalid argument Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v