From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Bartosz Golaszewski Subject: [RESEND PATCH 4/4] um: irq: don't set the chip for all irqs Date: Wed, 3 Apr 2019 10:39:02 +0200 Message-Id: <20190403083902.3975-5-brgl@bgdev.pl> In-Reply-To: <20190403083902.3975-1-brgl@bgdev.pl> References: <20190403083902.3975-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: Jeff Dike , Richard Weinberger , Anton Ivanov , Geert Uytterhoeven Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski List-ID: From: Bartosz Golaszewski Setting a chip for an interrupt marks it as allocated. Since UM doesn't support dynamic interrupt numbers (yet), it means we cannot simply increase NR_IRQS and then use the free irqs between LAST_IRQ and NR_IRQS with gpio-mockup or iio testing drivers as irq_alloc_descs() will fail after not being able to neither find an unallocated range of interrupts nor expand the range. Only call irq_set_chip_and_handler() for irqs until LAST_IRQ. Signed-off-by: Bartosz Golaszewski --- arch/um/kernel/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index f4874b7ec503..598d7b3d9355 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -479,7 +479,7 @@ void __init init_IRQ(void) irq_set_chip_and_handler(TIMER_IRQ, &SIGVTALRM_irq_type, handle_edge_irq); - for (i = 1; i < NR_IRQS; i++) + for (i = 1; i < LAST_IRQ; i++) irq_set_chip_and_handler(i, &normal_irq_type, handle_edge_irq); /* Initialize EPOLL Loop */ os_setup_epoll(); -- 2.21.0