From patchwork Tue Mar 25 10:13:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 333360 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 85668140092 for ; Tue, 25 Mar 2014 21:14:20 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WSOMu-00013v-Fk; Tue, 25 Mar 2014 10:14:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WSOMr-0006y5-Vo; Tue, 25 Mar 2014 10:14:01 +0000 Received: from fw-tnat.austin.arm.com ([217.140.110.23] helo=collaborate-mta1.arm.com) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WSOMp-0006x6-NM for linux-arm-kernel@lists.infradead.org; Tue, 25 Mar 2014 10:14:00 +0000 Received: from approximate.cambridge.arm.com (approximate.cambridge.arm.com [10.1.209.43]) by collaborate-mta1.arm.com (Postfix) with ESMTPS id A193913F7A2; Tue, 25 Mar 2014 05:13:34 -0500 (CDT) From: Marc Zyngier To: Z Lim Subject: Re: [PATCH v2 02/19] arm64: initial support for GICv3 In-Reply-To: (Z. Lim's message of "Tue, 25 Mar 2014 06:35:18 +0000") Organization: ARM Ltd References: <1395316386-12617-1-git-send-email-marc.zyngier@arm.com> <1395316386-12617-3-git-send-email-marc.zyngier@arm.com> <533012B8.2070303@arm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Date: Tue, 25 Mar 2014 10:13:32 +0000 Message-ID: <871txq7fhv.fsf@approximate.cambridge.arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140325_061359_814589_62D87D28 X-CRM114-Status: GOOD ( 15.96 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Catalin Marinas , Will Deacon , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org On Tue, Mar 25 2014 at 6:35:18 am GMT, Z Lim wrote: Hi Zi, > I see this warning :( > You can trigger it when a device's INT# falls within [gic_irqs-16, gic_irqs), > which lines up with the -16 above. > > irq_create_of_mapping  // SPI# from DT > > domain->ops->xlate (gic_irq_domain_xlate)  // SPI# + 32 = INT# = hwirq > > irq_create_mapping  // uses hwirq = INT# > > irq_domain_associate  // uses hwirq = INT# > > if (WARN(hwirq >= domain->hwirq_max, "error: hwirq 0x%x is too > large for %s\n", (int)hwirq, domain->name))  // hwirq_max was > set to (MAX_INT# - 16) above, uh oh... I'm about to push out the following fix. Can you give it a go and let me know if that works for you? Thanks, M. diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 60ef92d..b90ea2c 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -552,6 +552,8 @@ static struct irq_chip gic_chip = { static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) { + if (hw < 16) /* SGIs are private to the core kernel */ + return -EPERM; if (hw < 32) { irq_set_percpu_devid(irq); irq_set_chip_and_handler(irq, &gic_chip, @@ -642,7 +644,7 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare gic_irqs = 1020; gic_data.irq_nr = gic_irqs; - gic_data.domain = irq_domain_add_linear(node, gic_irqs - 16, + gic_data.domain = irq_domain_add_linear(node, gic_irqs, &gic_irq_domain_ops, &gic_data); gic_data.rdist.rdist = alloc_percpu(typeof(*gic_data.rdist.rdist));