From patchwork Mon Jul 27 10:48:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?G=C3=BCnther_Kelleter?= X-Patchwork-Id: 500328 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A76DE140318 for ; Mon, 27 Jul 2015 20:54:58 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 5CD0528BECA; Mon, 27 Jul 2015 12:54:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 04E6C28BEBC for ; Mon, 27 Jul 2015 12:54:10 +0200 (CEST) X-policyd-weight: using cached result; rate: -5.5 Received: from mout3.freenet.de (mout3.freenet.de [195.4.92.93]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 27 Jul 2015 12:54:09 +0200 (CEST) Received: from [195.4.92.140] (helo=mjail0.freenet.de) by mout3.freenet.de with esmtpa (ID gnther.kelleter@freenet.de) (port 25) (Exim 4.85 #1) id 1ZJg3M-0000gl-Ku; Mon, 27 Jul 2015 12:54:40 +0200 Received: from localhost ([::1]:45617 helo=mjail0.freenet.de) by mjail0.freenet.de with esmtpa (ID gnther.kelleter@freenet.de) (Exim 4.85 #1) id 1ZJg3M-0000ik-Gt; Mon, 27 Jul 2015 12:54:40 +0200 Received: from mx7.freenet.de ([195.4.92.17]:33311) by mjail0.freenet.de with esmtpa (ID gnther.kelleter@freenet.de) (Exim 4.85 #1) id 1ZJg1G-00043D-SC; Mon, 27 Jul 2015 12:52:30 +0200 Received: from p54b459ea.dip0.t-ipconnect.de ([84.180.89.234]:60682 helo=gkelleter.devolo.com) by mx7.freenet.de with esmtpsa (ID gnther.kelleter@freenet.de) (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (port 25) (Exim 4.85 #1) id 1ZJg1G-0002cQ-Ov; Mon, 27 Jul 2015 12:52:30 +0200 Received: by gkelleter.devolo.com (Postfix, from userid 1000) id A97A86110F; Mon, 27 Jul 2015 12:52:29 +0200 (CEST) From: =?UTF-8?q?G=C3=BCnther=20Kelleter?= To: openwrt-devel@lists.openwrt.org Date: Mon, 27 Jul 2015 12:48:14 +0200 Message-Id: <1437994095-16492-3-git-send-email-guenther.kelleter@devolo.de> X-Mailer: git-send-email 2.4.6.89.g851dcf4 In-Reply-To: <1437994095-16492-1-git-send-email-guenther.kelleter@devolo.de> References: <1437994095-16492-1-git-send-email-guenther.kelleter@devolo.de> MIME-Version: 1.0 X-Originated-At: 84.180.89.234!60682 Subject: [OpenWrt-Devel] [PATCH v2 2/3] mcs814x: fix interrupts X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" create explicit 1:1 mapping before mcs814x_alloc_gc/irq_setup_generic_chip marks all interrupts used and prevents mapping by dts init. IRQ 0 is the timer interrupt and is not illegal! Was broken since kernel 3.14. Signed-off-by: Günther Kelleter --- target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c | 6 +++++- target/linux/mcs814x/patches-3.18/015-timer-irq.patch | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 target/linux/mcs814x/patches-3.18/015-timer-irq.patch diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c index f84c412..fd4345f 100644 --- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c +++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c @@ -71,6 +71,7 @@ static const struct of_device_id mcs814x_intc_ids[] = { void __init mcs814x_of_irq_init(void) { struct device_node *np; + struct irq_domain *domain; np = of_find_matching_node(NULL, mcs814x_intc_ids); if (!np) @@ -80,7 +81,10 @@ void __init mcs814x_of_irq_init(void) if (!mcs814x_intc_base) panic("unable to map intc cpu registers\n"); - irq_domain_add_simple(np, 32, 0, &irq_generic_chip_ops, NULL); + domain = irq_domain_add_simple(np, 32, 0, &irq_domain_simple_ops, NULL); + if (!domain) + panic("unable to add irq domain\n"); + irq_create_strict_mappings(domain, 0, 0, 32); of_node_put(np); diff --git a/target/linux/mcs814x/patches-3.18/015-timer-irq.patch b/target/linux/mcs814x/patches-3.18/015-timer-irq.patch new file mode 100644 index 0000000..9bbb094 --- /dev/null +++ b/target/linux/mcs814x/patches-3.18/015-timer-irq.patch @@ -0,0 +1,11 @@ +--- a/kernel/irq/irqdesc.c ++++ b/kernel/irq/irqdesc.c +@@ -381,7 +381,7 @@ int __handle_domain_irq(struct irq_domai + * Some hardware gives randomly wrong interrupts. Rather + * than crashing, do something sensible. + */ +- if (unlikely(!irq || irq >= nr_irqs)) { ++ if (unlikely(irq >= nr_irqs)) { + ack_bad_irq(irq); + ret = -EINVAL; + } else {