Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753193AbaBVXjC (ORCPT ); Sat, 22 Feb 2014 18:39:02 -0500 Received: from www.linutronix.de ([62.245.132.108]:49204 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753161AbaBVXjA (ORCPT ); Sat, 22 Feb 2014 18:39:00 -0500 Date: Sun, 23 Feb 2014 00:38:55 +0100 (CET) From: Thomas Gleixner 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 Subject: Re: [PATCH v5 02/33] genirq: Add irq_alloc_reserved_desc() In-Reply-To: Message-ID: References: <1388707565-16535-1-git-send-email-yinghai@kernel.org> <1388707565-16535-3-git-send-email-yinghai@kernel.org> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/