From patchwork Sat Jan 31 22:33:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 5755761 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0A7F59F336 for ; Sat, 31 Jan 2015 22:36:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 38F8A2025B for ; Sat, 31 Jan 2015 22:36:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 61EF82021B for ; Sat, 31 Jan 2015 22:36:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YHgbp-00060z-4U; Sat, 31 Jan 2015 22:33:45 +0000 Received: from smtp09.smtpout.orange.fr ([80.12.242.131] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YHgbm-0005VC-QR for linux-arm-kernel@lists.infradead.org; Sat, 31 Jan 2015 22:33:43 +0000 Received: from beldin.home ([109.222.124.208]) by mwinf5d17 with ME id mmZ91p0064VtjRZ03mZ93C; Sat, 31 Jan 2015 23:33:19 +0100 X-ME-Helo: beldin.home X-ME-Date: Sat, 31 Jan 2015 23:33:19 +0100 X-ME-IP: 109.222.124.208 From: Robert Jarzmik To: Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: [PATCH] ARM: pxa: fix pxa interrupts handling in DT Date: Sat, 31 Jan 2015 23:33:01 +0100 Message-Id: <1422743581-31548-1-git-send-email-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150131_143343_026765_4BED2793 X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The commit "ARM: pxa: arbitrarily set first interrupt number" changed the first pxa interrupt to 16. As a consequence, device-tree builds got broken, because : - pxa_mask_irq() and pxa_unmask_irq() are using IRQ_BIT() - IRQ_BIT(x) calculates the interrupts as : x - PXA_IRQ(0) Before the commit, the first interrupt shift, PXA_IRQ(0) was 0, therefore IRQ_BIT(x) was x. After the change, it is necessary that the same shift of 16 is applied between the virtual interrupt number and the hardware irq number. This situation comes from the common irq_chip shared between legacy platform builds and device-tree builds. Fix the broken interrupts in DT case by adding this shift in the DT case too. Signed-off-by: Robert Jarzmik --- arch/arm/mach-pxa/irq.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index 0eecd83..59a9351 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c @@ -214,10 +214,10 @@ static int pxa_irq_map(struct irq_domain *h, unsigned int virq, if (cpu_has_ipr) __raw_writel(hw | IPR_VALID, pxa_irq_base + IPR(hw)); - irq_set_chip_and_handler(hw, &pxa_internal_irq_chip, + irq_set_chip_and_handler(virq, &pxa_internal_irq_chip, handle_level_irq); - irq_set_chip_data(hw, base); - set_irq_flags(hw, IRQF_VALID); + irq_set_chip_data(virq, base); + set_irq_flags(virq, IRQF_VALID); return 0; } @@ -267,7 +267,8 @@ void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int)) return; } - pxa_irq_domain = irq_domain_add_legacy(node, pxa_internal_irq_nr, 0, 0, + pxa_irq_domain = irq_domain_add_legacy(node, pxa_internal_irq_nr, + PXA_IRQ(0), 0, &pxa_irq_ops, NULL); if (!pxa_irq_domain) panic("Unable to add PXA IRQ domain\n");