From patchwork Thu Dec 20 18:53:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13679 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id CEC7823E02 for ; Thu, 20 Dec 2012 18:54:12 +0000 (UTC) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) by fiordland.canonical.com (Postfix) with ESMTP id 5EC16A18763 for ; Thu, 20 Dec 2012 18:54:12 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id k10so5138569iea.15 for ; Thu, 20 Dec 2012 10:54:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:x-gm-message-state; bh=4REAoo1tVY+pAIOmxwV6P9x4C1eWnLPU8wufpTZUMlw=; b=keS9CuQofi20bWT0YEjHvVNAmwtijQiFKfXD0oHFlBBFY/1jVqpycCCSAB86cud/53 UVW3w+aw55NHTRqMhsqskGbOSP21OU7w8ozSvhrw5+ZkOQQ++bUsiGLV0B822JAqR+69 dm4iAedTjf/7bTtXRqckIiei9iuDMbG8S7KuE0YnD8CQfm8QDjHG7I9gNSpZFqujUxb3 8FF9ZmClYPURG1SAeoHwqNdTkWU8CBKIxbyU6aPR53/sbPAYM8WxF9ehm9MpnXEoHqce 6lA/nm6eBS9r4yIhm4mtcc+pBbpjRbFPF2/6fT5gsWyPgMVfBhQ+RbWJOPBNMOZ+H5K0 YGfA== X-Received: by 10.50.53.175 with SMTP id c15mr6547813igp.106.1356029651788; Thu, 20 Dec 2012 10:54:11 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.115 with SMTP id m19csp49455igt; Thu, 20 Dec 2012 10:54:11 -0800 (PST) X-Received: by 10.14.202.3 with SMTP id c3mr25389396eeo.4.1356029650348; Thu, 20 Dec 2012 10:54:10 -0800 (PST) Received: from eu1sys200aog120.obsmtp.com (eu1sys200aog120.obsmtp.com [207.126.144.149]) by mx.google.com with SMTP id w41si20844579een.100.2012.12.20.10.54.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Dec 2012 10:54:10 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.149; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKUNNeyn9YJeghoXQFF/nxTp7RitnQ9iwu@postini.com; Thu, 20 Dec 2012 18:54:09 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id F420B10F; Thu, 20 Dec 2012 18:45:46 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id D7EBA111F; Thu, 20 Dec 2012 18:53:56 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 0A17DA8088; Thu, 20 Dec 2012 19:53:49 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 20 Dec 2012 19:53:55 +0100 From: Linus Walleij To: Cc: Anmar Oueja , Linus Walleij , Grant Likely , Russell King - ARM Linux Subject: [PATCH 2/2] ARM: VIC: fix bug in VIC irqdomain code Date: Thu, 20 Dec 2012 19:53:53 +0100 Message-ID: <1356029633-30239-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmeD63b9RSxZL3XATfKF8JDD4BlyzPENoOupcpcm6SBxmfnVsmiCdp3PifzEeQTQdvpyoUO From: Linus Walleij The VIC irqdomain code added in commit 07c9249f1fa90cc8189bed44c0bcece664596a72 "ARM: 7554/1: VIC: use irq_domain_add_simple()" Had two bugs: 1) It didn't call irq_create_mapping() once on each valid irq source in the slowpath when registering the controller. 2) It passed a -1 as IRQ offset for the DT case, whereas 0 should be passed as invalid IRQ instead. Cc: Grant Likely Cc: Russell King - ARM Linux Signed-off-by: Linus Walleij --- arch/arm/common/vic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index e4df17c..8f324b9 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c @@ -206,6 +206,7 @@ static void __init vic_register(void __iomem *base, unsigned int irq, struct device_node *node) { struct vic_device *v; + int i; if (vic_id >= ARRAY_SIZE(vic_devices)) { printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__); @@ -220,6 +221,10 @@ static void __init vic_register(void __iomem *base, unsigned int irq, vic_id++; v->domain = irq_domain_add_simple(node, fls(valid_sources), irq, &vic_irqdomain_ops, v); + /* create an IRQ mapping for each valid IRQ */ + for (i = 0; i < fls(valid_sources); i++) + if (valid_sources & (1 << i)) + irq_create_mapping(v->domain, i); } static void vic_ack_irq(struct irq_data *d) @@ -416,9 +421,9 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent) return -EIO; /* - * Passing -1 as first IRQ makes the simple domain allocate descriptors + * Passing 0 as first IRQ makes the simple domain allocate descriptors */ - __vic_init(regs, -1, ~0, ~0, node); + __vic_init(regs, 0, ~0, ~0, node); return 0; }