From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754038AbdA3S7s (ORCPT ); Mon, 30 Jan 2017 13:59:48 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:38830 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753848AbdA3S7p (ORCPT ); Mon, 30 Jan 2017 13:59:45 -0500 Subject: Re: [PATCH 4/6] ARCv2: IRQ: Remove option for setting number of interrupts To: Yuriy Kolerov , References: <1485561703-20921-1-git-send-email-yuriy.kolerov@synopsys.com> <1485561703-20921-5-git-send-email-yuriy.kolerov@synopsys.com> CC: , , , Newsgroups: gmane.linux.kernel.arc,gmane.linux.kernel From: Vineet Gupta Message-ID: <9f1d05bc-2d86-6127-6dfb-742ed4531be0@synopsys.com> Date: Mon, 30 Jan 2017 10:59:29 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1485561703-20921-5-git-send-email-yuriy.kolerov@synopsys.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.10.161.49] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/27/2017 04:01 PM, Yuriy Kolerov wrote: > When you set a value of ARC_NUMBER_OF_INTERRUPTS option > it affects only a size of the interrupts table but macros > for number of virtual interrupts (NR_IRQS) and for number > of hardware interrupts (NR_CPU_IRQS) remain unchanged. > Moreover usage of ARC_NUMBER_OF_INTERRUPTS is bad for > portability since it is not possible to change size > of the interrupts table after linkage. > > This patch makes these changes in IRQ subsystem: > > * NR_CPU_IRQS defines a maximum number of hardware interrupts. > * Remove ARC_NUMBER_OF_INTERRUPTS option and create interrupts > table for all possible hardware interrupts. > * Increase a maximum number of virtual IRQs to 512. ARCv2 can > support 240 interrupts in the core interrupts controllers > and 128 interrupts in IDU. Thus 512 virtual IRQs must be > enough for most configurations of boards. > > Signed-off-by: Yuriy Kolerov LGTM. Thx, -Vineet > --- > arch/arc/Kconfig | 11 ----------- > arch/arc/include/asm/irq.h | 28 +++++++++++++++++++++++++--- > arch/arc/kernel/entry-arcv2.S | 3 ++- > 3 files changed, 27 insertions(+), 15 deletions(-) > > diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig > index 283099c..ba15cb8 100644 > --- a/arch/arc/Kconfig > +++ b/arch/arc/Kconfig > @@ -412,17 +412,6 @@ config ARC_HAS_DIV_REM > bool "Insn: div, divu, rem, remu" > default y > > -config ARC_NUMBER_OF_INTERRUPTS > - int "Number of interrupts" > - range 8 240 > - default 32 > - help > - This defines the number of interrupts on the ARCv2HS core. > - It affects the size of vector table. > - The initial 8 IRQs are fixed (Timer, ICI etc) and although configurable > - in hardware, it keep things simple for Linux to assume they are always > - present. > - > endif # ISA_ARCV2 > > endmenu # "ARC CPU Configuration" > diff --git a/arch/arc/include/asm/irq.h b/arch/arc/include/asm/irq.h > index e61ad30..dfa09e3 100644 > --- a/arch/arc/include/asm/irq.h > +++ b/arch/arc/include/asm/irq.h > @@ -9,19 +9,41 @@ > #ifndef __ASM_ARC_IRQ_H > #define __ASM_ARC_IRQ_H > > -#define NR_CPU_IRQS 32 /* number of interrupt lines of ARC770 CPU */ > -#define NR_IRQS 128 /* allow some CPU external IRQ handling */ > +#ifdef CONFIG_ISA_ARCV2 > + > +/* > + * A maximum number of supported interrupts in the core interrupt controller. > + * This number is not equal to the maximum interrupt number (256) because > + * first 16 lines are reserved for exceptions and are not configurable. > + */ > +#define NR_CPU_IRQS 240 > + > +/* > + * ARCv2 can support 240 interrupts in the core interrupts controllers and > + * 128 interrupts in IDU. Thus 512 virtual IRQs must be enough for most > + * configurations of boards. > + */ > +#define NR_IRQS 512 > > /* Platform Independent IRQs */ > -#ifdef CONFIG_ISA_ARCV2 > #define IPI_IRQ 19 > #define SOFTIRQ_IRQ 21 > #define FIRST_EXT_IRQ 24 > + > +#else > + > +#define NR_CPU_IRQS 32 /* number of interrupt lines of ARC770 CPU */ > +#define NR_IRQS 128 /* allow some CPU external IRQ handling */ > + > #endif > > +#ifndef __ASSEMBLY__ > + > #include > #include > > extern void arc_init_IRQ(void); > > #endif > + > +#endif > diff --git a/arch/arc/kernel/entry-arcv2.S b/arch/arc/kernel/entry-arcv2.S > index 0b6388a..f22101e 100644 > --- a/arch/arc/kernel/entry-arcv2.S > +++ b/arch/arc/kernel/entry-arcv2.S > @@ -13,6 +13,7 @@ > #include > #include > #include > +#include > > .cpu HS > > @@ -52,7 +53,7 @@ VECTOR handle_interrupt ; unused > VECTOR handle_interrupt ; (23) unused > # End of fixed IRQs > > -.rept CONFIG_ARC_NUMBER_OF_INTERRUPTS - 8 > +.rept NR_CPU_IRQS - 8 > VECTOR handle_interrupt > .endr > >