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: 27019 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 02B1920062 for ; Tue, 25 Mar 2014 10:14:20 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id pa12sf549322veb.8 for ; Tue, 25 Mar 2014 03:14:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:in-reply-to :organization:references:user-agent:date:message-id:mime-version:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=kPPZ+GK4z7TTgGMv365+Qc1ABNOtnrx1fkayJq3PHDQ=; b=K/T0nIgjkqP5QDV1FnYdOtpIsI/SZme0gWLvt+S/uxF3u3NgycBYso4cPhC2qDK4JL +kTpgyZ+3CA9z2uVuy08jUIvJX2YUoFx5OlMs1/bnv/VeKyMK/q+v9ah6Donow0cORL4 6rKtGIaGPgf/sGvZT3I+u/seuW9Xz5WlLduGWRcrKMXpt9BoiSUZAPmtB97RDHURbber Ro5yTDAyucQT9IWCqe+03Tuel7GBSXXkQwcM1FT+gieTMuzupx1HyJL1Si4sBeaDqbDG JBmEpsvR4rU1N1RgC4nmV3PtkH67jJBPcba6Y2zyW7f9jDRIKV7zor7uFr4QGKgGyrsN Z5Zw== X-Gm-Message-State: ALoCoQksY2m3VgaR+3NNP/OmzpexOGrGsshH6fSW5EXd8iOay6ybj1FCwOQIxSwZoB0CQyCX0ip9 X-Received: by 10.236.93.38 with SMTP id k26mr20893808yhf.20.1395742460648; Tue, 25 Mar 2014 03:14:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.81 with SMTP id 75ls149263qgg.75.gmail; Tue, 25 Mar 2014 03:14:20 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr55261500vcb.0.1395742460543; Tue, 25 Mar 2014 03:14:20 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id y10si3631303vei.96.2014.03.25.03.14.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Mar 2014 03:14:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ij19so269492vcb.10 for ; Tue, 25 Mar 2014 03:14:20 -0700 (PDT) X-Received: by 10.220.114.135 with SMTP id e7mr5913965vcq.23.1395742460460; Tue, 25 Mar 2014 03:14:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp291606vck; Tue, 25 Mar 2014 03:14:19 -0700 (PDT) X-Received: by 10.180.19.69 with SMTP id c5mr20509642wie.7.1395742458148; Tue, 25 Mar 2014 03:14:18 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org. [85.118.1.10]) by mx.google.com with ESMTPS id l15si2146041wiv.10.2014.03.25.03.14.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Mar 2014 03:14:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 85.118.1.10 as permitted sender) client-ip=85.118.1.10; 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-00013w-C3; 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-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: marc.zyngier@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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));