From patchwork Sat Jun 16 05:20:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peter A. G. Crosthwaite" X-Patchwork-Id: 165281 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8FC38B70EE for ; Sat, 16 Jun 2012 15:11:56 +1000 (EST) Received: from localhost ([::1]:53195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SflIg-0001OQ-5t for incoming@patchwork.ozlabs.org; Sat, 16 Jun 2012 01:11:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SflIN-0000ma-N3 for qemu-devel@nongnu.org; Sat, 16 Jun 2012 01:11:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SflIM-0007xA-1x for qemu-devel@nongnu.org; Sat, 16 Jun 2012 01:11:35 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:40277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SflIL-0007x6-S7 for qemu-devel@nongnu.org; Sat, 16 Jun 2012 01:11:33 -0400 Received: by dadn2 with SMTP id n2so3991760dad.4 for ; Fri, 15 Jun 2012 22:11:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=WQNhwtYMCvmFrt94JbuV4Bb0UuxfqDiUa1cw4uuXXIQ=; b=h3qoUbsYjRDtTqD3S8nQwX/RYYGJgtzLRCJPH7iovj5oVXbZsKogWIqkFoXe9AKwWf XqYfSryPklfV+/wfFkhrqLeP5EGnU70cf9EP65k3XnqV4lPalVzgwqJ7lDQP7LzHHTNs nLsx+m/ZREIV5Jf56qw41xZMHqB5dpkxYB/T3kSxRl+ypWwZ3QSl6kUZeo4EF9JKibUu 8UmZkPuzTUdDc8AsFn1G3FtpQrMqlhKS566zCAUIqmtAq1UpVSxavGhXZL29z8j0lwdx fUweSiPNzGKdreyzyT2sk1eZZftyHjdyRpZCy3w1DB8PwJyLHqP+K/EAEJPlSxPluFB7 mvrg== Received: by 10.68.134.201 with SMTP id pm9mr27539980pbb.49.1339823491386; Fri, 15 Jun 2012 22:11:31 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id gj8sm15633144pbc.39.2012.06.15.22.11.27 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jun 2012 22:11:30 -0700 (PDT) From: "Peter A. G. Crosthwaite" To: edgar.iglesias@gmail.com, qemu-devel@nongnu.org Date: Sat, 16 Jun 2012 15:20:59 +1000 Message-Id: <76daa1ac80c24545ff82d85a8426cb6a61757c32.1339823397.git.peter.crosthwaite@petalogix.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQkbAsQYWLXgpLngVR9eM9RW9am5kdRAaFPPA5B7j0i4YRg02/S2RGskRSyVOmg7xDH+JJT0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.45 Cc: peter.crosthwaite@petalogix.com, pbonzini@redhat.com, peter.chubb@nicta.com.au, trimarchi@retis.sssup.it, john.williams@petalogix.com Subject: [Qemu-devel] [PATCH v1 2/2] xilinx_timer: Fixed deadlock issue X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The timer was deadlocking when the interval was set too low. It would cause a flood of timer events and the CPU would halt indefinately. This is a known issue and theres a generic workaround in place in ptimer on ptimer_set_limit(), however the Xilinx timer uses ptimer_set_count() instead of set_limit. Changed the call to set_count() to an equivalent call of set_limit() instead, which brings the workaround into play. Signed-off-by: Peter A. G. Crosthwaite --- hw/xilinx_timer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/xilinx_timer.c b/hw/xilinx_timer.c index e8b7a59..b562bd0 100644 --- a/hw/xilinx_timer.c +++ b/hw/xilinx_timer.c @@ -136,7 +136,7 @@ static void timer_enable(struct xlx_timer *xt) count = xt->regs[R_TLR]; else count = ~0 - xt->regs[R_TLR]; - ptimer_set_count(xt->ptimer, count); + ptimer_set_limit(xt->ptimer, count, 1); ptimer_run(xt->ptimer, 1); }