From patchwork Tue Nov 19 06:18:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 21602 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 886E020972 for ; Tue, 19 Nov 2013 06:17:17 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id wp4sf18712818obc.4 for ; Mon, 18 Nov 2013 22:17:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Oo542k7CC+3F66BIz+YnY8/EOYBKKdUOLivQsekCjZk=; b=J297v9541m5kARTbGyqcjuoFUVGzV6ce8CMp5TDwiBZZrlF3nHa5sDfmbBe7/I59MS O3ZELT58StDG5BpopP6mZHTzRoWoaIWvj/4Uu9b6DQmujB70m5ovl49sfrxFZ3DHcBDV Ax6CxJRkirTRHHoJRZqo4jC8bHgxKRginICTij1U5whLJacxY05bHXJFDTZGSIbGkbwu IKMzACnrnV7bWBEFZj/qy7gLx4sKpLlgW1wklj56mXOIRxB7YAw8/pzQOy9DP/YtW5Pe gs2TxbKD09IJZKCsc92wlRZtFv6gJsMpGF1giYeYgKchbfLvNT6X1yIm29QJyZWw91i+ m5kQ== X-Gm-Message-State: ALoCoQlBXCShNdTxUc8FgfvZZSkFjPbP0agAXtBb9YnWiwElvyjzEfCvnfRl6zJwDMQVgEkeXQYR X-Received: by 10.50.72.110 with SMTP id c14mr1862773igv.2.1384841837195; Mon, 18 Nov 2013 22:17:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.72.227 with SMTP id g3ls2980058qev.57.gmail; Mon, 18 Nov 2013 22:17:17 -0800 (PST) X-Received: by 10.58.210.39 with SMTP id mr7mr19499013vec.18.1384841837111; Mon, 18 Nov 2013 22:17:17 -0800 (PST) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id o3si7882158ves.124.2013.11.18.22.17.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Nov 2013 22:17:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id oy12so1789490veb.29 for ; Mon, 18 Nov 2013 22:17:17 -0800 (PST) X-Received: by 10.52.32.66 with SMTP id g2mr16862784vdi.14.1384841837026; Mon, 18 Nov 2013 22:17:17 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp255371vcz; Mon, 18 Nov 2013 22:17:16 -0800 (PST) X-Received: by 10.66.119.136 with SMTP id ku8mr25239793pab.121.1384841836259; Mon, 18 Nov 2013 22:17:16 -0800 (PST) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by mx.google.com with ESMTPS id pl8si11230330pbb.74.2013.11.18.22.17.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Nov 2013 22:17:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.172 is neither permitted nor denied by best guess record for domain of christoffer.dall@linaro.org) client-ip=209.85.192.172; Received: by mail-pd0-f172.google.com with SMTP id g10so3299047pdj.3 for ; Mon, 18 Nov 2013 22:17:15 -0800 (PST) X-Received: by 10.66.159.234 with SMTP id xf10mr6474824pab.139.1384841835718; Mon, 18 Nov 2013 22:17:15 -0800 (PST) Received: from localhost.localdomain (c-67-169-181-221.hsd1.ca.comcast.net. [67.169.181.221]) by mx.google.com with ESMTPSA id rz6sm19165159pab.22.2013.11.18.22.17.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Nov 2013 22:17:14 -0800 (PST) From: Christoffer Dall To: qemu-devel@nongnu.org Cc: kvmarm@lists.cs.columbia.edu, patches@linaro.org, Christoffer Dall Subject: [RFC PATCH v3 07/10] arm_gic: Fix gic_acknowledge_irq pending bit clear Date: Mon, 18 Nov 2013 22:18:13 -0800 Message-Id: <1384841896-19566-8-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1384841896-19566-1-git-send-email-christoffer.dall@linaro.org> References: <1384841896-19566-1-git-send-email-christoffer.dall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The pending flags for level-triggered interrupts should not be cleared if the interrupt input signal remains asserted. Signed-off-by: Christoffer Dall Changelog[3]: - New patch in the series --- hw/intc/arm_gic.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 9811161..20e926c 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -193,11 +193,15 @@ uint32_t gic_acknowledge_irq(GICState *s, int cpu) return 1023; } s->last_active[new_irq][cpu] = s->running_irq[cpu]; - /* Clear pending flags for both level and edge triggered interrupts. - Level triggered IRQs will be reasserted once they become inactive. */ + /* Clear pending flags for edge-triggered and non-asserted level-triggered + * interrupts. + */ cm = GIC_TEST_MODEL(new_irq) ? ALL_CPU_MASK : cm; GIC_CLEAR_SW_PENDING(new_irq, cm); - gic_clear_pending(s, new_irq, cm, GIC_SGI_SRC(new_irq, cpu)); + if (GIC_TEST_EDGE_TRIGGER(new_irq) || !GIC_TEST_LEVEL(new_irq, cm)) { + gic_clear_pending(s, new_irq, cm, GIC_SGI_SRC(new_irq, cpu)); + } + gic_set_running_irq(s, cpu, new_irq); DPRINTF("ACK %d\n", new_irq); return new_irq;