From patchwork Wed Apr 24 19:44:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 16386 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7E06523918 for ; Wed, 24 Apr 2013 19:46:10 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id b4sf4258784qen.10 for ; Wed, 24 Apr 2013 12:45:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=/fT+zRDukxHWVsNrnkOx81eHJG3eh8SKd1kePbcjx6k=; b=K+k3/oihhkXr1XJuxJfO9NlFiDs7mzrMmdMpjfnZ/Qe0cHROi7AchUUI96h5EzEEI3 61bOGFqHUvbnIsrQyPRv2x+X8ygHcyvmloXE4akLQ6sLFweUNiGB1b4RX7PP7hUt9dY9 isuw5zVCh76Kq0e3P6DZsGeRB8RST5yyfpBPai7d7OgGzxowLH44+DjC2ZE9cQmiiCGj RZssvSHJGO+j1FQ6GtIfn9H7x/EF/Yvmjax95bNPQztqMLkx9ZBTAgfh8Z/pv9+35bIl UNdMOf1g0mHLykKErAeuyL1oTZV9e/DWAdhtLQyB+OOUeZY3TXK23wgm6IsOnZ7sSR0B z1Vg== X-Received: by 10.236.181.234 with SMTP id l70mr17724466yhm.53.1366832718841; Wed, 24 Apr 2013 12:45:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.166 with SMTP id w6ls1016950qeu.14.gmail; Wed, 24 Apr 2013 12:45:18 -0700 (PDT) X-Received: by 10.52.35.196 with SMTP id k4mr3866988vdj.77.1366832718675; Wed, 24 Apr 2013 12:45:18 -0700 (PDT) Received: from mail-vb0-x233.google.com (mail-vb0-x233.google.com [2607:f8b0:400c:c02::233]) by mx.google.com with ESMTPS id sc6si1828947vdc.60.2013.04.24.12.45.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 12:45:18 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::233 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::233; Received: by mail-vb0-f51.google.com with SMTP id x19so1993958vbf.24 for ; Wed, 24 Apr 2013 12:45:18 -0700 (PDT) X-Received: by 10.58.144.170 with SMTP id sn10mr20979729veb.7.1366832718273; Wed, 24 Apr 2013 12:45:18 -0700 (PDT) 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.58.127.98 with SMTP id nf2csp189830veb; Wed, 24 Apr 2013 12:45:17 -0700 (PDT) X-Received: by 10.194.5.228 with SMTP id v4mr31931835wjv.18.1366832717127; Wed, 24 Apr 2013 12:45:17 -0700 (PDT) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [2a00:1450:400c:c03::22d]) by mx.google.com with ESMTPS id hi10si1426552wib.30.2013.04.24.12.45.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 12:45:17 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::22d is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=2a00:1450:400c:c03::22d; Received: by mail-we0-f173.google.com with SMTP id o7so1907775wea.32 for ; Wed, 24 Apr 2013 12:45:16 -0700 (PDT) X-Received: by 10.194.173.228 with SMTP id bn4mr16451257wjc.20.1366832716471; Wed, 24 Apr 2013 12:45:16 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id s2sm6381011wib.4.2013.04.24.12.45.14 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 12:45:15 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xensource.com Cc: Stefano.Stabellini@eu.citrix.com, Ian.Campbell@citrix.com, patches@linaro.org, Julien Grall Subject: [PATCH] xen/arm: Missing +1 when then number of interrupt lines for the GIC is computed Date: Wed, 24 Apr 2013 20:44:51 +0100 Message-Id: <1366832691-27130-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQnjz0+BI+0qEs+rS+e2V3JwSd6TL9mGfWTMtUhA6BNdwBAAh8yqUUthsKeJsHuyx62DqDA5 X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::233 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: , In the GIC manual, the number of interrupt lines is computed with the following formula: 32(N + 1) where N is the value retrieved from GICD_TYPER. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/gic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 760c86b..389c217 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -216,7 +216,7 @@ static int gic_route_irq(unsigned int irq, bool_t level, ASSERT(!(cpu_mask & ~0xff)); /* Targets bitmap only supports 8 CPUs */ ASSERT(priority <= 0xff); /* Only 8 bits of priority */ - ASSERT(irq < gic.lines + 32); /* Can't route interrupts that don't exist */ + ASSERT(irq < gic.lines); /* Can't route interrupts that don't exist */ spin_lock_irqsave(&desc->lock, flags); spin_lock(&gic.lock); @@ -264,7 +264,7 @@ static void __init gic_dist_init(void) GICD[GICD_CTLR] = 0; type = GICD[GICD_TYPER]; - gic.lines = 32 * (type & GICD_TYPE_LINES); + gic.lines = 32 * ((type & GICD_TYPE_LINES) + 1); gic.cpus = 1 + ((type & GICD_TYPE_CPUS) >> 5); printk("GIC: %d lines, %d cpu%s%s (IID %8.8x).\n", gic.lines, gic.cpus, (gic.cpus == 1) ? "" : "s",