From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Gleixner Subject: Re: [PATCH v5 02/33] genirq: Add irq_alloc_reserved_desc() Date: Sun, 23 Feb 2014 00:38:55 +0100 (CET) Message-ID: References: <1388707565-16535-1-git-send-email-yinghai@kernel.org> <1388707565-16535-3-git-send-email-yinghai@kernel.org> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Yinghai Lu Cc: Ingo Molnar , "H. Peter Anvin" , Tony Luck , Bjorn Helgaas , "Rafael J. Wysocki" , "linux-pci@vger.kernel.org" , Linux Kernel Mailing List , ACPI Devel Maling List , Joerg Roedel , Konrad Rzeszutek Wilk , Sebastian Andrzej Siewior , Andrew Morton , Linus Torvalds List-Id: linux-acpi@vger.kernel.org On Sat, 22 Feb 2014, Yinghai Lu wrote: > On Sat, Feb 22, 2014 at 9:28 AM, Yinghai Lu wrote: > > On Sat, Feb 22, 2014 at 2:08 AM, Thomas Gleixner wrote: > >> > >> As I said before irq_reserve_irq() is a misnomer and a > >> misconception. Of course this needs to be fixed as well. > >> > >> And you cannot just blindly change it because !SPARSE can use the > >> allocation. We are not creating stupid corner cases just to support > >> your sloppyness. Its not rocket science to do it the right way. > >> > >> That said, it might be worthwhile to get rid of the !SPARSE case > >> completely. That would probably make quite some stuff simpler. > > > > So we need to make all arches support SPARSE_IRQ at first? > > > > Now we have arm, arm64, c6x, metag, powerpc, sh, x86 support SPARSE_IRQ. > > > > The following are not with SPARSE_IRQ yet: > > alpha, arc, avr32, blackfin, cris, frv, hexagon, m32r, m68k, microblaze, > > mips, mn10300, openrisc, parisc, s390, score, sparc, tile, um, > > unicore32, xtensa. > > or add calling irq_alloc_desc_at() before irq_set_chip... for !SPARSE_IRQ. > > Please check attached partial patch if you like it. OMG, you really mean that: +++ b/arch/alpha/kernel/irq_i8259.c @@ -92,6 +92,7 @@ init_i8259a_irqs(void) outb(0xff, 0xA1); /* mask all of 8259A-2 */ for (i = 0; i < 16; i++) { + irq_alloc_desc_at(i, 0); irq_set_chip_and_handler(i, &i8259a_irq_type, handle_level_irq); } You can't be serious about that. There are tons of ways to call into the core and access an irq descriptor aside of irq_set_chip* before it is potentially allocated. Are you going to analyze all of them and add an irq_alloc_desc_at() before that call? HELL, NO! I'm really tired of that. Stay away from kernel/irq/* and wait for people who are competent enough and willing to spend the extra thoughts to come up with solutions which are not completely ass backwards. Thanks, tglx