Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp241077ima; Fri, 15 Mar 2019 01:36:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhwg8+4ZCMr6E3OzJWgK3ByXYi1g1eIEEgo00Ddng6RJ/hxZKbsQqeQoo8f6aN7J+DpWl1 X-Received: by 2002:a65:6259:: with SMTP id q25mr2244571pgv.235.1552639001304; Fri, 15 Mar 2019 01:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552639001; cv=none; d=google.com; s=arc-20160816; b=BepvsNZF4cL6SxpN5O03g8zR+58RHXnyhAX7fBtajrci/xp0NJ0S0uscJtKPyEBkJA atvVCCCUZTdGRBRxSUHbCmNkEoPW5zcsn5XKCxy9Uq1wfL4xfpyHTWpEkLehazMu3732 lx/lFxMgbtRu2wA7qT42Pb3V8hUK6iSh/Zd+aCHHCVcrb9hZ9kJlSrRo3pB523ssDS2E j+P1VKxlyJqXMTaMStRYAT71pSblVvEalb4YM3CKVM0seJGniqANb5W4AZqOK8qz0otk n+FE4Dc840B2LA88LILOHbvItuOUmTj3BSXZKqswoEa1QdvN9jD53dByO5SrtQU9jxjC bjpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=WpSRPRRgLLqqj/cBuBfroo1vkdVrNuKA2e9Vf8zTNBk=; b=ntmCf8lSH7iUJtjnWna9Q81PqvRSY5UQqEJhZPoPuf63CholzvmJ+RBhCKVdmflRad WMycNmemIp9Oscr+67Cxaf3b8c1waqd7NdDfxI8CbruvFJXRVT5eSPwxe6P0Jlojv47o 8xKJ6nRnRIX850IZ7c4ZmyllAbHh6GEQjW71gKyg5LAo+04Wvagtzhe2pj4KgP+Evnz+ l/AlVvqZJI78SIsSTskQ+UsBkyS42Qz+jRTZxAijkletYKynHtwCIqaW2+Oat4Rdg9wV wnONCXBOhTujDZ6GvSTcWoug9QkrkHBiQLj1fePiChUCAy1Y98DXsyTOq+L3nbrKZRLv N3mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19si1252814pgv.142.2019.03.15.01.36.26; Fri, 15 Mar 2019 01:36:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728594AbfCOIfg (ORCPT + 99 others); Fri, 15 Mar 2019 04:35:36 -0400 Received: from ivanoab6.miniserver.com ([5.153.251.140]:43036 "EHLO www.kot-begemot.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbfCOIfg (ORCPT ); Fri, 15 Mar 2019 04:35:36 -0400 Received: from jain.kot-begemot.co.uk ([192.168.3.3]) by www.kot-begemot.co.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1h4iJQ-0008Ee-T8; Fri, 15 Mar 2019 08:35:33 +0000 Received: from jain.kot-begemot.co.uk ([192.168.3.3]) by jain.kot-begemot.co.uk with esmtp (Exim 4.89) (envelope-from ) id 1h4iJP-0000xz-Bp; Fri, 15 Mar 2019 08:35:32 +0000 Subject: Re: [PATCH] um: irq: don't set the chip for all irqs To: Bartosz Golaszewski , Jeff Dike , Richard Weinberger , Geert Uytterhoeven Cc: Bartosz Golaszewski , linux-um@lists.infradead.org, linux-kernel@vger.kernel.org References: <20190314150344.8555-1-brgl@bgdev.pl> From: Anton Ivanov Message-ID: Date: Fri, 15 Mar 2019 08:35:31 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190314150344.8555-1-brgl@bgdev.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 X-Spam-Score: -1.0 X-Clacks-Overhead: GNU Terry Pratchett Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/03/2019 15:03, Bartosz Golaszewski wrote: > 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 > --- > Note: I plan to introduce support for SPARSE_IRQ but AFAICT it will be > a bit more complicated, so in the meantime I'd like to propose this change. > > 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(); > Reviewed-by: Anton Ivanov Acked-by: Anton Ivanov -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/