From mboxrd@z Thu Jan 1 00:00:00 1970 From: robert.jarzmik@free.fr (Robert Jarzmik) Date: Sun, 01 Feb 2015 12:01:12 +0100 Subject: [PATCH] ARM: pxa: fix pxa interrupts handling in DT In-Reply-To: <1422743581-31548-1-git-send-email-robert.jarzmik@free.fr> (Robert Jarzmik's message of "Sat, 31 Jan 2015 23:33:01 +0100") References: <1422743581-31548-1-git-send-email-robert.jarzmik@free.fr> Message-ID: <878ughuc93.fsf@free.fr> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Robert Jarzmik writes: > 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. Actually, this work should be pushed a bit more for the irq_chip functions, so that they're freed from the IRQ_BIT(x) macro. A more complete work would be to use BIT(irqd_to_hwirq(d)) instead of IRQ_BIT(d->irq) in : - pxa_mask_irq() - pxa_unmask_irq() And add the legacy irq_domain in pxa_init_irq(). -- Robert From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752849AbbBALB2 (ORCPT ); Sun, 1 Feb 2015 06:01:28 -0500 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:58196 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752605AbbBALB0 (ORCPT ); Sun, 1 Feb 2015 06:01:26 -0500 X-ME-Helo: beldin X-ME-Date: Sun, 01 Feb 2015 12:01:23 +0100 X-ME-IP: 109.222.124.208 From: Robert Jarzmik To: Daniel Mack Cc: Haojian Zhuang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM: pxa: fix pxa interrupts handling in DT References: <1422743581-31548-1-git-send-email-robert.jarzmik@free.fr> X-URL: http://belgarath.falguerolles.org/ Date: Sun, 01 Feb 2015 12:01:12 +0100 In-Reply-To: <1422743581-31548-1-git-send-email-robert.jarzmik@free.fr> (Robert Jarzmik's message of "Sat, 31 Jan 2015 23:33:01 +0100") Message-ID: <878ughuc93.fsf@free.fr> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Robert Jarzmik writes: > 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. Actually, this work should be pushed a bit more for the irq_chip functions, so that they're freed from the IRQ_BIT(x) macro. A more complete work would be to use BIT(irqd_to_hwirq(d)) instead of IRQ_BIT(d->irq) in : - pxa_mask_irq() - pxa_unmask_irq() And add the legacy irq_domain in pxa_init_irq(). -- Robert