genirq: Another round of tree wide cleanups
Subsystems (19)
cover genirq: Another round of tree wide cleanups
This cleanup series addresses a few histerical leftovers:
1) irq_reserve_irq()
The remaining callsites are pointless except s390, but we have a better way to protect the lower interrupt space there.
It's gone for good and it will never come back. Use irq domains, if you want hot pluggable irq chips.
2) create/destroy_irq and their variants
Designed in different circles of hell we have an incompatible zoo of those.
Three different implementations with different semantics vs. the return values. Two use cases which are just reusing the global namespace. And they come along with four different flavours of dynamic irq allocation.
I created a core implementation for that and put it under GENERIC_IRQ_LEGACY_ALLOC_HWIRQ to make clear that this is not for new code. That implementation is used by x86 and tile. I gave up on converting ia64 over, so I moved the create/destroy_irq prototypes into ia64 headers and provided a wrapper for the shared dmar driver.
The core implementation is a very basic allocator and that's deliberately so. I don't want more users and every more complex than that wants to use irq domains.
3) dynamic_irq_init/cleanup
Another leftover from the past. By moving tile and iop13xx to sparse irq there is only ia64 left. I simplified the code and made this available only under a legacy config option to avoid that more people think they need this.
Full diffstat below.
Thanks,
tglx
--- arch/arm/Kconfig | 1 arch/arm/mach-iop13xx/include/mach/irqs.h | 2 arch/arm/mach-iop13xx/include/mach/time.h | 3 arch/arm/mach-iop13xx/iq81340mc.c | 1 arch/arm/mach-iop13xx/iq81340sc.c | 1 arch/arm/mach-iop13xx/msi.c | 51 ++--------- arch/arm/mach-iop13xx/setup.c | 1 arch/arm/mach-iop13xx/tpmi.c | 1 arch/ia64/Kconfig | 1 arch/ia64/include/asm/hw_irq.h | 1 arch/ia64/include/asm/irq.h | 3 arch/ia64/include/asm/irq_remapping.h | 2 arch/ia64/kernel/iosapic.c | 2 arch/ia64/kernel/irq_ia64.c | 15 --- arch/mips/pci/msi-xlp.c | 10 -- arch/mips/pci/pci-xlr.c | 10 -- arch/s390/kernel/irq.c | 5 - arch/s390/pci/pci.c | 6 - arch/tile/Kconfig | 2 arch/tile/include/asm/irq.h | 6 - arch/tile/kernel/irq.c | 40 --------- arch/tile/kernel/pci_gx.c | 17 +-- arch/x86/Kconfig | 1 arch/x86/include/asm/io_apic.h | 2 arch/x86/include/asm/irq_remapping.h | 3 arch/x86/kernel/apic/io_apic.c | 130 +++++------------------------- arch/x86/kernel/hpet.c | 5 - arch/x86/platform/uv/uv_irq.c | 10 -- drivers/iommu/dmar.c | 8 - drivers/iommu/irq_remapping.c | 12 +- drivers/net/ethernet/tile/tilegx.c | 6 - drivers/pci/htirq.c | 13 --- drivers/sh/intc/core.c | 6 - drivers/tty/hvc/hvc_tile.c | 8 - drivers/tty/serial/tilegx.c | 8 - drivers/usb/host/ehci-tilegx.c | 8 - drivers/usb/host/ohci-tilegx.c | 8 - drivers/xen/events/events_base.c | 17 --- include/linux/irq.h | 38 +++----- kernel/irq/Kconfig | 9 ++ kernel/irq/chip.c | 5 - kernel/irq/internals.h | 6 + kernel/irq/irqdesc.c | 95 ++++++++++++++------- 43 files changed, 216 insertions(+), 363 deletions(-)
PATCH 1/32 arm: iop13xx: Use sparse irqs for MSI
No need for a private allocator. The core code handles it already.
Allocate the non MSI irqs right at boot time via machine_desc->nr_irqs and let the sparse core handle the MSI space.
--- arch/arm/Kconfig | 1 arch/arm/mach-iop13xx/include/mach/irqs.h | 2 - arch/arm/mach-iop13xx/include/mach/time.h | 3 + arch/arm/mach-iop13xx/iq81340mc.c | 1 arch/arm/mach-iop13xx/iq81340sc.c | 1 arch/arm/mach-iop13xx/msi.c | 51 ++++++------------------------ arch/arm/mach-iop13xx/setup.c | 1 arch/arm/mach-iop13xx/tpmi.c | 1 8 files changed, 19 insertions(+), 42 deletions(-)
arch/arm/Kconfig +1 -0
@@ -480,6 +480,7 @@ config ARCH_IOP13XX select PCI select PLAT_IOP select VMSPLIT_1G + select SPARSE_IRQ help Support for Intel's IOP13XX (XScale) family of processors.
arch/arm/mach-iop13xx/include/mach/irqs.h +0 -2
@@ -191,6 +191,4 @@ static inline u32 read_intpnd_3(void)#define NR_IOP13XX_IRQS (IRQ_IOP13XX_HPI + 1)#endif -#define NR_IRQS NR_IOP13XX_IRQS -#endif /* _IOP13XX_IRQ_H_ */
arch/arm/mach-iop13xx/include/mach/time.h +3 -0
@@ -1,5 +1,8 @@#ifndef _IOP13XX_TIME_H_#define _IOP13XX_TIME_H_ + +#include <mach/irqs.h> +#define IRQ_IOP_TIMER0 IRQ_IOP13XX_TIMER0#define IOP_TMR_EN 0x02
arch/arm/mach-iop13xx/iq81340mc.c +1 -0
@@ -93,4 +93,5 @@ MACHINE_START(IQ81340MC, "Intel IQ81340M .init_time = iq81340mc_timer_init, .init_machine = iq81340mc_init, .restart = iop13xx_restart, + .nr_irqs =NR_IOP13XX_IRQS ,MACHINE_END
arch/arm/mach-iop13xx/iq81340sc.c +1 -0
@@ -95,4 +95,5 @@ MACHINE_START(IQ81340SC, "Intel IQ81340S .init_time = iq81340sc_timer_init, .init_machine = iq81340sc_init, .restart = iop13xx_restart, + .nr_irqs =NR_IOP13XX_IRQS ,MACHINE_END
arch/arm/mach-iop13xx/msi.c +11 -40
77 lines not on this page · raw message
arch/arm/mach-iop13xx/setup.c +1 -0
@@ -27,6 +27,7 @@#include <mach/hardware.h> #include <asm/irq.h> #include <asm/hardware/iop_adma.h> +#include <mach/irqs.h> #define IOP13XX_UART_XTAL 33334000#define IOP13XX_SETUP_DEBUG 0
arch/arm/mach-iop13xx/tpmi.c +1 -0
@@ -24,6 +24,7 @@#include <linux/io.h> #include <asm/irq.h> #include <asm/sizes.h> +#include <mach/irqs.h> /* assumes CONTROLLER_ONLY# is never asserted in the ESSR register */ #define IOP13XX_TPMI_MMR (dev) IOP13XX_REG_ADDR32_PHYS(0x48000 + (dev << 12))
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] arm: iop13xx: Use sparse irqs for MSI
arm: iop13xx: Use sparse irqs for MSI
Commit-ID: 37ebbcff78375bfa69eb69748ef00f577b7c1c6c Gitweb: http://git.kernel.org/tip/37ebbcff78375bfa69eb69748ef00f577b7c1c6c Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:04 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:18 +0200
arm: iop13xx: Use sparse irqs for MSI
No need for a private allocator. The core code handles it already.
Allocate the non MSI irqs right at boot time via machine_desc->nr_irqs and let the sparse core handle the MSI space.
--- arch/arm/Kconfig | 1 + arch/arm/mach-iop13xx/include/mach/irqs.h | 2 -- arch/arm/mach-iop13xx/include/mach/time.h | 3 ++ arch/arm/mach-iop13xx/iq81340mc.c | 1 + arch/arm/mach-iop13xx/iq81340sc.c | 1 + arch/arm/mach-iop13xx/msi.c | 51 +++++++------------------------ arch/arm/mach-iop13xx/setup.c | 1 + arch/arm/mach-iop13xx/tpmi.c | 1 + 8 files changed, 19 insertions(+), 42 deletions(-)
arch/arm/Kconfig +1 -0
@@ -480,6 +480,7 @@ config ARCH_IOP13XX select PCI select PLAT_IOP select VMSPLIT_1G + select SPARSE_IRQ help Support for Intel's IOP13XX (XScale) family of processors.
arch/arm/mach-iop13xx/include/mach/irqs.h +0 -2
@@ -191,6 +191,4 @@ static inline u32 read_intpnd_3(void)#define NR_IOP13XX_IRQS (IRQ_IOP13XX_HPI + 1)#endif -#define NR_IRQS NR_IOP13XX_IRQS -#endif /* _IOP13XX_IRQ_H_ */
arch/arm/mach-iop13xx/include/mach/time.h +3 -0
@@ -1,5 +1,8 @@#ifndef _IOP13XX_TIME_H_#define _IOP13XX_TIME_H_ + +#include <mach/irqs.h> +#define IRQ_IOP_TIMER0 IRQ_IOP13XX_TIMER0#define IOP_TMR_EN 0x02
arch/arm/mach-iop13xx/iq81340mc.c +1 -0
@@ -93,4 +93,5 @@ MACHINE_START(IQ81340MC, "Intel IQ81340MC") .init_time = iq81340mc_timer_init, .init_machine = iq81340mc_init, .restart = iop13xx_restart, + .nr_irqs =NR_IOP13XX_IRQS ,MACHINE_END
arch/arm/mach-iop13xx/iq81340sc.c +1 -0
@@ -95,4 +95,5 @@ MACHINE_START(IQ81340SC, "Intel IQ81340SC") .init_time = iq81340sc_timer_init, .init_machine = iq81340sc_init, .restart = iop13xx_restart, + .nr_irqs =NR_IOP13XX_IRQS ,MACHINE_END
arch/arm/mach-iop13xx/msi.c +11 -40
77 lines not on this page · raw message
arch/arm/mach-iop13xx/setup.c +1 -0
@@ -27,6 +27,7 @@#include <mach/hardware.h> #include <asm/irq.h> #include <asm/hardware/iop_adma.h> +#include <mach/irqs.h> #define IOP13XX_UART_XTAL 33334000#define IOP13XX_SETUP_DEBUG 0
arch/arm/mach-iop13xx/tpmi.c +1 -0
@@ -24,6 +24,7 @@#include <linux/io.h> #include <asm/irq.h> #include <asm/sizes.h> +#include <mach/irqs.h> /* assumes CONTROLLER_ONLY# is never asserted in the ESSR register */ #define IOP13XX_TPMI_MMR (dev) IOP13XX_REG_ADDR32_PHYS(0x48000 + (dev << 12))
PATCH 2/32 mips: Kill pointless destroy_irq()
In reply to Thomas GleixnerCopy and paste leftovers with no functionality at all.
--- arch/mips/pci/msi-xlp.c | 10 +--------- arch/mips/pci/pci-xlr.c | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-)
arch/mips/pci/msi-xlp.c +1 -9
@@ -206,14 +206,8 @@ static struct irq_chip xlp_msix_chip = { .irq_unmask = unmask_msi_irq, }; -void destroy_irq (unsigned int irq) -{ -/* nothing to do yet */ -} -void arch_teardown_msi_irq (unsigned int irq) { -destroy_irq (irq); }/*
@@ -298,10 +292,8 @@ static int xlp_setup_msi(uint64_t lnkbas xirq = xirq + msivec;/* msi mapped to global irq space */ ret =irq_set_msi_desc (xirq, desc); -if (ret <0 ) { -destroy_irq (xirq); +if (ret <0 )return ret; - }write_msi_msg (xirq, &msg);return 0 ;
arch/mips/pci/pci-xlr.c +1 -9
@@ -214,14 +214,8 @@ static int get_irq_vector(const struct p }#ifdef CONFIG_PCI_MSI -void destroy_irq (unsigned int irq) -{ -/* nothing to do yet */ -} -void arch_teardown_msi_irq (unsigned int irq) { -destroy_irq (irq); }int arch_setup_msi_irq (struct pci_dev *dev,struct msi_desc *desc)
@@ -263,10 +257,8 @@ int arch_setup_msi_irq(struct pci_dev *dMSI_DATA_DELIVERY_FIXED ; ret =irq_set_msi_desc (irq, desc); -if (ret <0 ) { -destroy_irq (irq); +if (ret <0 )return ret; - }write_msi_msg (irq, &msg);return 0 ;
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] mips: Kill pointless destroy_irq()
mips: Kill pointless destroy_irq()
Commit-ID: 465665f78a7f47d46d7fe18195f3548b4911547f Gitweb: http://git.kernel.org/tip/465665f78a7f47d46d7fe18195f3548b4911547f Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:05 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:18 +0200
mips: Kill pointless destroy_irq()
Copy and paste leftovers with no functionality at all.
--- arch/mips/pci/msi-xlp.c | 10 +--------- arch/mips/pci/pci-xlr.c | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-)
arch/mips/pci/msi-xlp.c +1 -9
@@ -206,14 +206,8 @@ static struct irq_chip xlp_msix_chip = { .irq_unmask = unmask_msi_irq, }; -void destroy_irq (unsigned int irq) -{ -/* nothing to do yet */ -} -void arch_teardown_msi_irq (unsigned int irq) { -destroy_irq (irq); }/*
@@ -298,10 +292,8 @@ static int xlp_setup_msi(uint64_t lnkbase, int node, int link, xirq = xirq + msivec;/* msi mapped to global irq space */ ret =irq_set_msi_desc (xirq, desc); -if (ret <0 ) { -destroy_irq (xirq); +if (ret <0 )return ret; - }write_msi_msg (xirq, &msg);return 0 ;
arch/mips/pci/pci-xlr.c +1 -9
@@ -214,14 +214,8 @@ static int get_irq_vector(const struct pci_dev *dev) }#ifdef CONFIG_PCI_MSI -void destroy_irq (unsigned int irq) -{ -/* nothing to do yet */ -} -void arch_teardown_msi_irq (unsigned int irq) { -destroy_irq (irq); }int arch_setup_msi_irq (struct pci_dev *dev,struct msi_desc *desc)
@@ -263,10 +257,8 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)MSI_DATA_DELIVERY_FIXED ; ret =irq_set_msi_desc (irq, desc); -if (ret <0 ) { -destroy_irq (irq); +if (ret <0 )return ret; - }write_msi_msg (irq, &msg);return 0 ;
PATCH 3/32 genirq: Provide generic hwirq allocation facility
In reply to Thomas GleixnerNot really the solution to the problem, but at least it confines the mess in the core code and allows to get rid of the create/destroy_irq variants from hell, i.e. 3 implementations with different semantics plus the x86 specific variants __create_irqs and create_irq_nr which have been invented in another circle of hell.
x86 : x86 should be converted to irq domains and I'm deliberately
making it impossible to do the multi-vector MSI support by adding more crap to the current mess. It's not that hard to do and I'm really tired of the trainwrecks which have been invented by baindaid engineering so far. Any attempt to do multi-vector MSI or ioapic hotplug without converting to irq domains is NAKed hereby.
tile: Might use irq domains as well, but it has a very limited
interrupt space, so handling it via this functionality might be the right thing to do even in the long run.
ia64: That's an hopeless case, as I doubt that anyone has the stomach
to rewrite the homebrewn dynamic allocation facilities. I stared at it for a couple of hours and gave up. The create/destroy_irq mess could be made private to itanic right away if there wouldn't be the iommu/dmar driver being shared with x86. So to do that I'm going to add a separate ia64 specific implementation later in order not to deep-six itanic right away.
--- include/linux/irq.h | 15 +++++++++++++++ kernel/irq/Kconfig | 5 +++++ kernel/irq/irqdesc.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+)
include/linux/irq.h +15 -0
@@ -637,6 +637,21 @@ static inline int irq_reserve_irq(unsignreturn irq_reserve_irqs (irq,1 ); } +#ifdef CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ +unsigned int irq_alloc_hwirqs (int cnt,int node); +static inline unsigned int irq_alloc_hwirq (int node) +{ +return irq_alloc_hwirqs (1 , node); +} +void irq_free_hwirqs (unsigned int from,int cnt); +static inline void irq_free_hwirq (unsigned int irq) +{ +return irq_free_hwirqs (irq,1 ); +} +int arch_setup_hwirq (unsigned int irq,int node); +void arch_teardown_hwirq (unsigned int irq); +#endif +#ifndef irq_reg_writel# define irq_reg_writel (val, addr) writel(val, addr)#endif
kernel/irq/Kconfig +5 -0
@@ -17,6 +17,11 @@ config GENERIC_IRQ_SHOW config GENERIC_IRQ_SHOW_LEVEL bool +# Facility to allocate an hardware interrupt. This is legacy support +# and should not be used in new code. Use irq domains instead. +config GENERIC_IRQ_LEGACY_ALLOC_HWIRQ + bool + # Support for delayed migration from interrupt context config GENERIC_PENDING_IRQ bool
kernel/irq/irqdesc.c +51 -0
57 lines not on this page · raw message
Re: [patch 03/32] genirq: Provide generic hwirq allocation facility
Quoted 11 lines · Thomas Gleixner
Not really the solution to the problem, but at least it confines the mess in the core code and allows to get rid of the create/destroy_irq variants from hell, i.e. 3 implementations with different semantics plus the x86 specific variants
__create_irqsandcreate_irq_nrwhich have been invented in another circle of hell.[...]
tile: Might use irq domains as well, but it has a very limited
interrupt space, so handling it via this functionality might be the right thing to do even in the long run.
We have an internal change that we haven't upstreamed yet that makes irqs actually (cpu,ipi) pairs, so that more irqs can be allocated. As a result we allocate some irqs as bound to a specific IPI on a single cpu, and some irqs get bound to a particular IPI registered on every cpu.
I'll have to set aside a bit of time to look more closely at how your change interacts with the work we've done internally. I've appended the per-cpu IRQ change from our internal tree here (and cc'ed the author). The API change is in the <asm/irq.h> diff at the very start.
--
From: Tony Lu <[email protected]>
Subject: [PATCH] tile: per-cpu IRQ support
With the change, we are no longer limited to 32 IRQ resources. We support up to NR_CPUS*32 IRQ resources. Note there are some IRQ-related API changes.
- create_irq(). Create an IRQ that should happen on every core, such as Linux IPI reschedule, and mPIPE network ingress IRQ.
- create_irq_on_any(). Create an IRQ that should happen on a single core. It chooses the core from non-dataplanes.
- create_irq_on(cpu). Create an IRQ that should happen on a single core. The core is specified if cpu ID is valid, else if cpu=-1, this function choose a core from non-dataplane.
This change also makes irq_disable/irq_enable into no-ops. They are currently used only by request_irq/free_irq. And in the request_irq/ free_irq context during shim driver initialization, we call the gxio routines to configure the IRQ binding/unbinding, so there is no need to do irq_disable/irq_enable twice.
--- arch/tile/include/asm/irq.h | 48 +++++- arch/tile/kernel/irq.c | 294 ++++++++++++++++++++++++++++++++----- arch/tile/kernel/pci_gx.c | 91 ++++++------ arch/tile/kernel/smp.c | 18 ++- drivers/net/ethernet/tile/tilegx.c | 3 +- drivers/tty/hvc/hvc_tile.c | 6 +- drivers/tty/serial/tilegx.c | 9 +- drivers/usb/host/ehci-tilegx.c | 9 +- drivers/usb/host/ohci-tilegx.c | 9 +- 9 files changed, 384 insertions(+), 103 deletions(-)
arch/tile/include/asm/irq.h +45 -3
@@ -17,14 +17,33 @@#include <linux/hardirq.h> -/* The hypervisor interface provides 32 IRQs. */ +/* The hypervisor interface provides 32 IPI events per core. */ +#define NR_IPI_EVENTS 32 + +#if CHIP_HAS_IPI () +/* +* The number of supported IRQs. This can be set to a larger value +* (at most NR_CPUS*NR_IPI_EVENTS) that may be needed with more +* peripheral devices. +*/ +#define NR_IRQS 256 +#else #define NR_IRQS 32 +#endif -/* IRQ numbers used for linux IPIs. */ -#define IRQ_RESCHEDULE 0 +/* The IRQ number used for linux IPI reschedule. */ +extern int irq_reschedule; +/* The IPI event used for irq_reschedule. */ +extern int irq_reschedule_event;#define irq_canonicalize (irq) (irq) +/* An IRQ number is bound to a core and an IPI event number. */ +struct irq_map { +int cpu; +int event; +}; +void ack_bad_irq (unsigned int irq);/*
@@ -74,6 +93,29 @@ enum {*/ void tile_irq_activate (unsigned int irq,int tile_irq_type); +/* +* Create an IRQ that is valid only on a single core. The core is +* specified by callers with the exception that this function will +* choose a core if cpu=-1. +*/ +int create_irq_on (int cpu); + +/* +* Create an IRQ that is valid only on a single core. The core is +* chosen from non-dataplanes by this function. +*/ +static inline int create_irq_on_any (void ) +{ +return create_irq_on (-1 ); +} + +/* Create an IRQ that is valid on all cores. */ +int create_irq (void ); + +/* Map an IRQ number to (cpu, event). For globally-valid IRQs, cpu=-1. */ +int tile_irq_get_cpu (int irq); +int tile_irq_get_event (int irq); +void setup_irq_regs (void );#endif /* _ASM_TILE_IRQ_H */
arch/tile/kernel/irq.c +261 -33
390 lines not on this page · raw message
arch/tile/kernel/pci_gx.c +46 -45
185 lines not on this page · raw message
arch/tile/kernel/smp.c +12 -6
@@ -185,7 +185,7 @@ void flush_icache_range(unsigned long start, unsigned long end) } -/* Called when smp_send_reschedule() triggers IRQ_RESCHEDULE. */ +/* Called when smp_send_reschedule() triggers irq_reschedule. */ static irqreturn_t handle_reschedule_ipi (int irq,void *token) {__get_cpu_var (irq_stat).irq_resched_count++;
@@ -218,11 +218,17 @@ void __init ipi_init(void) offset =PFN_PHYS (pte_pfn (pte)); ipi_mappings[cpu] =ioremap_prot (offset,PAGE_SIZE , pte); } + + irq_reschedule =create_irq (); + irq_reschedule_event =tile_irq_get_event (irq_reschedule); +#else + irq_reschedule =0 ; + irq_reschedule_event = irq_reschedule;#endif -/* Bind handle_reschedule_ipi() to IRQ_RESCHEDULE. */ -tile_irq_activate (IRQ_RESCHEDULE ,TILE_IRQ_PERCPU ); -BUG_ON (setup_irq (IRQ_RESCHEDULE , &resched_action)); +/* Bind handle_reschedule_ipi() to irq_reschedule. */ +tile_irq_activate (irq_reschedule,TILE_IRQ_PERCPU ); +BUG_ON (setup_irq (irq_reschedule, &resched_action)); }#if CHIP_HAS_IPI ()
@@ -237,7 +243,7 @@ void smp_send_reschedule(int cpu)* directed at the PCI shim. For now, just do a raw store, * casting away the __iomem attribute. */ - ((unsigned long __force *)ipi_mappings[cpu])[IRQ_RESCHEDULE] = 0; + ((unsigned long __force *)ipi_mappings[cpu])[irq_reschedule_event] = 0; }#else
@@ -250,7 +256,7 @@ void smp_send_reschedule(int cpu) coord.y =cpu_y (cpu); coord.x =cpu_x (cpu); - hv_trigger_ipi(coord, IRQ_RESCHEDULE); + hv_trigger_ipi(coord, irq_reschedule); }#endif /* CHIP_HAS_IPI() */
drivers/net/ethernet/tile/tilegx.c +2 -1
@@ -1233,7 +1233,8 @@ static int tile_net_setup_interrupts(struct net_device *dev)struct tile_net_info *info = &per_cpu (per_cpu_info, cpu);if (info->mpipe[instance].has_iqueue) {gxio_mpipe_request_notif_ring_interrupt (&md->context, -cpu_x (cpu),cpu_y (cpu),KERNEL_PL , irq, +cpu_x (cpu),cpu_y (cpu),KERNEL_PL , +tile_irq_get_event (irq), info->mpipe[instance].iqueue.ring); } }
drivers/tty/hvc/hvc_tile.c +3 -3
@@ -81,7 +81,7 @@ static int hvc_tile_get_chars(uint32_t vt, char *buf, int count)static int hvc_tile_notifier_add_irq (struct hvc_struct *hp,int irq) {int rc; -int cpu =raw_smp_processor_id ();/* Choose an arbitrary cpu */ +int cpu =tile_irq_get_cpu (irq);HV_Coord coord = { .x =cpu_x (cpu), .y =cpu_y (cpu) }; rc =notifier_add_irq (hp, irq);
@@ -93,7 +93,7 @@ static int hvc_tile_notifier_add_irq(struct hvc_struct *hp, int irq)* If the hypervisor returns an error, we still return 0, so that * we can fall back to polling. */ -if (hv_console_set_ipi (KERNEL_PL , irq, coord) <0 ) +if (hv_console_set_ipi (KERNEL_PL ,tile_irq_get_event (irq), coord) <0 )notifier_del_irq (hp, irq);return 0 ;
@@ -133,7 +133,7 @@ static int hvc_tile_probe(struct platform_device *pdev)int tile_hvc_irq;/* Create our IRQ and register it. */ - tile_hvc_irq =create_irq (); + tile_hvc_irq =create_irq_on_any ();if (tile_hvc_irq <0 )return -ENXIO ;
drivers/tty/serial/tilegx.c +5 -4
@@ -339,8 +339,7 @@ static int tilegx_startup(struct uart_port *port) {struct tile_uart_port *tile_uart;gxio_uart_context_t *context; -int ret =0 ; -int cpu =raw_smp_processor_id ();/* pick an arbitrary cpu */ +int cpu, ret =0 ; tile_uart = container_of(port, struct tile_uart_port, uart);if (mutex_lock_interruptible (&tile_uart->mutex))
@@ -359,7 +358,7 @@ static int tilegx_startup(struct uart_port *port) }/* Create our IRQs. */ - port->irq =create_irq (); + port->irq =create_irq_on_any ();if (port->irq <0 ) goto err_uart_dest;tile_irq_activate (port->irq,TILE_IRQ_PERCPU );
@@ -371,9 +370,11 @@ static int tilegx_startup(struct uart_port *port) goto err_dest_irq;/* Request that the hardware start sending us interrupts. */ + cpu =tile_irq_get_cpu (port->irq); tile_uart->irq_cpu = cpu; ret =gxio_uart_cfg_interrupt (context,cpu_x (cpu),cpu_y (cpu), -KERNEL_PL , port->irq); +KERNEL_PL , +tile_irq_get_event (port->irq));if (ret) goto err_free_irq;
drivers/usb/host/ehci-tilegx.c +5 -4
@@ -103,8 +103,7 @@ static int ehci_hcd_tilegx_drv_probe(struct platform_device *pdev)struct ehci_hcd *ehci;struct tilegx_usb_platform_data *pdata =dev_get_platdata (&pdev->dev);pte_t pte = {0 }; -int my_cpu =smp_processor_id (); -int ret; +int my_cpu, ret;if (usb_disabled ())return -ENODEV ;
@@ -142,18 +141,20 @@ static int ehci_hcd_tilegx_drv_probe(struct platform_device *pdev) ehci->hcs_params =readl (&ehci->caps->hcs_params);/* Create our IRQs and register them. */ - pdata->irq =create_irq (); + pdata->irq =create_irq_on_any ();if (pdata->irq <0 ) { ret = -ENXIO ; goto err_no_irq; } + my_cpu =tile_irq_get_cpu (pdata->irq);tile_irq_activate (pdata->irq,TILE_IRQ_PERCPU );/* Configure interrupts. */ ret =gxio_usb_host_cfg_interrupt (&pdata->usb_ctx,cpu_x (my_cpu),cpu_y (my_cpu), -KERNEL_PL , pdata->irq); +KERNEL_PL , +tile_irq_get_event (pdata->irq));if (ret) { ret = -ENXIO ; goto err_have_irq;
drivers/usb/host/ohci-tilegx.c +5 -4
@@ -97,8 +97,7 @@ static int ohci_hcd_tilegx_drv_probe(struct platform_device *pdev)struct usb_hcd *hcd;struct tilegx_usb_platform_data *pdata =dev_get_platdata (&pdev->dev);pte_t pte = {0 }; -int my_cpu =smp_processor_id (); -int ret; +int my_cpu, ret;if (usb_disabled ())return -ENODEV ;
@@ -129,18 +128,20 @@ static int ohci_hcd_tilegx_drv_probe(struct platform_device *pdev)tilegx_start_ohc ();/* Create our IRQs and register them. */ - pdata->irq =create_irq (); + pdata->irq =create_irq_on_any ();if (pdata->irq <0 ) { ret = -ENXIO ; goto err_no_irq; } + my_cpu =tile_irq_get_cpu (pdata->irq);tile_irq_activate (pdata->irq,TILE_IRQ_PERCPU );/* Configure interrupts. */ ret =gxio_usb_host_cfg_interrupt (&pdata->usb_ctx,cpu_x (my_cpu),cpu_y (my_cpu), -KERNEL_PL , pdata->irq); +KERNEL_PL , +tile_irq_get_event (pdata->irq));if (ret) { ret = -ENXIO ; goto err_have_irq;
Signature · 2 lines
Chris Metcalf, Tilera Corp. http://www.tilera.com
Re: [patch 03/32] genirq: Provide generic hwirq allocation facility
Quoted 18 lines · Chris Metcalf
Quoted 11 lines · Thomas Gleixner
Not really the solution to the problem, but at least it confines the mess in the core code and allows to get rid of the create/destroy_irq variants from hell, i.e. 3 implementations with different semantics plus the x86 specific variants
__create_irqsandcreate_irq_nrwhich have been invented in another circle of hell.[...]
tile: Might use irq domains as well, but it has a very limited
interrupt space, so handling it via this functionality might be the right thing to do even in the long run.We have an internal change that we haven't upstreamed yet that makes irqs actually (cpu,ipi) pairs, so that more irqs can be allocated. As a result we allocate some irqs as bound to a specific IPI on a single cpu, and some irqs get bound to a particular IPI registered on every cpu.
Quoted 4 lines
I'll have to set aside a bit of time to look more closely at how your change interacts with the work we've done internally. I've appended the per-cpu IRQ change from our internal tree here (and cc'ed the author). The API change is in the <
asm/irq.h> diff at the very start.
Sure it'll break it. And I said clearly it's only designed for simple allocations.
And no, we really can do without
arch/tile/include/asm/irq.h enum { · line 113
Quoted 3 lines
arch/tile/include/asm/irq.h +3
-0+int create_irq_on (int cpu); +static inline int create_irq_on_any(void) +int create_irq(void);
or any other new abomination of this coming along with another private allocation mechanism.
The issue you are describing is very similar to what x86 needs for handling the hardware vector space and that's existing x86 private horror which needs a replacement. Itanic could use something like that as well, but I doubt that anyone is masochistic enough to tackle the never sinking ship :)
So the right thing to do is to provide a generic infrastructure for handling a matrix mapping.
So basically we need something like this:
bitmap __percpu *vector_map;
vector_map = alloc_percpu(sizeof bitmap);
And an allocation function, which takes a cpumask and not a single cpu. With your approach you are going to add create_irq_mask() faster than you can mainline the first cruft. That wants to be an algorithm which searches for a free slot in some intelligent way, i.e. using free slots which are already occupied on at least one cpu instead of using up the globaly free slots right away. It's not that hard to do if you have bitmaps.
Plus the corresponding free and supporting helpers.
Now on top of that we need irq domain support for this kind of matrix mappings down to the vector level and everything else falls in place. I have not thought through the irq domain angle, but maybe Grant/Ben can give some input on that.
Sorry for spoiling your plans. I went a long way in the past 10 years to consolidate all that as far as it goes, and I'm not willing to accept any new arch specific interrupt infrastructure which goes beyond the low level hardware requirements.
Thanks,
tglx
Re: [patch 03/32] genirq: Provide generic hwirq allocation facility
Quoted 4 lines · Thomas Gleixner
Now on top of that we need irq domain support for this kind of matrix mappings down to the vector level and everything else falls in place. I have not thought through the irq domain angle, but maybe Grant/Ben can give some input on that.
Just talked to Grant to get my irqdomain foo up to speed.
irq domains support parent irq domains already, which allow you to request an irq from the parent.
What's missing is:
- a bitmap based matrix vector allocator, but that shouldn't be rocket science to write one.
- a mechanism to hand a cpumask down in the allocation chain
- a shortcut support to avoid multi level map lookups for the fast path.
Once we have that everything just falls in place and when tile and x86 are switched over we can rip out the LEGACY allocator again. That'll leave itanic with its homebrewn create_irq machinery, but I'm happy to ignore that as this is almost completely confined in ia64 code where is can bitrot happily until it sinks.
Thanks,
tglx
Re: [patch 03/32] genirq: Provide generic hwirq allocation facility
Chris,
Quoted 18 lines · Thomas Gleixner
Quoted 4 lines · Thomas Gleixner
Now on top of that we need irq domain support for this kind of matrix mappings down to the vector level and everything else falls in place. I have not thought through the irq domain angle, but maybe Grant/Ben can give some input on that.
Just talked to Grant to get my irqdomain foo up to speed.
irq domains support parent irq domains already, which allow you to request an irq from the parent.
What's missing is:
- a bitmap based matrix vector allocator, but that shouldn't be rocket science to write one.
- a mechanism to hand a cpumask down in the allocation chain
Quoted 8 lines
- a shortcut support to avoid multi level map lookups for the fast path.
Once we have that everything just falls in place and when tile and x86 are switched over we can rip out the LEGACY allocator again. That'll leave itanic with its homebrewn
create_irqmachinery, but I'm happy to ignore that as this is almost completely confined in ia64 code where is can bitrot happily until it sinks.
any comment on this ?
Thanks,
tglx
RE: [patch 03/32] genirq: Provide generic hwirq allocation facility
Quoted 2 lines
- a bitmap based matrix vector allocator, but that shouldn't be rocket science to write one.
Not rocket science - but some tricky corner cases to make sure all the allocations will fit. MSI needs blocks of irqs that start on a power-of-two boundary so the h/w can just fiddle with low order bits. We'll see the requests for allocation in some random order (rather than the more convenient "largest block first"). We also have to handle hotplug events adding and removing (and generally messing up the neat layout). In the worst case we might need a callback to a driver to tell it that we need to move irqs previously allocated to some new range in order to free a contiguous block.
-Tony
Chris Metcalf
Acked-byRe: [patch 03/32] genirq: Provide generic hwirq allocation facility
In reply to Thomas GleixnerQuoted 11 lines · Thomas Gleixner
Quoted 9 lines · Chris Metcalf
We have an internal change that we haven't upstreamed yet that makes irqs actually (cpu,ipi) pairs, so that more irqs can be allocated. As a result we allocate some irqs as bound to a specific IPI on a single cpu, and some irqs get bound to a particular IPI registered on every cpu.
I'll have to set aside a bit of time to look more closely at how your change interacts with the work we've done internally. I've appended the per-cpu IRQ change from our internal tree here (and cc'ed the author). The API change is in the <
asm/irq.h> diff at the very start.Sure it'll break it. [...]
I think the right thing for now is to take my Acked-by for the tile changes (given a couple of minor nits replied to in separate emails).
When we have the chance to set aside some time for more upstreaming of some of the work we've done it does seem like it makes sense to tackle doing some kind of matrix mapping in a more generic way.
You're probably right that a cpumask approach would have made more sense than a cpu integer in the tile API, so we'd certainly go with that in any fgeneric matrix mapping code.
I do have one question about the irq_alloc_hwirqs() API, which is the use of zero as an error indicator. Given that zero can plausibly be an IRQ number, it seems cleaner to specify this as returning a negative errno failure instead. Doing so would also align with __irq_alloc_descs(). So, what was your thinking around using zero?
Signature · 2 lines
Chris Metcalf, Tilera Corp. http://www.tilera.com
Re: [patch 03/32] genirq: Provide generic hwirq allocation facility
Quoted 11 lines · Chris Metcalf
Quoted 10 lines · Thomas Gleixner
Quoted 9 lines · Chris Metcalf
We have an internal change that we haven't upstreamed yet that makes irqs actually (cpu,ipi) pairs, so that more irqs can be allocated. As a result we allocate some irqs as bound to a specific IPI on a single cpu, and some irqs get bound to a particular IPI registered on every cpu.
I'll have to set aside a bit of time to look more closely at how your change interacts with the work we've done internally. I've appended the per-cpu IRQ change from our internal tree here (and cc'ed the author). The API change is in the <
asm/irq.h> diff at the very start.
Quoted 6 lines
Quoted 1 line
Sure it'll break it. [...]
I think the right thing for now is to take my Acked-by for the tile changes (given a couple of minor nits replied to in separate emails).
Acked-by Chris Metcalf <[email protected]>
Thanks.
Quoted 3 lines
When we have the chance to set aside some time for more upstreaming of some of the work we've done it does seem like it makes sense to tackle doing some kind of matrix mapping in a more generic way.
Please coordinate with x86 folks on that to avoid redundant efforts.
Quoted 3 lines
You're probably right that a cpumask approach would have made more sense than a cpu integer in the tile API, so we'd certainly go with that in any generic matrix mapping code.
Anything else is just an intermediate and non generic solution.
Quoted 6 lines
I do have one question about the
irq_alloc_hwirqs()API, which is the use of zero as an error indicator. Given that zero can plausibly be an IRQ number, it seems cleaner to specify this as returning a negative errno failure instead. Doing so would also align with__irq_alloc_descs(). So, what was your thinking around using zero?
0 has been for a long time a not allocatable irq. Google will unearth about a gazillion heated debates about that.
I personally agree, that using a negative error code is the right thing to do. I'll update the series before I push it into tip.
Thanks for your input and cooperation!
tglx
Re: [patch 03/32] genirq: Provide generic hwirq allocation facility
In reply to Thomas GleixnerQuoted 109 lines · Thomas Gleixner
Not really the solution to the problem, but at least it confines the mess in the core code and allows to get rid of the create/destroy_irq variants from hell, i.e. 3 implementations with different semantics plus the x86 specific variants
__create_irqsandcreate_irq_nrwhich have been invented in another circle of hell.x86 : x86 should be converted to irq domains and I'm deliberately
making it impossible to do the multi-vector MSI support by adding more crap to the current mess. It's not that hard to do and I'm really tired of the trainwrecks which have been invented by baindaid engineering so far. Any attempt to do multi-vector MSI or ioapic hotplug without converting to irq domains is NAKed hereby.tile: Might use irq domains as well, but it has a very limited
interrupt space, so handling it via this functionality might be the right thing to do even in the long run.ia64: That's an hopeless case, as I doubt that anyone has the stomach
to rewrite the homebrewn dynamic allocation facilities. I stared at it for a couple of hours and gave up. The create/destroy_irq mess could be made private to itanic right away if there wouldn't be the iommu/dmar driver being shared with x86. So to do that I'm going to add a separate ia64 specific implementation later in order not to deep-six itanic right away.Signed-off-by Thomas Gleixner <[email protected]>Cc Chris Metcalf <[email protected]>Cc Tony Luck <[email protected]>Cc Fenghua Yu <[email protected]>--- include/linux/irq.h | 15 +++++++++++++++ kernel/irq/Kconfig | 5 +++++ kernel/irq/irqdesc.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+)Index:
tip/include/linux/irq.h
===================================================================include/linux/irq.h +15
-0@@ -637,6 +637,21 @@ static inline int irq_reserve_irq(unsignreturn irq_reserve_irqs (irq,1 ); } +#ifdef CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ +unsigned int irq_alloc_hwirqs (int cnt,int node); +static inline unsigned int irq_alloc_hwirq (int node) +{ +return irq_alloc_hwirqs (1 , node); +} +void irq_free_hwirqs (unsigned int from,int cnt); +static inline void irq_free_hwirq (unsigned int irq) +{ +return irq_free_hwirqs (irq,1 ); +} +int arch_setup_hwirq (unsigned int irq,int node); +void arch_teardown_hwirq (unsigned int irq); +#endif +#ifndef irq_reg_writel# define irq_reg_writel (val, addr) writel(val, addr)#endif Index: tip/kernel/irq/Kconfig
===================================================================kernel/irq/Kconfig +5
-0@@ -17,6 +17,11 @@ config GENERIC_IRQ_SHOW config GENERIC_IRQ_SHOW_LEVEL bool +# Facility to allocate an hardware interrupt. This is legacy support +# and should not be used in new code. Use irq domains instead. +config GENERIC_IRQ_LEGACY_ALLOC_HWIRQ + bool + # Support for delayed migration from interrupt context config GENERIC_PENDING_IRQ boolIndex:
tip/kernel/irq/irqdesc.c
===================================================================kernel/irq/irqdesc.c +21
-0@@ -396,6 +396,57 @@ err: }EXPORT_SYMBOL_GPL (__irq_alloc_descs); +#ifdef CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ +/** +* irq_alloc_hwirqs - Allocate an irq descriptor and initialize the hardware +* @cnt: number of interrupts to allocate +* @node: node on which to allocate +* +* Returns an interrupt number > 0 or 0, if the allocation fails. +*/ +unsigned int irq_alloc_hwirqs (int cnt,int node) +{ +int i, irq =__irq_alloc_descs (-1 ,0 , cnt, node,NULL ); + +if (irq <0 ) +return 0 ; + +for (i = irq; cnt >0 ; i++, cnt--) { +if (arch_setup_hwirq (i, node)) + goto err; +irq_clear_status_flags (i, _IRQ_NOREQUEST); + } +return irq;
kernel/irq/irqdesc.c err: · line 429
Quoted 10 lines
kernel/irq/irqdesc.c +10
-0+ +err: +for (i--; i >= irq; i--) { +irq_set_status_flags (i, _IRQ_NOREQUEST | _IRQ_NOPROBE); +arch_teardown_hwirq (i); + } +irq_free_descs (irq, cnt); +return 0 ; +} +EXPORT_SYMBOL_GPL (irq_alloc_hwirqs);
Okay, so regarding this and irq_domains, I think the functionality overlaps and irq_domain conversion wouldn't directly use this API. I could see two ways that it would be wired up in an irq_domain conversion...
1) use an irq_domain to represent the root of the interrupt tree and be responsible for all of the hardware irqs. Child interrupt controllers would allocate a hwirq from the root irq_domain and program itself accordingly. This approach would either not use this API, or make it entirely internal to the root irq_domain.
2) Use this API as the root of the interrupt tree and make first level of child interrupt controllers use this API to allocate HWIRQs to use for their irq outputs.
Most of the platforms using irq_domain now fall in the first category, which I think makes the most sense. Any platform like x86 that has multiple hwirq vectors and the option of per-cpu vectors would be best to keep all of that detail in one place. We could add a cpumask variant to the irqdomain APIs, and add a stock implementation of an allocator that can intelligently allocate when cpumasks are used.
g.
Quoted 30 lines
kernel/irq/irqdesc.c +20
-1+ +/** +* irq_free_hwirqs - Free irq descriptor and cleanup the hardware +* @from: Free from irq number +* @cnt: number of interrupts to free +* +*/ +void irq_free_hwirqs (unsigned int from,int cnt) +{ +int i; + +for (i = from; cnt >0 ; i++, cnt--) { +irq_set_status_flags (i, _IRQ_NOREQUEST | _IRQ_NOPROBE); +arch_teardown_hwirq (i); + } +irq_free_descs (from, cnt); +} +EXPORT_SYMBOL_GPL (irq_free_hwirqs); +#endif +/** * irq_reserve_irqs - mark irqs allocated * @from: mark from irq number -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 03/32] genirq: Provide generic hwirq allocation facility
Quoted 18 lines · Grant Likely
Quoted 1 line · Thomas Gleixner
+EXPORT_SYMBOL_GPL(irq_alloc_hwirqs);
Okay, so regarding this and
irq_domains, I think the functionality overlaps andirq_domainconversion wouldn't directly use this API. I could see two ways that it would be wired up in anirq_domainconversion...1) use an
irq_domainto represent the root of the interrupt tree and be responsible for all of the hardware irqs. Child interrupt controllers would allocate a hwirq from the rootirq_domainand program itself accordingly. This approach would either not use this API, or make it entirely internal to the rootirq_domain.2) Use this API as the root of the interrupt tree and make first level of child interrupt controllers use this API to allocate HWIRQs to use for their irq outputs.
Quoted 6 lines
Most of the platforms using
irq_domainnow fall in the first category, which I think makes the most sense. Any platform like x86 that has multiple hwirq vectors and the option of per-cpu vectors would be best to keep all of that detail in one place. We could add a cpumask variant to the irqdomain APIs, and add a stock implementation of an allocator that can intelligently allocate when cpumasks are used.
When we have a root domain which handles the vector matrix, then we can put sub domains on top which handle the various irq chips (PIC, IOAPIC, MSI ....).
So that will need some cpumask support in irq domains, but that's not a bad thing in general. Even ARM might get some benefit from for the SPIs.
Thanks,
tglx
Re: [patch 03/32] genirq: Provide generic hwirq allocation facility
In reply to Thomas Gleixnerkernel/irq/Kconfig config GENERIC_IRQ_SHOW · line 23
Quoted 10 lines · Thomas Gleixner
kernel/irq/Kconfig +4
-0@@ -17,6 +17,11 @@ config GENERIC_IRQ_SHOW config GENERIC_IRQ_SHOW_LEVEL bool +# Facility to allocate an hardware interrupt. This is legacy support +# and should not be used in new code. Use irq domains instead. +config GENERIC_IRQ_LEGACY_ALLOC_HWIRQ + bool
"a hardware interrupt".
Signature · 2 lines
Chris Metcalf, Tilera Corp. http://www.tilera.com
Re: [patch 03/32] genirq: Provide generic hwirq allocation facility
Quoted 12 lines · Chris Metcalf
kernel/irq/Kconfig config GENERIC_IRQ_SHOW · line 22
Quoted 9 lines · Thomas Gleixner
kernel/irq/Kconfig +3
-0@@ -17,6 +17,11 @@ config GENERIC_IRQ_SHOW config GENERIC_IRQ_SHOW_LEVEL bool +# Facility to allocate an hardware interrupt. This is legacy support +# and should not be used in new code. Use irq domains instead. +config GENERIC_IRQ_LEGACY_ALLOC_HWIRQ + bool"a hardware interrupt".
I'll never get that right!
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] genirq: Provide generic hwirq allocation facility
In reply to Thomas Gleixnergenirq: Provide generic hwirq allocation facility
Commit-ID: 7b6ef1262549f6afc5c881aaef80beb8fd15f908 Gitweb: http://git.kernel.org/tip/7b6ef1262549f6afc5c881aaef80beb8fd15f908 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:05 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:18 +0200
genirq: Provide generic hwirq allocation facility
Not really the solution to the problem, but at least it confines the mess in the core code and allows to get rid of the create/destroy_irq variants from hell, i.e. 3 implementations with different semantics plus the x86 specific variants __create_irqs and create_irq_nr which have been invented in another circle of hell.
x86 : x86 should be converted to irq domains and I'm deliberately
making it impossible to do the multi-vector MSI support by adding more crap to the current mess. It's not that hard to do and I'm really tired of the trainwrecks which have been invented by baindaid engineering so far. Any attempt to do multi-vector MSI or ioapic hotplug without converting to irq domains is NAKed hereby.
tile: Might use irq domains as well, but it has a very limited
interrupt space, so handling it via this functionality might be the right thing to do even in the long run.
ia64: That's an hopeless case, as I doubt that anyone has the stomach
to rewrite the homebrewn dynamic allocation facilities. I stared at it for a couple of hours and gave up. The create/destroy_irq mess could be made private to itanic right away if there wouldn't be the iommu/dmar driver being shared with x86. So to do that I'm going to add a separate ia64 specific implementation later in order not to deep-six itanic right away.
--- include/linux/irq.h | 15 +++++++++++++++ kernel/irq/Kconfig | 5 +++++ kernel/irq/irqdesc.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+)
include/linux/irq.h +15 -0
@@ -637,6 +637,21 @@ static inline int irq_reserve_irq(unsigned int irq)return irq_reserve_irqs (irq,1 ); } +#ifdef CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ +unsigned int irq_alloc_hwirqs (int cnt,int node); +static inline unsigned int irq_alloc_hwirq (int node) +{ +return irq_alloc_hwirqs (1 , node); +} +void irq_free_hwirqs (unsigned int from,int cnt); +static inline void irq_free_hwirq (unsigned int irq) +{ +return irq_free_hwirqs (irq,1 ); +} +int arch_setup_hwirq (unsigned int irq,int node); +void arch_teardown_hwirq (unsigned int irq); +#endif +#ifndef irq_reg_writel# define irq_reg_writel (val, addr) writel(val, addr)#endif
kernel/irq/Kconfig +5 -0
@@ -17,6 +17,11 @@ config GENERIC_IRQ_SHOW config GENERIC_IRQ_SHOW_LEVEL bool +# Facility to allocate a hardware interrupt. This is legacy support +# and should not be used in new code. Use irq domains instead. +config GENERIC_IRQ_LEGACY_ALLOC_HWIRQ + bool + # Support for delayed migration from interrupt context config GENERIC_PENDING_IRQ bool
kernel/irq/irqdesc.c +51 -0
57 lines not on this page · raw message
PATCH 4/32 x86: Implement arch_setup/teardown_hwirq()
In reply to Thomas GleixnerThis is just a cleanup to get rid of the create/destroy_irq variants which were designed in hell.
The long term solution for x86 is to switch over to irq domains and cleanup the whole vector allocation mess.
The generic irq_alloc_hwirqs() interface deliberately prevents multi-MSI vector allocation to further enforce the irq domain conversion (aside of the desire to support ioapic hotplug).
--- arch/x86/Kconfig | 1 + arch/x86/kernel/apic/io_apic.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+)
arch/x86/Kconfig +1 -0
@@ -831,6 +831,7 @@ config X86_LOCAL_APIC config X86_IO_APIC def_bool y depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI + select GENERIC_IRQ_LEGACY_ALLOC_HWIRQ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS bool "Reroute for broken boot IRQs"
arch/x86/kernel/apic/io_apic.c +33 -0
@@ -3010,6 +3010,39 @@ void destroy_irqs(unsigned int irq, unsidestroy_irq (irq + i); } +int arch_setup_hwirq (unsigned int irq,int node) +{ +struct irq_cfg *cfg; +unsigned long flags; +int ret; + + cfg =alloc_irq_cfg (irq, node); +if (!cfg) +return -ENOMEM ; + +raw_spin_lock_irqsave (&vector_lock, flags); + ret =__assign_irq_vector (irq, cfg, apic->target_cpus ()); +raw_spin_unlock_irqrestore (&vector_lock, flags); + +if (!ret) +irq_set_chip_data (irq, cfg); +else +free_irq_cfg (irq, cfg); +return ret; +} + +void arch_teardown_hwirq (unsigned int irq) +{ +struct irq_cfg *cfg =irq_get_chip_data (irq); +unsigned long flags; + +free_remapped_irq (irq); +raw_spin_lock_irqsave (&vector_lock, flags); +__clear_irq_vector (irq, cfg); +raw_spin_unlock_irqrestore (&vector_lock, flags); +free_irq_cfg (irq, cfg); +} +/* * MSI message composition */
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] x86: Implement arch_setup/teardown_hwirq()
x86: Implement arch_setup/teardown_hwirq()
Commit-ID: b1ee544174fd0eb28a7770403b9577fd70f1cd3d Gitweb: http://git.kernel.org/tip/b1ee544174fd0eb28a7770403b9577fd70f1cd3d Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:06 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:18 +0200
x86: Implement arch_setup/teardown_hwirq()
This is just a cleanup to get rid of the create/destroy_irq variants which were designed in hell.
The long term solution for x86 is to switch over to irq domains and cleanup the whole vector allocation mess.
The generic irq_alloc_hwirqs() interface deliberately prevents multi-MSI vector allocation to further enforce the irq domain conversion (aside of the desire to support ioapic hotplug).
--- arch/x86/Kconfig | 1 + arch/x86/kernel/apic/io_apic.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+)
arch/x86/Kconfig +1 -0
@@ -831,6 +831,7 @@ config X86_LOCAL_APIC config X86_IO_APIC def_bool y depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI + select GENERIC_IRQ_LEGACY_ALLOC_HWIRQ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS bool "Reroute for broken boot IRQs"
arch/x86/kernel/apic/io_apic.c +33 -0
@@ -3010,6 +3010,39 @@ void destroy_irqs(unsigned int irq, unsigned int count)destroy_irq (irq + i); } +int arch_setup_hwirq (unsigned int irq,int node) +{ +struct irq_cfg *cfg; +unsigned long flags; +int ret; + + cfg =alloc_irq_cfg (irq, node); +if (!cfg) +return -ENOMEM ; + +raw_spin_lock_irqsave (&vector_lock, flags); + ret =__assign_irq_vector (irq, cfg, apic->target_cpus ()); +raw_spin_unlock_irqrestore (&vector_lock, flags); + +if (!ret) +irq_set_chip_data (irq, cfg); +else +free_irq_cfg (irq, cfg); +return ret; +} + +void arch_teardown_hwirq (unsigned int irq) +{ +struct irq_cfg *cfg =irq_get_chip_data (irq); +unsigned long flags; + +free_remapped_irq (irq); +raw_spin_lock_irqsave (&vector_lock, flags); +__clear_irq_vector (irq, cfg); +raw_spin_unlock_irqrestore (&vector_lock, flags); +free_irq_cfg (irq, cfg); +} +/* * MSI message composition */
PATCH 5/32 x86: irq_remapping: Use irq_alloc/free_hwirq()
In reply to Thomas GleixnerThe create_irq variants are going away. Use the new interface. The core and arch code already excludes the gsi interrupts from the allocation, so no functional change.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
--- drivers/iommu/irq_remapping.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/iommu/irq_remapping.c +5 -7
@@ -51,7 +51,7 @@ static void irq_remapping_disable_io_apistatic int do_setup_msi_irqs (struct pci_dev *dev,int nvec) { -int node, ret, sub_handle, nvec_pow2, index =0 ; +int ret, sub_handle, nvec_pow2, index =0 ;unsigned int irq;struct msi_desc *msidesc;
@@ -61,8 +61,7 @@ static int do_setup_msi_irqs(struct pci_WARN_ON (msidesc->msi_attrib.multiple);WARN_ON (msidesc->nvec_used); - node =dev_to_node (&dev->dev); - irq =__create_irqs (get_nr_irqs_gsi (), nvec, node); + irq =irq_alloc_hwirqs (nvec,dev_to_node (&dev->dev));if (irq ==0 )return -ENOSPC ;
@@ -89,7 +88,7 @@ static int do_setup_msi_irqs(struct pci_return 0 ; error: -destroy_irqs (irq, nvec); +irq_free_hwirqs (irq, nvec);/* * Restore altered MSI descriptor fields and prevent just destroyed
@@ -109,12 +108,11 @@ static int do_setup_msix_irqs(struct pciunsigned int irq; node =dev_to_node (&dev->dev); - irq =get_nr_irqs_gsi (); sub_handle =0 ;list_for_each_entry (msidesc, &dev->msi_list, list) { - irq =create_irq_nr (irq, node); + irq =irq_alloc_hwirq (node);if (irq ==0 )return -1 ;
@@ -137,7 +135,7 @@ static int do_setup_msix_irqs(struct pcireturn 0 ; error: -destroy_irq (irq); +irq_free_hwirq (irq);return ret; }
Re: [patch 05/32] x86: irq_remapping: Use irq_alloc/free_hwirq()
Hi Thomas,
Quoted 11 lines · Thomas Gleixner
The
create_irqvariants are going away. Use the new interface. The core and arch code already excludes the gsi interrupts from the allocation, so no functional change.This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
Signed-off-by Thomas Gleixner <[email protected]>Cc Joerg Roedel <[email protected]>
Can patches 5, 11 and 12 go through the IOMMU tree or do they depend on the other patches in the series?
If they have other dependencys and can't go through the IOMMU tree feel free to add my
Joerg
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] x86: irq_remapping: Use irq_alloc/free_hwirq()
In reply to Thomas Gleixnerx86: irq_remapping: Use irq_alloc/free_hwirq()
Commit-ID: d24a135412ab4dba50eb7aeffd4064eee23b4da6 Gitweb: http://git.kernel.org/tip/d24a135412ab4dba50eb7aeffd4064eee23b4da6 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:07 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:18 +0200
x86: irq_remapping: Use irq_alloc/free_hwirq()
The create_irq variants are going away. Use the new interface. The core and arch code already excludes the gsi interrupts from the allocation, so no functional change.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
--- drivers/iommu/irq_remapping.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/iommu/irq_remapping.c +5 -7
@@ -51,7 +51,7 @@ static void irq_remapping_disable_io_apic(void)static int do_setup_msi_irqs (struct pci_dev *dev,int nvec) { -int node, ret, sub_handle, nvec_pow2, index =0 ; +int ret, sub_handle, nvec_pow2, index =0 ;unsigned int irq;struct msi_desc *msidesc;
@@ -61,8 +61,7 @@ static int do_setup_msi_irqs(struct pci_dev *dev, int nvec)WARN_ON (msidesc->msi_attrib.multiple);WARN_ON (msidesc->nvec_used); - node =dev_to_node (&dev->dev); - irq =__create_irqs (get_nr_irqs_gsi (), nvec, node); + irq =irq_alloc_hwirqs (nvec,dev_to_node (&dev->dev));if (irq ==0 )return -ENOSPC ;
@@ -89,7 +88,7 @@ static int do_setup_msi_irqs(struct pci_dev *dev, int nvec)return 0 ; error: -destroy_irqs (irq, nvec); +irq_free_hwirqs (irq, nvec);/* * Restore altered MSI descriptor fields and prevent just destroyed
@@ -109,12 +108,11 @@ static int do_setup_msix_irqs(struct pci_dev *dev, int nvec)unsigned int irq; node =dev_to_node (&dev->dev); - irq =get_nr_irqs_gsi (); sub_handle =0 ;list_for_each_entry (msidesc, &dev->msi_list, list) { - irq =create_irq_nr (irq, node); + irq =irq_alloc_hwirq (node);if (irq ==0 )return -1 ;
@@ -137,7 +135,7 @@ static int do_setup_msix_irqs(struct pci_dev *dev, int nvec)return 0 ; error: -destroy_irq (irq); +irq_free_hwirq (irq);return ret; }
PATCH 6/32 x86: hpet: Use irq_alloc/free_hwirq()
In reply to Thomas GleixnerUse the new interfaces. No functional change.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
--- arch/x86/kernel/hpet.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/x86/kernel/hpet.c +2 -3
@@ -479,7 +479,7 @@ static int hpet_msi_next_event(unsignedstatic int hpet_setup_msi_irq (unsigned int irq) {if (x86_msi.setup_hpet_msi (irq, hpet_blockid)) { -destroy_irq (irq); +irq_free_hwirq (irq);return -EINVAL ; }return 0 ;
@@ -487,9 +487,8 @@ static int hpet_setup_msi_irq(unsigned istatic int hpet_assign_irq (struct hpet_dev *dev) { -unsigned int irq; +unsigned int irq =irq_alloc_hwirq (-1 ); - irq =create_irq_nr (0 ,-1 );if (!irq)return -EINVAL ;
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] x86: hpet: Use irq_alloc/free_hwirq()
x86: hpet: Use irq_alloc/free_hwirq()
Commit-ID: 499c2b75e9c695b57faaf6a63fde391ff9e523a3 Gitweb: http://git.kernel.org/tip/499c2b75e9c695b57faaf6a63fde391ff9e523a3 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:07 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:18 +0200
x86: hpet: Use irq_alloc/free_hwirq()
Use the new interfaces. No functional change.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
--- arch/x86/kernel/hpet.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/x86/kernel/hpet.c +2 -3
@@ -479,7 +479,7 @@ static int hpet_msi_next_event(unsigned long delta,static int hpet_setup_msi_irq (unsigned int irq) {if (x86_msi.setup_hpet_msi (irq, hpet_blockid)) { -destroy_irq (irq); +irq_free_hwirq (irq);return -EINVAL ; }return 0 ;
@@ -487,9 +487,8 @@ static int hpet_setup_msi_irq(unsigned int irq)static int hpet_assign_irq (struct hpet_dev *dev) { -unsigned int irq; +unsigned int irq =irq_alloc_hwirq (-1 ); - irq =create_irq_nr (0 ,-1 );if (!irq)return -EINVAL ;
PATCH 7/32 x86: uv: Use irq_alloc/free_hwirq()
In reply to Thomas GleixnerNo functional change. The request to allocate the irq above NR_IRQS_LEGACY is completely pointless as the implementation enforces that the dynamic allocations are above the GSI interrupts, which includes the legacy PIT irqs.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
--- arch/x86/platform/uv/uv_irq.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
arch/x86/platform/uv/uv_irq.c +4 -6
@@ -238,11 +238,9 @@ uv_set_irq_affinity(struct irq_data *datint uv_setup_irq (char *irq_name,int cpu,int mmr_blade,unsigned long mmr_offset,int limit) { -int irq, ret; +int ret, irq =irq_alloc_hwirq (uv_blade_to_memory_nid (mmr_blade)); - irq =create_irq_nr (NR_IRQS_LEGACY ,uv_blade_to_memory_nid (mmr_blade)); - -if (irq <=0 ) +if (!irq)return -EBUSY ; ret = arch_enable_uv_irq(irq_name, irq, cpu, mmr_blade, mmr_offset,
@@ -250,7 +248,7 @@ int uv_setup_irq(char *irq_name, int cpuif (ret == irq)uv_set_irq_2_mmr_info (irq, mmr_offset, mmr_blade);else -destroy_irq (irq); +irq_free_hwirq (irq);return ret; }
@@ -285,6 +283,6 @@ void uv_teardown_irq(unsigned int irq) n = n->rb_right; }spin_unlock_irqrestore (&uv_irq_lock, irqflags); -destroy_irq (irq); +irq_free_hwirq (irq); }EXPORT_SYMBOL_GPL (uv_teardown_irq);
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] x86: uv: Use irq_alloc/free_hwirq()
x86: uv: Use irq_alloc/free_hwirq()
Commit-ID: 0a2db49dc4fe2873f857617d320c37b6bfe40255 Gitweb: http://git.kernel.org/tip/0a2db49dc4fe2873f857617d320c37b6bfe40255 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:08 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:19 +0200
x86: uv: Use irq_alloc/free_hwirq()
No functional change. The request to allocate the irq above NR_IRQS_LEGACY is completely pointless as the implementation enforces that the dynamic allocations are above the GSI interrupts, which includes the legacy PIT irqs.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
--- arch/x86/platform/uv/uv_irq.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
arch/x86/platform/uv/uv_irq.c +4 -6
@@ -238,11 +238,9 @@ uv_set_irq_affinity(struct irq_data *data, const struct cpumask *mask,int uv_setup_irq (char *irq_name,int cpu,int mmr_blade,unsigned long mmr_offset,int limit) { -int irq, ret; +int ret, irq =irq_alloc_hwirq (uv_blade_to_memory_nid (mmr_blade)); - irq =create_irq_nr (NR_IRQS_LEGACY ,uv_blade_to_memory_nid (mmr_blade)); - -if (irq <=0 ) +if (!irq)return -EBUSY ; ret = arch_enable_uv_irq(irq_name, irq, cpu, mmr_blade, mmr_offset,
@@ -250,7 +248,7 @@ int uv_setup_irq(char *irq_name, int cpu, int mmr_blade,if (ret == irq)uv_set_irq_2_mmr_info (irq, mmr_offset, mmr_blade);else -destroy_irq (irq); +irq_free_hwirq (irq);return ret; }
@@ -285,6 +283,6 @@ void uv_teardown_irq(unsigned int irq) n = n->rb_right; }spin_unlock_irqrestore (&uv_irq_lock, irqflags); -destroy_irq (irq); +irq_free_hwirq (irq); }EXPORT_SYMBOL_GPL (uv_teardown_irq);
PATCH 8/32 x86: htirq: Use irq_alloc/free_irq()
In reply to Thomas GleixnerNo functional change, just cleaned up a bit.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
--- drivers/pci/htirq.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/pci/htirq.c +4 -9
@@ -87,12 +87,9 @@ void unmask_ht_irq(struct irq_data *dataint __ht_create_irq (struct pci_dev *dev,int idx,ht_irq_update_t *update) {struct ht_irq_cfg *cfg; +int max_irq, pos, irq;unsigned long flags;u32 data; -int max_irq; -int pos; -int irq; -int node; pos =pci_find_ht_capability (dev,HT_CAPTYPE_IRQ );if (!pos)
@@ -120,10 +117,8 @@ int __ht_create_irq(struct pci_dev *dev, cfg->msg.address_lo =0xffffffff ; cfg->msg.address_hi =0xffffffff ; - node =dev_to_node (&dev->dev); - irq =create_irq_nr (0 , node); - -if (irq <=0 ) { + irq =irq_alloc_hwirq (dev_to_node (&dev->dev)); +if (!irq) {kfree (cfg);return -EBUSY ; }
@@ -166,7 +161,7 @@ void ht_destroy_irq(unsigned int irq) cfg =irq_get_handler_data (irq);irq_set_chip (irq,NULL );irq_set_handler_data (irq,NULL ); -destroy_irq (irq); +irq_free_hwirq (irq);kfree (cfg); }
Re: [patch 08/32] x86: htirq: Use irq_alloc/free_irq()
Quoted 6 lines · Thomas Gleixner
No functional change, just cleaned up a bit.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
Signed-off-by Thomas Gleixner <[email protected]>
I assume you'll merge this along with the rest of your series. Let me know if you need me to do anything.
Quoted 49 lines
--- drivers/pci/htirq.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)Index:
tip/drivers/pci/htirq.c
===================================================================drivers/pci/htirq.c +4
-9@@ -87,12 +87,9 @@ void unmask_ht_irq(struct irq_data *dataint __ht_create_irq (struct pci_dev *dev,int idx,ht_irq_update_t *update) {struct ht_irq_cfg *cfg; +int max_irq, pos, irq;unsigned long flags;u32 data; -int max_irq; -int pos; -int irq; -int node; pos =pci_find_ht_capability (dev,HT_CAPTYPE_IRQ );if (!pos)@@ -120,10 +117,8 @@ int __ht_create_irq(struct pci_dev *dev, cfg->msg.address_lo =0xffffffff ; cfg->msg.address_hi =0xffffffff ; - node =dev_to_node (&dev->dev); - irq =create_irq_nr (0 , node); - -if (irq <=0 ) { + irq =irq_alloc_hwirq (dev_to_node (&dev->dev)); +if (!irq) {kfree (cfg);return -EBUSY ; }@@ -166,7 +161,7 @@ void ht_destroy_irq(unsigned int irq) cfg =irq_get_handler_data (irq);irq_set_chip (irq,NULL );irq_set_handler_data (irq,NULL ); -destroy_irq (irq); +irq_free_hwirq (irq);kfree (cfg); }
Re: [patch 08/32] x86: htirq: Use irq_alloc/free_irq()
Quoted 6 lines · Bjorn Helgaas
Quoted 5 lines · Thomas Gleixner
No functional change, just cleaned up a bit.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
Quoted 6 lines
Quoted 1 line
Signed-off-by Thomas Gleixner <[email protected]>Acked-by Bjorn Helgaas <[email protected]>I assume you'll merge this along with the rest of your series. Let me know if you need me to do anything.
Yes, I'll take the whole lot when nobody screams
Thanks,
tglx
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] x86: htirq: Use irq_alloc/free_irq()
In reply to Thomas Gleixnerx86: htirq: Use irq_alloc/free_irq()
Commit-ID: 59b47ddc0b4d7ea8a625512e802832730c1feeb4 Gitweb: http://git.kernel.org/tip/59b47ddc0b4d7ea8a625512e802832730c1feeb4 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:08 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:19 +0200
x86: htirq: Use irq_alloc/free_irq()
No functional change, just cleaned up a bit.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
--- drivers/pci/htirq.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/pci/htirq.c +4 -9
@@ -87,12 +87,9 @@ void unmask_ht_irq(struct irq_data *data)int __ht_create_irq (struct pci_dev *dev,int idx,ht_irq_update_t *update) {struct ht_irq_cfg *cfg; +int max_irq, pos, irq;unsigned long flags;u32 data; -int max_irq; -int pos; -int irq; -int node; pos =pci_find_ht_capability (dev,HT_CAPTYPE_IRQ );if (!pos)
@@ -120,10 +117,8 @@ int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update) cfg->msg.address_lo =0xffffffff ; cfg->msg.address_hi =0xffffffff ; - node =dev_to_node (&dev->dev); - irq =create_irq_nr (0 , node); - -if (irq <=0 ) { + irq =irq_alloc_hwirq (dev_to_node (&dev->dev)); +if (!irq) {kfree (cfg);return -EBUSY ; }
@@ -166,7 +161,7 @@ void ht_destroy_irq(unsigned int irq) cfg =irq_get_handler_data (irq);irq_set_chip (irq,NULL );irq_set_handler_data (irq,NULL ); -destroy_irq (irq); +irq_free_hwirq (irq);kfree (cfg); }
PATCH 9/32 x86: ioapic: Use irq_alloc/free_hwirq()
In reply to Thomas GleixnerNo functional change just less crap.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
--- arch/x86/kernel/apic/io_apic.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-)
arch/x86/kernel/apic/io_apic.c +10 -13
@@ -3169,8 +3169,8 @@ int setup_msi_irq(struct pci_dev *dev, sint native_setup_msi_irqs (struct pci_dev *dev,int nvec,int type) { -unsigned int irq, irq_want;struct msi_desc *msidesc; +unsigned int irq;int node, ret;/* Multiple MSI vectors only supported with interrupt remapping */
@@ -3178,28 +3178,25 @@ int native_setup_msi_irqs(struct pci_devreturn 1 ; node =dev_to_node (&dev->dev); - irq_want = nr_irqs_gsi; +list_for_each_entry (msidesc, &dev->msi_list, list) { - irq =create_irq_nr (irq_want, node); -if (irq ==0 ) + irq =irq_alloc_hwirq (node); +if (!irq)return -ENOSPC ; - irq_want = irq +1 ; - ret =setup_msi_irq (dev, msidesc, irq,0 ); -if (ret <0 ) - goto error; +if (ret <0 ) { +irq_free_hwirq (irq); +return ret; + } + }return 0 ; - -error: -destroy_irq (irq); -return ret; }void native_teardown_msi_irq (unsigned int irq) { -destroy_irq (irq); +irq_free_hwirq (irq); }#ifdef CONFIG_DMAR_TABLE
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] x86: ioapic: Use irq_alloc/free_hwirq()
x86: ioapic: Use irq_alloc/free_hwirq()
Commit-ID: be47be6c28a83dd8b3c5540d0be3675af1ac7b2e Gitweb: http://git.kernel.org/tip/be47be6c28a83dd8b3c5540d0be3675af1ac7b2e Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:09 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:19 +0200
x86: ioapic: Use irq_alloc/free_hwirq()
No functional change just less crap.
This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree.
--- arch/x86/kernel/apic/io_apic.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-)
arch/x86/kernel/apic/io_apic.c +10 -13
@@ -3169,8 +3169,8 @@ int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,int native_setup_msi_irqs (struct pci_dev *dev,int nvec,int type) { -unsigned int irq, irq_want;struct msi_desc *msidesc; +unsigned int irq;int node, ret;/* Multiple MSI vectors only supported with interrupt remapping */
@@ -3178,28 +3178,25 @@ int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)return 1 ; node =dev_to_node (&dev->dev); - irq_want = nr_irqs_gsi; +list_for_each_entry (msidesc, &dev->msi_list, list) { - irq =create_irq_nr (irq_want, node); -if (irq ==0 ) + irq =irq_alloc_hwirq (node); +if (!irq)return -ENOSPC ; - irq_want = irq +1 ; - ret =setup_msi_irq (dev, msidesc, irq,0 ); -if (ret <0 ) - goto error; +if (ret <0 ) { +irq_free_hwirq (irq); +return ret; + } + }return 0 ; - -error: -destroy_irq (irq); -return ret; }void native_teardown_msi_irq (unsigned int irq) { -destroy_irq (irq); +irq_free_hwirq (irq); }#ifdef CONFIG_DMAR_TABLE
PATCH 10/32 x86: Get rid of get_nr_irqs_gsi()
In reply to Thomas GleixnerNo need to expose this outside of the ioapic code. The dynamic allocations are guaranteed not to happen in the gsi space. See commit 62a08ae2a.
--- arch/x86/include/asm/io_apic.h | 2 -- arch/x86/kernel/apic/io_apic.c | 5 ----- drivers/xen/events/events_base.c | 17 +---------------- 3 files changed, 1 insertion(+), 23 deletions(-)
arch/x86/include/asm/io_apic.h +0 -2
@@ -168,8 +168,6 @@ extern int save_ioapic_entries(void);extern void mask_ioapic_entries (void );extern int restore_ioapic_entries (void ); -extern int get_nr_irqs_gsi (void ); -extern void setup_ioapic_ids_from_mpc (void );extern void setup_ioapic_ids_from_mpc_nocheck (void );
arch/x86/kernel/apic/io_apic.c +0 -5
@@ -3450,11 +3450,6 @@ static void __init probe_nr_irqs_gsi(voiprintk (KERN_DEBUG "nr_irqs_gsi: %d\n" , nr_irqs_gsi); } -int get_nr_irqs_gsi (void ) -{ -return nr_irqs_gsi; -} -unsigned int arch_dynirq_lower_bound (unsigned int from) {return from < nr_irqs_gsi ? nr_irqs_gsi : from;
drivers/xen/events/events_base.c +1 -16
@@ -390,22 +390,7 @@ static void xen_irq_init(unsigned irq)static int __must_check xen_allocate_irqs_dynamic (int nvec) { -int first =0 ; -int i, irq; - -#ifdef CONFIG_X86_IO_APIC -/* -* For an HVM guest or domain 0 which see "real" (emulated or -* actual respectively) GSIs we allocate dynamic IRQs -* e.g. those corresponding to event channels or MSIs -* etc. from the range above those "real" GSIs to avoid -* collisions. -*/ -if (xen_initial_domain () ||xen_hvm_domain ()) - first =get_nr_irqs_gsi (); -#endif - - irq =irq_alloc_descs_from (first, nvec,-1 ); +int i, irq =irq_alloc_descs (-1 ,0 , nvec,-1 );if (irq >=0 ) {for (i =0 ; i < nvec; i++)
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] x86: Get rid of get_nr_irqs_gsi()
x86: Get rid of get_nr_irqs_gsi()
Commit-ID: d07c9f18756e8231909a9bbcbfa7502c60cbc810 Gitweb: http://git.kernel.org/tip/d07c9f18756e8231909a9bbcbfa7502c60cbc810 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:10 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:19 +0200
x86: Get rid of get_nr_irqs_gsi()
No need to expose this outside of the ioapic code. The dynamic allocations are guaranteed not to happen in the gsi space. See commit 62a08ae2a.
--- arch/x86/include/asm/io_apic.h | 2 -- arch/x86/kernel/apic/io_apic.c | 5 ----- drivers/xen/events/events_base.c | 17 +---------------- 3 files changed, 1 insertion(+), 23 deletions(-)
arch/x86/include/asm/io_apic.h +0 -2
@@ -168,8 +168,6 @@ extern int save_ioapic_entries(void);extern void mask_ioapic_entries (void );extern int restore_ioapic_entries (void ); -extern int get_nr_irqs_gsi (void ); -extern void setup_ioapic_ids_from_mpc (void );extern void setup_ioapic_ids_from_mpc_nocheck (void );
arch/x86/kernel/apic/io_apic.c +0 -5
@@ -3450,11 +3450,6 @@ static void __init probe_nr_irqs_gsi(void)printk (KERN_DEBUG "nr_irqs_gsi: %d\n" , nr_irqs_gsi); } -int get_nr_irqs_gsi (void ) -{ -return nr_irqs_gsi; -} -unsigned int arch_dynirq_lower_bound (unsigned int from) {return from < nr_irqs_gsi ? nr_irqs_gsi : from;
drivers/xen/events/events_base.c +1 -16
@@ -390,22 +390,7 @@ static void xen_irq_init(unsigned irq)static int __must_check xen_allocate_irqs_dynamic (int nvec) { -int first =0 ; -int i, irq; - -#ifdef CONFIG_X86_IO_APIC -/* -* For an HVM guest or domain 0 which see "real" (emulated or -* actual respectively) GSIs we allocate dynamic IRQs -* e.g. those corresponding to event channels or MSIs -* etc. from the range above those "real" GSIs to avoid -* collisions. -*/ -if (xen_initial_domain () ||xen_hvm_domain ()) - first =get_nr_irqs_gsi (); -#endif - - irq =irq_alloc_descs_from (first, nvec,-1 ); +int i, irq =irq_alloc_descs (-1 ,0 , nvec,-1 );if (irq >=0 ) {for (i =0 ; i < nvec; i++)
PATCH 11/32 iommu: dmar: Fix return value check of create_irq()
In reply to Thomas Gleixneria64 returns a negative error code when allocation fails andx86 returns 0. Make it handle both.
--- drivers/iommu/dmar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dmar.c +1 -1
@@ -1551,7 +1551,7 @@ int dmar_set_interrupt(struct intel_iommreturn 0 ; irq =create_irq (); -if (!irq) { +if (irq <=0 ) {pr_err ("IOMMU: no free vectors\n" );return -EINVAL ; }
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] iommu: smar: Fix return value check of create_irq( )
iommu: smar: Fix return value check of create_irq()
Commit-ID: aa5125a45568f8f666f6d2f224fe8ab261b1069e Gitweb: http://git.kernel.org/tip/aa5125a45568f8f666f6d2f224fe8ab261b1069e Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:10 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:19 +0200
iommu: smar: Fix return value check of create_irq()
ia64 returns a negative error code when allocation fails andx86 returns 0. Make it handle both.
--- drivers/iommu/dmar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dmar.c +1 -1
@@ -1551,7 +1551,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu)return 0 ; irq =create_irq (); -if (!irq) { +if (irq <=0 ) {pr_err ("IOMMU: no free vectors\n" );return -EINVAL ; }
PATCH 12/32 iommu: dmar: Provide arch specific irq allocation
In reply to Thomas Gleixneria64 and x86 share this driver. x86 is moving to a different irq allocation and ia64 keeps its private irq_create/destroy stuff.
Use macros to redirect to one or the other. Yes, macros to avoid include hell.
--- arch/ia64/include/asm/irq_remapping.h | 2 ++ arch/x86/include/asm/irq_remapping.h | 3 +++ drivers/iommu/dmar.c | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-)
arch/ia64/include/asm/irq_remapping.h +2 -0
@@ -1,4 +1,6 @@#ifndef __IA64_INTR_REMAPPING_H#define __IA64_INTR_REMAPPING_H#define irq_remapping_enabled 0 +#define dmar_alloc_hwirq create_irq +#define dmar_free_hwirq destroy_irq#endif
arch/x86/include/asm/irq_remapping.h +3 -0
@@ -58,6 +58,9 @@ extern bool setup_remapped_irq(int irq,void irq_remap_modify_chip_defaults (struct irq_chip *chip); +#define dmar_alloc_hwirq () irq_alloc_hwirq(-1) +#define dmar_free_hwirq irq_free_hwirq +#else /* CONFIG_IRQ_REMAP */ static inline void setup_irq_remapping_ops (void ) { }
drivers/iommu/dmar.c +3 -3
@@ -994,7 +994,7 @@ static void free_iommu(struct intel_iommif (iommu->irq) {free_irq (iommu->irq, iommu);irq_set_handler_data (iommu->irq,NULL ); -destroy_irq (iommu->irq); +dmar_free_hwirq (iommu->irq); }if (iommu->qi) {
@@ -1550,7 +1550,7 @@ int dmar_set_interrupt(struct intel_iommif (iommu->irq)return 0 ; - irq =create_irq (); + irq =dmar_alloc_hwirq ();if (irq <=0 ) {pr_err ("IOMMU: no free vectors\n" );return -EINVAL ;
@@ -1563,7 +1563,7 @@ int dmar_set_interrupt(struct intel_iommif (ret) {irq_set_handler_data (irq,NULL ); iommu->irq =0 ; -destroy_irq (irq); +dmar_free_hwirq (irq);return ret; }
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] iommu: dmar: Provide arch specific irq allocation
iommu: dmar: Provide arch specific irq allocation
Commit-ID: a553b142b8effbfcbba24ebbf8c07a1a86d32ce6 Gitweb: http://git.kernel.org/tip/a553b142b8effbfcbba24ebbf8c07a1a86d32ce6 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:11 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:19 +0200
iommu: dmar: Provide arch specific irq allocation
ia64 and x86 share this driver. x86 is moving to a different irq allocation and ia64 keeps its private irq_create/destroy stuff.
Use macros to redirect to one or the other. Yes, macros to avoid include hell.
--- arch/ia64/include/asm/irq_remapping.h | 2 ++ arch/x86/include/asm/irq_remapping.h | 3 +++ drivers/iommu/dmar.c | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-)
arch/ia64/include/asm/irq_remapping.h +2 -0
@@ -1,4 +1,6 @@#ifndef __IA64_INTR_REMAPPING_H#define __IA64_INTR_REMAPPING_H#define irq_remapping_enabled 0 +#define dmar_alloc_hwirq create_irq +#define dmar_free_hwirq destroy_irq#endif
arch/x86/include/asm/irq_remapping.h +3 -0
@@ -103,4 +103,7 @@ static inline bool setup_remapped_irq(int irq, }#endif /* CONFIG_IRQ_REMAP */ +#define dmar_alloc_hwirq () irq_alloc_hwirq(-1) +#define dmar_free_hwirq irq_free_hwirq +#endif /* __X86_IRQ_REMAPPING_H */
drivers/iommu/dmar.c +3 -3
@@ -994,7 +994,7 @@ static void free_iommu(struct intel_iommu *iommu)if (iommu->irq) {free_irq (iommu->irq, iommu);irq_set_handler_data (iommu->irq,NULL ); -destroy_irq (iommu->irq); +dmar_free_hwirq (iommu->irq); }if (iommu->qi) {
@@ -1550,7 +1550,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu)if (iommu->irq)return 0 ; - irq =create_irq (); + irq =dmar_alloc_hwirq ();if (irq <=0 ) {pr_err ("IOMMU: no free vectors\n" );return -EINVAL ;
@@ -1563,7 +1563,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu)if (ret) {irq_set_handler_data (irq,NULL ); iommu->irq =0 ; -destroy_irq (irq); +dmar_free_hwirq (irq);return ret; }
PATCH 13/32 ia64: Remove unused check_irq_used()
In reply to Thomas GleixnerJust stumbled over it when staring into ia64 irq handling.
--- arch/ia64/include/asm/hw_irq.h | 1 - arch/ia64/kernel/irq_ia64.c | 8 -------- 2 files changed, 9 deletions(-)
arch/ia64/include/asm/hw_irq.h +0 -1
@@ -132,7 +132,6 @@ extern int reserve_irq_vector (int vectoextern void __setup_vector_irq (int cpu);extern void ia64_send_ipi (int cpu,int vector,int delivery_mode,int redirect);extern void ia64_native_register_percpu_irq (ia64_vector vec,struct irqaction *action); -extern int check_irq_used (int irq);extern void destroy_and_reserve_irq (unsigned int irq);#if defined(CONFIG_SMP ) && (defined(CONFIG_IA64_GENERIC ) || defined(CONFIG_IA64_DIG ))
arch/ia64/kernel/irq_ia64.c +0 -8
@@ -93,14 +93,6 @@ static int irq_status[NR_IRQS] = { [0 ... NR_IRQS -1] = IRQ_UNUSED }; -int check_irq_used (int irq) -{ -if (irq_status[irq] ==IRQ_USED ) -return 1 ; - -return -1 ; -} -static inline int find_unassigned_irq (void ) {int irq;
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] ia64: Remove unused check_irq_used()
ia64: Remove unused check_irq_used()
Commit-ID: fd5d8abf8bdf9519f40058b5cd24b6ab37b214b4 Gitweb: http://git.kernel.org/tip/fd5d8abf8bdf9519f40058b5cd24b6ab37b214b4 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:11 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:20 +0200
ia64: Remove unused check_irq_used()
Just stumbled over it when staring into ia64 irq handling.
--- arch/ia64/include/asm/hw_irq.h | 1 - arch/ia64/kernel/irq_ia64.c | 8 -------- 2 files changed, 9 deletions(-)
arch/ia64/include/asm/hw_irq.h +0 -1
@@ -132,7 +132,6 @@ extern int reserve_irq_vector (int vector);extern void __setup_vector_irq (int cpu);extern void ia64_send_ipi (int cpu,int vector,int delivery_mode,int redirect);extern void ia64_native_register_percpu_irq (ia64_vector vec,struct irqaction *action); -extern int check_irq_used (int irq);extern void destroy_and_reserve_irq (unsigned int irq);#if defined(CONFIG_SMP ) && (defined(CONFIG_IA64_GENERIC ) || defined(CONFIG_IA64_DIG ))
arch/ia64/kernel/irq_ia64.c +0 -8
@@ -93,14 +93,6 @@ static int irq_status[NR_IRQS] = { [0 ... NR_IRQS -1] = IRQ_UNUSED }; -int check_irq_used (int irq) -{ -if (irq_status[irq] ==IRQ_USED ) -return 1 ; - -return -1 ; -} -static inline int find_unassigned_irq (void ) {int irq;
PATCH 14/32 x86: Remove create/dstroy_irq()
In reply to Thomas GleixnerNo more users. Remove the cruft
--- arch/x86/kernel/apic/io_apic.c | 106 ----------------------------------------- include/linux/irq.h | 4 - 2 files changed, 1 insertion(+), 109 deletions(-)
arch/x86/kernel/apic/io_apic.c +1 -105
@@ -281,18 +281,6 @@ static struct irq_cfg *alloc_irq_and_cfgreturn cfg; } -static int alloc_irqs_from (unsigned int from,unsigned int count,int node) -{ -return irq_alloc_descs_from (from, count, node); -} - -static void free_irq_at (unsigned int at,struct irq_cfg *cfg) -{ -free_irq_cfg (at, cfg); -irq_free_desc (at); -} - -struct io_apic {unsigned int index;unsigned int unused[3 ];
@@ -2916,100 +2904,8 @@ static int __init ioapic_init_ops(void)device_initcall (ioapic_init_ops);/* -* Dynamic irq allocate and deallocation +* Dynamic irq allocate and deallocation. Should be replaced by irq domains! */ -unsigned int __create_irqs (unsigned int from,unsigned int count,int node) -{ -struct irq_cfg **cfg; -unsigned long flags; -int irq, i; - -if (from < nr_irqs_gsi) - from = nr_irqs_gsi; - - cfg =kzalloc_node (count *sizeof (cfg[0 ]),GFP_KERNEL , node); -if (!cfg) -return 0 ; - - irq =alloc_irqs_from (from, count, node); -if (irq <0 ) - goto out_cfgs; - -for (i =0 ; i < count; i++) { - cfg[i] =alloc_irq_cfg (irq + i, node); -if (!cfg[i]) - goto out_irqs; - } - -raw_spin_lock_irqsave (&vector_lock, flags); -for (i =0 ; i < count; i++) -if (__assign_irq_vector (irq + i, cfg[i], apic->target_cpus ())) - goto out_vecs; -raw_spin_unlock_irqrestore (&vector_lock, flags); - -for (i =0 ; i < count; i++) { -irq_set_chip_data (irq + i, cfg[i]); -irq_clear_status_flags (irq + i,IRQ_NOREQUEST ); - } - -kfree (cfg); -return irq; - -out_vecs: -for (i--; i >=0 ; i--) -__clear_irq_vector (irq + i, cfg[i]); -raw_spin_unlock_irqrestore (&vector_lock, flags); -out_irqs: -for (i =0 ; i < count; i++) -free_irq_at (irq + i, cfg[i]); -out_cfgs: -kfree (cfg); -return 0 ; -} - -unsigned int create_irq_nr (unsigned int from,int node) -{ -return __create_irqs (from,1 , node); -} - -int create_irq (void ) -{ -int node =cpu_to_node (0 ); -unsigned int irq_want; -int irq; - - irq_want = nr_irqs_gsi; - irq =create_irq_nr (irq_want, node); - -if (irq ==0 ) - irq =-1 ; - -return irq; -} - -void destroy_irq (unsigned int irq) -{ -struct irq_cfg *cfg =irq_get_chip_data (irq); -unsigned long flags; - -irq_set_status_flags (irq,IRQ_NOREQUEST |IRQ_NOPROBE ); - -free_remapped_irq (irq); - -raw_spin_lock_irqsave (&vector_lock, flags); -__clear_irq_vector (irq, cfg); -raw_spin_unlock_irqrestore (&vector_lock, flags); -free_irq_at (irq, cfg); -} - -void destroy_irqs (unsigned int irq,unsigned int count) -{ -unsigned int i; - -for (i =0 ; i < count; i++) -destroy_irq (irq + i); -} -int arch_setup_hwirq (unsigned int irq,int node) {struct irq_cfg *cfg;
include/linux/irq.h +0 -4
@@ -526,12 +526,8 @@ static inline void irq_set_percpu_devid_ }/* Handle dynamic irq creation and destruction */ -extern unsigned int create_irq_nr (unsigned int irq_want,int node); -extern unsigned int __create_irqs (unsigned int from,unsigned int count, -int node);extern int create_irq (void );extern void destroy_irq (unsigned int irq); -extern void destroy_irqs (unsigned int irq,unsigned int count);/* * Dynamic irq helper functions. Obsolete. Use irq_alloc_desc* and
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] x86: Remove create/destroy_irq()
x86: Remove create/destroy_irq()
Commit-ID: 54859f59fc18e5c104a4095420b3fcef8bc3ae63 Gitweb: http://git.kernel.org/tip/54859f59fc18e5c104a4095420b3fcef8bc3ae63 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:12 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:20 +0200
x86: Remove create/destroy_irq()
No more users. Remove the cruft
--- arch/x86/kernel/apic/io_apic.c | 106 +---------------------------------------- include/linux/irq.h | 4 -- 2 files changed, 1 insertion(+), 109 deletions(-)
arch/x86/kernel/apic/io_apic.c +1 -105
@@ -281,18 +281,6 @@ static struct irq_cfg *alloc_irq_and_cfg_at(unsigned int at, int node)return cfg; } -static int alloc_irqs_from (unsigned int from,unsigned int count,int node) -{ -return irq_alloc_descs_from (from, count, node); -} - -static void free_irq_at (unsigned int at,struct irq_cfg *cfg) -{ -free_irq_cfg (at, cfg); -irq_free_desc (at); -} - -struct io_apic {unsigned int index;unsigned int unused[3 ];
@@ -2916,100 +2904,8 @@ static int __init ioapic_init_ops(void)device_initcall (ioapic_init_ops);/* -* Dynamic irq allocate and deallocation +* Dynamic irq allocate and deallocation. Should be replaced by irq domains! */ -unsigned int __create_irqs (unsigned int from,unsigned int count,int node) -{ -struct irq_cfg **cfg; -unsigned long flags; -int irq, i; - -if (from < nr_irqs_gsi) - from = nr_irqs_gsi; - - cfg =kzalloc_node (count *sizeof (cfg[0 ]),GFP_KERNEL , node); -if (!cfg) -return 0 ; - - irq =alloc_irqs_from (from, count, node); -if (irq <0 ) - goto out_cfgs; - -for (i =0 ; i < count; i++) { - cfg[i] =alloc_irq_cfg (irq + i, node); -if (!cfg[i]) - goto out_irqs; - } - -raw_spin_lock_irqsave (&vector_lock, flags); -for (i =0 ; i < count; i++) -if (__assign_irq_vector (irq + i, cfg[i], apic->target_cpus ())) - goto out_vecs; -raw_spin_unlock_irqrestore (&vector_lock, flags); - -for (i =0 ; i < count; i++) { -irq_set_chip_data (irq + i, cfg[i]); -irq_clear_status_flags (irq + i,IRQ_NOREQUEST ); - } - -kfree (cfg); -return irq; - -out_vecs: -for (i--; i >=0 ; i--) -__clear_irq_vector (irq + i, cfg[i]); -raw_spin_unlock_irqrestore (&vector_lock, flags); -out_irqs: -for (i =0 ; i < count; i++) -free_irq_at (irq + i, cfg[i]); -out_cfgs: -kfree (cfg); -return 0 ; -} - -unsigned int create_irq_nr (unsigned int from,int node) -{ -return __create_irqs (from,1 , node); -} - -int create_irq (void ) -{ -int node =cpu_to_node (0 ); -unsigned int irq_want; -int irq; - - irq_want = nr_irqs_gsi; - irq =create_irq_nr (irq_want, node); - -if (irq ==0 ) - irq =-1 ; - -return irq; -} - -void destroy_irq (unsigned int irq) -{ -struct irq_cfg *cfg =irq_get_chip_data (irq); -unsigned long flags; - -irq_set_status_flags (irq,IRQ_NOREQUEST |IRQ_NOPROBE ); - -free_remapped_irq (irq); - -raw_spin_lock_irqsave (&vector_lock, flags); -__clear_irq_vector (irq, cfg); -raw_spin_unlock_irqrestore (&vector_lock, flags); -free_irq_at (irq, cfg); -} - -void destroy_irqs (unsigned int irq,unsigned int count) -{ -unsigned int i; - -for (i =0 ; i < count; i++) -destroy_irq (irq + i); -} -int arch_setup_hwirq (unsigned int irq,int node) {struct irq_cfg *cfg;
include/linux/irq.h +0 -4
@@ -526,12 +526,8 @@ static inline void irq_set_percpu_devid_flags(unsigned int irq) }/* Handle dynamic irq creation and destruction */ -extern unsigned int create_irq_nr (unsigned int irq_want,int node); -extern unsigned int __create_irqs (unsigned int from,unsigned int count, -int node);extern int create_irq (void );extern void destroy_irq (unsigned int irq); -extern void destroy_irqs (unsigned int irq,unsigned int count);/* * Dynamic irq helper functions. Obsolete. Use irq_alloc_desc* and
PATCH 15/32 tile: Implement irq_alloc/free_hwirq() for migration
In reply to Thomas GleixnerWe want to convert the drivers over to the new interface and finally tile to sparse irqs. Implement irq_alloc/free_hwirq() for step by step migration.
--- arch/tile/include/asm/irq.h | 3 +++ arch/tile/kernel/irq.c | 12 ++++++++++++ 2 files changed, 15 insertions(+)
arch/tile/include/asm/irq.h +3 -0
@@ -76,4 +76,7 @@ void tile_irq_activate(unsigned int irq,void setup_irq_regs (void ); +unsigned int irq_alloc_hwirq (int node); +void irq_free_hwirq (unsigned int irq); +#endif /* _ASM_TILE_IRQ_H */
arch/tile/kernel/irq.c +12 -0
@@ -312,4 +312,16 @@ void destroy_irq(unsigned int irq) spin_unlock_irqrestore(&available_irqs_lock, flags); }EXPORT_SYMBOL (destroy_irq); + +unsigned int irq_alloc_hwirq (int node) +{ +int ret =create_irq (); +return ret <0 ?0 : ret; +} + +void irq_free_hwirq (unsigned int irq) +{ +destroy_irq (); +} +#endif
Re: [patch 15/32] tile: Implement irq_alloc/free_hwirq() for migration
(Resending since my mailer "helpfully" upgraded the previous version to multipart/mixed.)
arch/tile/kernel/irq.c void destroy_irq(unsigned int irq) · line 325
Quoted 9 lines · Thomas Gleixner
We want to convert the drivers over to the new interface and finally tile to sparse irqs. Implement irq_alloc/free_hwirq() for step by step migration.
arch/tile/kernel/irq.c +4
-0+void irq_free_hwirq (unsigned int irq) +{ +destroy_irq (); +}
Should be destroy_irq(irq).
Signature · 2 lines
Chris Metcalf, Tilera Corp. http://www.tilera.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [patch 15/32] tile: Implement irq_alloc/free_hwirq() for migration
Quoted 6 lines · Chris Metcalf
Quoted 5 lines · Thomas Gleixner
We want to convert the drivers over to the new interface and finally tile to sparse irqs. Implement irq_alloc/free_hwirq() for step by step migration.
Quoted 6 lines
arch/tile/kernel/irq.c void destroy_irq(unsigned int irq) · line 325
Quoted 4 lines
arch/tile/kernel/irq.c +4
-0+void irq_free_hwirq (unsigned int irq) +{ +destroy_irq (); +}Should be
destroy_irq(irq).
Yep. I caught that already when I exposed the series step by step to a compiler.
Thanks,
tglx
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] tile: Implement irq_alloc/free_hwirq() for migration
In reply to Thomas Gleixnertile: Implement irq_alloc/free_hwirq() for migration
Commit-ID: 6ef40512c55b18f8fdf1074b2f2d7eadcd50fec7 Gitweb: http://git.kernel.org/tip/6ef40512c55b18f8fdf1074b2f2d7eadcd50fec7 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:13 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:20 +0200
tile: Implement irq_alloc/free_hwirq() for migration
We want to convert the drivers over to the new interface and finally tile to sparse irqs. Implement irq_alloc/free_hwirq() for step by step migration.
--- arch/tile/include/asm/irq.h | 3 +++ arch/tile/kernel/irq.c | 12 ++++++++++++ 2 files changed, 15 insertions(+)
arch/tile/include/asm/irq.h +3 -0
@@ -76,4 +76,7 @@ void tile_irq_activate(unsigned int irq, int tile_irq_type);void setup_irq_regs (void ); +unsigned int irq_alloc_hwirq (int node); +void irq_free_hwirq (unsigned int irq); +#endif /* _ASM_TILE_IRQ_H */
arch/tile/kernel/irq.c +12 -0
@@ -312,4 +312,16 @@ void destroy_irq(unsigned int irq) spin_unlock_irqrestore(&available_irqs_lock, flags); }EXPORT_SYMBOL (destroy_irq); + +unsigned int irq_alloc_hwirq (int node) +{ +int ret =create_irq (); +return ret <0 ?0 : ret; +} + +void irq_free_hwirq (unsigned int irq) +{ +destroy_irq (irq); +} +#endif
PATCH 16/32 tile: usb: Use irq_alloc/free_hwirq
In reply to Thomas GleixnerNo functional change. Just convert to the new interface.
--- drivers/usb/host/ehci-tilegx.c | 8 ++++---- drivers/usb/host/ohci-tilegx.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/usb/host/ehci-tilegx.c +4 -4
@@ -142,8 +142,8 @@ static int ehci_hcd_tilegx_drv_probe(str ehci->hcs_params =readl (&ehci->caps->hcs_params);/* Create our IRQs and register them. */ - pdata->irq =create_irq (); -if (pdata->irq <0 ) { + pdata->irq =irq_alloc_hwirq (-1 ); +if (!pdata->irq) { ret = -ENXIO ; goto err_no_irq; }
@@ -175,7 +175,7 @@ static int ehci_hcd_tilegx_drv_probe(str } err_have_irq: -destroy_irq (pdata->irq); +irq_free_hwirq (pdata->irq); err_no_irq:tilegx_stop_ehc ();usb_put_hcd (hcd);
@@ -193,7 +193,7 @@ static int ehci_hcd_tilegx_drv_remove(stusb_put_hcd (hcd);tilegx_stop_ehc ();gxio_usb_host_destroy (&pdata->usb_ctx); -destroy_irq (pdata->irq); +irq_free_hwirq (pdata->irq);return 0 ; }
drivers/usb/host/ohci-tilegx.c +4 -4
@@ -129,8 +129,8 @@ static int ohci_hcd_tilegx_drv_probe(strtilegx_start_ohc ();/* Create our IRQs and register them. */ - pdata->irq =create_irq (); -if (pdata->irq <0 ) { + pdata->irq =irq_alloc_hwirq (-1 ); +if (!pdata->irq) { ret = -ENXIO ; goto err_no_irq; }
@@ -164,7 +164,7 @@ static int ohci_hcd_tilegx_drv_probe(str } err_have_irq: -destroy_irq (pdata->irq); +irq_free_hwirq (pdata->irq); err_no_irq:tilegx_stop_ohc ();usb_put_hcd (hcd);
@@ -182,7 +182,7 @@ static int ohci_hcd_tilegx_drv_remove(stusb_put_hcd (hcd);tilegx_stop_ohc ();gxio_usb_host_destroy (&pdata->usb_ctx); -destroy_irq (pdata->irq); +irq_free_hwirq (pdata->irq);return 0 ; }
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] tile: usb: Use irq_alloc/free_hwirq
tile: usb: Use irq_alloc/free_hwirq
Commit-ID: 7e5f01b1a1504b2777342628e365c1a0c6600b0e Gitweb: http://git.kernel.org/tip/7e5f01b1a1504b2777342628e365c1a0c6600b0e Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:13 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:20 +0200
tile: usb: Use irq_alloc/free_hwirq
No functional change. Just convert to the new interface.
--- drivers/usb/host/ehci-tilegx.c | 8 ++++---- drivers/usb/host/ohci-tilegx.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/usb/host/ehci-tilegx.c +4 -4
@@ -142,8 +142,8 @@ static int ehci_hcd_tilegx_drv_probe(struct platform_device *pdev) ehci->hcs_params =readl (&ehci->caps->hcs_params);/* Create our IRQs and register them. */ - pdata->irq =create_irq (); -if (pdata->irq <0 ) { + pdata->irq =irq_alloc_hwirq (-1 ); +if (!pdata->irq) { ret = -ENXIO ; goto err_no_irq; }
@@ -175,7 +175,7 @@ static int ehci_hcd_tilegx_drv_probe(struct platform_device *pdev) } err_have_irq: -destroy_irq (pdata->irq); +irq_free_hwirq (pdata->irq); err_no_irq:tilegx_stop_ehc ();usb_put_hcd (hcd);
@@ -193,7 +193,7 @@ static int ehci_hcd_tilegx_drv_remove(struct platform_device *pdev)usb_put_hcd (hcd);tilegx_stop_ehc ();gxio_usb_host_destroy (&pdata->usb_ctx); -destroy_irq (pdata->irq); +irq_free_hwirq (pdata->irq);return 0 ; }
drivers/usb/host/ohci-tilegx.c +4 -4
@@ -129,8 +129,8 @@ static int ohci_hcd_tilegx_drv_probe(struct platform_device *pdev)tilegx_start_ohc ();/* Create our IRQs and register them. */ - pdata->irq =create_irq (); -if (pdata->irq <0 ) { + pdata->irq =irq_alloc_hwirq (-1 ); +if (!pdata->irq) { ret = -ENXIO ; goto err_no_irq; }
@@ -164,7 +164,7 @@ static int ohci_hcd_tilegx_drv_probe(struct platform_device *pdev) } err_have_irq: -destroy_irq (pdata->irq); +irq_free_hwirq (pdata->irq); err_no_irq:tilegx_stop_ohc ();usb_put_hcd (hcd);
@@ -182,7 +182,7 @@ static int ohci_hcd_tilegx_drv_remove(struct platform_device *pdev)usb_put_hcd (hcd);tilegx_stop_ohc ();gxio_usb_host_destroy (&pdata->usb_ctx); -destroy_irq (pdata->irq); +irq_free_hwirq (pdata->irq);return 0 ; }
PATCH 17/32 tile: net: Use irq_alloc/free_hwirq
In reply to Thomas GleixnerNo functional change. Just convert to the new interface.
--- drivers/net/ethernet/tile/tilegx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/tile/tilegx.c +3 -3
@@ -1208,8 +1208,8 @@ static int tile_net_setup_interrupts(str irq = md->ingress_irq;if (irq <0 ) { - irq =create_irq (); -if (irq <0 ) { + irq =irq_alloc_hwirq (-1 ); +if (!irq) {netdev_err (dev,"create_irq failed: mpipe[%d] %d\n" , instance, irq);
@@ -1223,7 +1223,7 @@ static int tile_net_setup_interrupts(strif (rc !=0 ) {netdev_err (dev,"request_irq failed: mpipe[%d] %d\n" , instance, rc); -destroy_irq (irq); +irq_free_hwirq (irq);return rc; } md->ingress_irq = irq;
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] tile: net: Use irq_alloc/free_hwirq
tile: net: Use irq_alloc/free_hwirq
Commit-ID: 094e873c2a0bd54ced4e98f1f6f612b1fc60f426 Gitweb: http://git.kernel.org/tip/094e873c2a0bd54ced4e98f1f6f612b1fc60f426 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:14 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:20 +0200
tile: net: Use irq_alloc/free_hwirq
No functional change. Just convert to the new interface.
--- drivers/net/ethernet/tile/tilegx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/tile/tilegx.c +3 -3
@@ -1208,8 +1208,8 @@ static int tile_net_setup_interrupts(struct net_device *dev) irq = md->ingress_irq;if (irq <0 ) { - irq =create_irq (); -if (irq <0 ) { + irq =irq_alloc_hwirq (-1 ); +if (!irq) {netdev_err (dev,"create_irq failed: mpipe[%d] %d\n" , instance, irq);
@@ -1223,7 +1223,7 @@ static int tile_net_setup_interrupts(struct net_device *dev)if (rc !=0 ) {netdev_err (dev,"request_irq failed: mpipe[%d] %d\n" , instance, rc); -destroy_irq (irq); +irq_free_hwirq (irq);return rc; } md->ingress_irq = irq;
PATCH 18/32 tile: serial: Use irq_alloc/free_hwirq
In reply to Thomas GleixnerNo functional change. Just convert to the new interface.
--- drivers/tty/serial/tilegx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tty/serial/tilegx.c +4 -4
@@ -359,8 +359,8 @@ static int tilegx_startup(struct uart_po }/* Create our IRQs. */ - port->irq =create_irq (); -if (port->irq <0 ) + port->irq =irq_alloc_hwirq (-1 ); +if (!port->irq) goto err_uart_dest;tile_irq_activate (port->irq,TILE_IRQ_PERCPU );
@@ -395,7 +395,7 @@ static int tilegx_startup(struct uart_po err_free_irq:free_irq (port->irq, port); err_dest_irq: -destroy_irq (port->irq); +irq_free_hwirq (port->irq); err_uart_dest:gxio_uart_destroy (context); ret = -ENXIO ;
@@ -435,7 +435,7 @@ static void tilegx_shutdown(struct uart_if (port->irq >0 ) {free_irq (port->irq, port); -destroy_irq (port->irq); +irq_free_hwirq (port->irq); port->irq =0 ; }
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] tile: serial: Use irq_alloc/free_hwirq
tile: serial: Use irq_alloc/free_hwirq
Commit-ID: 651fb13943304be2008b43adf813fa62435423d7 Gitweb: http://git.kernel.org/tip/651fb13943304be2008b43adf813fa62435423d7 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:15 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:20 +0200
tile: serial: Use irq_alloc/free_hwirq
No functional change. Just convert to the new interface.
--- drivers/tty/serial/tilegx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tty/serial/tilegx.c +4 -4
@@ -359,8 +359,8 @@ static int tilegx_startup(struct uart_port *port) }/* Create our IRQs. */ - port->irq =create_irq (); -if (port->irq <0 ) + port->irq =irq_alloc_hwirq (-1 ); +if (!port->irq) goto err_uart_dest;tile_irq_activate (port->irq,TILE_IRQ_PERCPU );
@@ -395,7 +395,7 @@ static int tilegx_startup(struct uart_port *port) err_free_irq:free_irq (port->irq, port); err_dest_irq: -destroy_irq (port->irq); +irq_free_hwirq (port->irq); err_uart_dest:gxio_uart_destroy (context); ret = -ENXIO ;
@@ -435,7 +435,7 @@ static void tilegx_shutdown(struct uart_port *port)if (port->irq >0 ) {free_irq (port->irq, port); -destroy_irq (port->irq); +irq_free_hwirq (port->irq); port->irq =0 ; }
PATCH 19/32 tile: hvc: Use irq_alloc/free_hwirq
In reply to Thomas GleixnerNo functional change. Just convert to the new interface.
--- drivers/tty/hvc/hvc_tile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tty/hvc/hvc_tile.c +4 -4
@@ -133,14 +133,14 @@ static int hvc_tile_probe(struct platforint tile_hvc_irq;/* Create our IRQ and register it. */ - tile_hvc_irq =create_irq (); -if (tile_hvc_irq <0 ) + tile_hvc_irq =irq_alloc_hwirq (-1 ); +if (!tile_hvc_irq)return -ENXIO ;tile_irq_activate (tile_hvc_irq,TILE_IRQ_PERCPU ); hp =hvc_alloc (0 , tile_hvc_irq, &hvc_tile_get_put_ops,128 );if (IS_ERR (hp)) { -destroy_irq (tile_hvc_irq); +irq_free_hwirq (tile_hvc_irq);return PTR_ERR (hp); }dev_set_drvdata (&pdev->dev, hp);
@@ -155,7 +155,7 @@ static int hvc_tile_remove(struct platfo rc =hvc_remove (hp);if (rc ==0 ) -destroy_irq (hp->data); +irq_free_hwirq (hp->data);return rc; }
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] tile: hvc: Use irq_alloc/free_hwirq
tile: hvc: Use irq_alloc/free_hwirq
Commit-ID: 3dfd442e5ffc6c488e34b6f1028bbb0ce310e6c4 Gitweb: http://git.kernel.org/tip/3dfd442e5ffc6c488e34b6f1028bbb0ce310e6c4 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:15 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:20 +0200
tile: hvc: Use irq_alloc/free_hwirq
No functional change. Just convert to the new interface.
--- drivers/tty/hvc/hvc_tile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tty/hvc/hvc_tile.c +4 -4
@@ -133,14 +133,14 @@ static int hvc_tile_probe(struct platform_device *pdev)int tile_hvc_irq;/* Create our IRQ and register it. */ - tile_hvc_irq =create_irq (); -if (tile_hvc_irq <0 ) + tile_hvc_irq =irq_alloc_hwirq (-1 ); +if (!tile_hvc_irq)return -ENXIO ;tile_irq_activate (tile_hvc_irq,TILE_IRQ_PERCPU ); hp =hvc_alloc (0 , tile_hvc_irq, &hvc_tile_get_put_ops,128 );if (IS_ERR (hp)) { -destroy_irq (tile_hvc_irq); +irq_free_hwirq (tile_hvc_irq);return PTR_ERR (hp); }dev_set_drvdata (&pdev->dev, hp);
@@ -155,7 +155,7 @@ static int hvc_tile_remove(struct platform_device *pdev) rc =hvc_remove (hp);if (rc ==0 ) -destroy_irq (hp->data); +irq_free_hwirq (hp->data);return rc; }
PATCH 20/32 tile: pci: Use irq_alloc/free_hwirq()
In reply to Thomas GleixnerNo functional change. Just convert to the new interface.
--- arch/tile/kernel/pci_gx.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
arch/tile/kernel/pci_gx.c +8 -9
@@ -350,10 +350,9 @@ static int tile_init_irqs(struct pci_conint cpu;/* Ask the kernel to allocate an IRQ. */ - irq =create_irq (); -if (irq <0 ) { + irq =irq_alloc_hwirq (-1 ); +if (!irq) {pr_err ("PCI: no free irq vectors, failed for %d\n" , i); - goto free_irqs; } controller->irq_intx_table[i] = irq;
@@ -382,7 +381,7 @@ static int tile_init_irqs(struct pci_con free_irqs:for (j =0 ; j < i; j++) -destroy_irq (controller->irq_intx_table[j]); +irq_free_hwirq (controller->irq_intx_table[j]);return -1 ; }
@@ -1500,9 +1499,9 @@ int arch_setup_msi_irq(struct pci_dev *pint irq;int ret; - irq =create_irq (); -if (irq <0 ) -return irq; + irq =irq_alloc_hwirq (-1 ); +if (!irq) +return -ENOSPC ;/* * Since we use a 64-bit Mem-Map to accept the MSI write, we fail
@@ -1601,11 +1600,11 @@ hv_msi_config_failure:/* Free mem-map */ msi_mem_map_alloc_failure: is_64_failure: -destroy_irq (irq); +irq_free_hwirq (irq);return ret; }void arch_teardown_msi_irq (unsigned int irq) { -destroy_irq (irq); +irq_free_hwirq (irq); }
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] tile: pci: Use irq_alloc/free_hwirq()
tile: pci: Use irq_alloc/free_hwirq()
Commit-ID: 2aa799d891299457e4107d33f07a1ed5ac8849ae Gitweb: http://git.kernel.org/tip/2aa799d891299457e4107d33f07a1ed5ac8849ae Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:16 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:21 +0200
tile: pci: Use irq_alloc/free_hwirq()
No functional change. Just convert to the new interface.
--- arch/tile/kernel/pci_gx.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
arch/tile/kernel/pci_gx.c +8 -9
@@ -350,10 +350,9 @@ static int tile_init_irqs(struct pci_controller *controller)int cpu;/* Ask the kernel to allocate an IRQ. */ - irq =create_irq (); -if (irq <0 ) { + irq =irq_alloc_hwirq (-1 ); +if (!irq) {pr_err ("PCI: no free irq vectors, failed for %d\n" , i); - goto free_irqs; } controller->irq_intx_table[i] = irq;
@@ -382,7 +381,7 @@ static int tile_init_irqs(struct pci_controller *controller) free_irqs:for (j =0 ; j < i; j++) -destroy_irq (controller->irq_intx_table[j]); +irq_free_hwirq (controller->irq_intx_table[j]);return -1 ; }
@@ -1500,9 +1499,9 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)int irq;int ret; - irq =create_irq (); -if (irq <0 ) -return irq; + irq =irq_alloc_hwirq (-1 ); +if (!irq) +return -ENOSPC ;/* * Since we use a 64-bit Mem-Map to accept the MSI write, we fail
@@ -1601,11 +1600,11 @@ hv_msi_config_failure:/* Free mem-map */ msi_mem_map_alloc_failure: is_64_failure: -destroy_irq (irq); +irq_free_hwirq (irq);return ret; }void arch_teardown_msi_irq (unsigned int irq) { -destroy_irq (irq); +irq_free_hwirq (irq); }
PATCH 21/32 tile: Use SPARSE_IRQ
In reply to Thomas GleixnerGet rid of the private allocator and switch over to sparse IRQs.
--- arch/tile/Kconfig | 2 + arch/tile/include/asm/irq.h | 9 +++---- arch/tile/kernel/irq.c | 52 ++------------------------------------------ 3 files changed, 9 insertions(+), 54 deletions(-)
arch/tile/Kconfig +2 -0
@@ -125,6 +125,8 @@ config HVC_TILE config TILEGX bool "Building for TILE-Gx (64-bit) processor" + select SPARSE_IRQ + select GENERIC_IRQ_LEGACY_ALLOC_HWIRQ select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_TRACE_MCOUNT_TEST select HAVE_FUNCTION_GRAPH_TRACER
arch/tile/include/asm/irq.h +4 -5
@@ -18,10 +18,12 @@#include <linux/hardirq.h> /* The hypervisor interface provides 32 IRQs. */ -#define NR_IRQS 32 +#define NR_IRQS 32/* IRQ numbers used for linux IPIs. */ -#define IRQ_RESCHEDULE 0 +#define IRQ_RESCHEDULE 0 +/* Interrupts for dynamic allocation start at 1. Let the core allocate irq0 */ +#define NR_IRQS_LEGACY 1#define irq_canonicalize (irq) (irq)
@@ -76,7 +78,4 @@ void tile_irq_activate(unsigned int irq,void setup_irq_regs (void ); -unsigned int irq_alloc_hwirq (int node); -void irq_free_hwirq (unsigned int irq); -#endif /* _ASM_TILE_IRQ_H */
arch/tile/kernel/irq.c +3 -49
66 lines not on this page · raw message
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] tile: Use SPARSE_IRQ
tile: Use SPARSE_IRQ
Commit-ID: b26d851ff1928b56242c4c5e16cb62bac2d9526c Gitweb: http://git.kernel.org/tip/b26d851ff1928b56242c4c5e16cb62bac2d9526c Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:16 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:21 +0200
tile: Use SPARSE_IRQ
Get rid of the private allocator and switch over to sparse IRQs.
--- arch/tile/Kconfig | 2 ++ arch/tile/include/asm/irq.h | 9 ++++---- arch/tile/kernel/irq.c | 52 +++------------------------------------------ 3 files changed, 9 insertions(+), 54 deletions(-)
arch/tile/Kconfig +2 -0
@@ -125,6 +125,8 @@ config HVC_TILE config TILEGX bool "Building for TILE-Gx (64-bit) processor" + select SPARSE_IRQ + select GENERIC_IRQ_LEGACY_ALLOC_HWIRQ select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_TRACE_MCOUNT_TEST select HAVE_FUNCTION_GRAPH_TRACER
arch/tile/include/asm/irq.h +4 -5
@@ -18,10 +18,12 @@#include <linux/hardirq.h> /* The hypervisor interface provides 32 IRQs. */ -#define NR_IRQS 32 +#define NR_IRQS 32/* IRQ numbers used for linux IPIs. */ -#define IRQ_RESCHEDULE 0 +#define IRQ_RESCHEDULE 0 +/* Interrupts for dynamic allocation start at 1. Let the core allocate irq0 */ +#define NR_IRQS_LEGACY 1#define irq_canonicalize (irq) (irq)
@@ -76,7 +78,4 @@ void tile_irq_activate(unsigned int irq, int tile_irq_type);void setup_irq_regs (void ); -unsigned int irq_alloc_hwirq (int node); -void irq_free_hwirq (unsigned int irq); -#endif /* _ASM_TILE_IRQ_H */
arch/tile/kernel/irq.c +3 -49
66 lines not on this page · raw message
PATCH 22/32 genirq: Make create/destroy_irq() ia64 private
In reply to Thomas GleixnerNo more users outside of itanic. Confine it.
--- arch/ia64/include/asm/irq.h | 3 +++ include/linux/irq.h | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-)
arch/ia64/include/asm/irq.h +3 -0
@@ -31,4 +31,7 @@ bool is_affinity_mask_valid(const struct#define is_affinity_mask_valid is_affinity_mask_valid +int create_irq (void ); +void destroy_irq (unsigned int irq); +#endif /* _ASM_IA64_IRQ_H */
include/linux/irq.h +0 -4
@@ -525,10 +525,6 @@ static inline void irq_set_percpu_devid_ IRQ_NOPROBE | IRQ_PER_CPU_DEVID); } -/* Handle dynamic irq creation and destruction */ -extern int create_irq (void ); -extern void destroy_irq (unsigned int irq); -/* * Dynamic irq helper functions. Obsolete. Use irq_alloc_desc* and * irq_free_desc instead.
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] genirq: Make create/destroy_irq() ia64 private
genirq: Make create/destroy_irq() ia64 private
Commit-ID: e8784e4f9a578344023ae4e08a509b7c5eab5eb0 Gitweb: http://git.kernel.org/tip/e8784e4f9a578344023ae4e08a509b7c5eab5eb0 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:17 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:21 +0200
genirq: Make create/destroy_irq() ia64 private
No more users outside of itanic. Confine it.
--- arch/ia64/include/asm/irq.h | 3 +++ include/linux/irq.h | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-)
arch/ia64/include/asm/irq.h +3 -0
@@ -31,4 +31,7 @@ bool is_affinity_mask_valid(const struct cpumask *cpumask);#define is_affinity_mask_valid is_affinity_mask_valid +int create_irq (void ); +void destroy_irq (unsigned int irq); +#endif /* _ASM_IA64_IRQ_H */
include/linux/irq.h +0 -4
@@ -525,10 +525,6 @@ static inline void irq_set_percpu_devid_flags(unsigned int irq) IRQ_NOPROBE | IRQ_PER_CPU_DEVID); } -/* Handle dynamic irq creation and destruction */ -extern int create_irq (void ); -extern void destroy_irq (unsigned int irq); -/* * Dynamic irq helper functions. Obsolete. Use irq_alloc_desc* and * irq_free_desc instead.
PATCH 23/32 x86, irq: Remove pointless irq_reserve_irqs() call
In reply to Thomas GleixnerThat's a leftover from the time where x86 supported SPARSE_IRQ=n.
--- arch/x86/kernel/apic/io_apic.c | 3 --- 1 file changed, 3 deletions(-)
arch/x86/kernel/apic/io_apic.c +0 -3
@@ -206,9 +206,6 @@ int __init arch_early_irq_init(void) count =ARRAY_SIZE (irq_cfgx); node =cpu_to_node (0 ); -/* Make sure the legacy interrupts are marked in the bitmap */ -irq_reserve_irqs (0 , legacy_pic->nr_legacy_irqs); -for (i =0 ; i < count; i++) {irq_set_chip_data (i, &cfg[i]);zalloc_cpumask_var_node (&cfg[i].domain,GFP_KERNEL , node);
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] x86, irq: Remove pointless irq_reserve_irqs() call
x86, irq: Remove pointless irq_reserve_irqs() call
Commit-ID: 18a67d32c31b88679467e93e1825010d245b9bf4 Gitweb: http://git.kernel.org/tip/18a67d32c31b88679467e93e1825010d245b9bf4 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:18 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:21 +0200
x86, irq: Remove pointless irq_reserve_irqs() call
That's a leftover from the time where x86 supported SPARSE_IRQ=n.
--- arch/x86/kernel/apic/io_apic.c | 3 --- 1 file changed, 3 deletions(-)
arch/x86/kernel/apic/io_apic.c +0 -3
@@ -206,9 +206,6 @@ int __init arch_early_irq_init(void) count =ARRAY_SIZE (irq_cfgx); node =cpu_to_node (0 ); -/* Make sure the legacy interrupts are marked in the bitmap */ -irq_reserve_irqs (0 , legacy_pic->nr_legacy_irqs); -for (i =0 ; i < count; i++) {irq_set_chip_data (i, &cfg[i]);zalloc_cpumask_var_node (&cfg[i].domain,GFP_KERNEL , node);
PATCH 24/32 sh: intc: Remove pointless irq_reserve_irqs() invocation
In reply to Thomas GleixnerThe preceding call to irq_create_identity_mapping() marks the interrupt as allocated already. Remove the leftover.
--- drivers/sh/intc/core.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/sh/intc/core.c +0 -6
@@ -80,12 +80,6 @@ static void __init intc_register_irq(strunsigned int data[2 ], primary;unsigned long flags; -/* -* Register the IRQ position with the global IRQ map, then insert -* it in to the radix tree. -*/ -irq_reserve_irq (irq); -raw_spin_lock_irqsave (&intc_big_lock, flags);radix_tree_insert (&d->tree, enum_id,intc_irq_xlate_get (irq));raw_spin_unlock_irqrestore (&intc_big_lock, flags);
Re: [patch 24/32] sh: intc: Remove pointless irq_reserve_irqs() invocation
Quoted 6 lines · Thomas Gleixner
The preceding call to
irq_create_identity_mapping()marks the interrupt as allocated already. Remove the leftover.Signed-off-by Thomas Gleixner <[email protected]>Cc Simon Horman <[email protected]>
This duplicates a similar patch, "[PATCH v3 2/8] sh, irq: Remove irq_reserve_irq calling", by Yinghai Lu. But perhaps you already know that.
Regardless, I am fine with the contents.
Quoted 23 lines
--- drivers/sh/intc/core.c | 6 ------ 1 file changed, 6 deletions(-)Index:
tip/drivers/sh/intc/core.c
===================================================================drivers/sh/intc/core.c +0
-6@@ -80,12 +80,6 @@ static void __init intc_register_irq(strunsigned int data[2 ], primary;unsigned long flags; -/* -* Register the IRQ position with the global IRQ map, then insert -* it in to the radix tree. -*/ -irq_reserve_irq (irq); -raw_spin_lock_irqsave (&intc_big_lock, flags);radix_tree_insert (&d->tree, enum_id,intc_irq_xlate_get (irq));raw_spin_unlock_irqrestore (&intc_big_lock, flags);
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] sh: intc: Remove pointless irq_reserve_irqs() invocation
In reply to Thomas Gleixnersh: intc: Remove pointless irq_reserve_irqs() invocation
Commit-ID: 3670802223e164f1089287d1c223d34d3c5dc3da Gitweb: http://git.kernel.org/tip/3670802223e164f1089287d1c223d34d3c5dc3da Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:18 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:21 +0200
sh: intc: Remove pointless irq_reserve_irqs() invocation
The preceding call to irq_create_identity_mapping() marks the interrupt as allocated already. Remove the leftover.
--- drivers/sh/intc/core.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/sh/intc/core.c +0 -6
@@ -80,12 +80,6 @@ static void __init intc_register_irq(struct intc_desc *desc,unsigned int data[2 ], primary;unsigned long flags; -/* -* Register the IRQ position with the global IRQ map, then insert -* it in to the radix tree. -*/ -irq_reserve_irq (irq); -raw_spin_lock_irqsave (&intc_big_lock, flags);radix_tree_insert (&d->tree, enum_id,intc_irq_xlate_get (irq));raw_spin_unlock_irqrestore (&intc_big_lock, flags);
PATCH 25/32 s390: pci: Check return value of alloc_irq_desc() proper
In reply to Thomas Gleixneralloc_irq_desc() returns an integer and as documented either a valid irq number or a negative error code. Checking for NO_IRQ is definitely not the proper error handling.
--- arch/s390/pci/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/s390/pci/pci.c +3 -3
@@ -401,11 +401,11 @@ static void zpci_irq_handler(struct airqint arch_setup_msi_irqs (struct pci_dev *pdev,int nvec,int type) {struct zpci_dev *zdev =get_zdev (pdev); -unsigned int hwirq, irq, msi_vecs; +unsigned int hwirq, msi_vecs;unsigned long aisb;struct msi_desc *msi;struct msi_msg msg; -int rc; +int rc, irq;if (type ==PCI_CAP_ID_MSI && nvec >1 )return 1 ;
@@ -433,7 +433,7 @@ int arch_setup_msi_irqs(struct pci_dev *list_for_each_entry (msi, &pdev->msi_list, list) { rc = -EIO ; irq =irq_alloc_desc (0 );/* Alloc irq on node 0 */ -if (irq ==NO_IRQ ) +if (irq <0 ) goto out_msi; rc =irq_set_msi_desc (irq, msi);if (rc)
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] s390: pci: Check return value of alloc_irq_desc() proper
s390: pci: Check return value of alloc_irq_desc() proper
Commit-ID: 0a0a94219074d79370b1cd1b533ead63d51c3730 Gitweb: http://git.kernel.org/tip/0a0a94219074d79370b1cd1b533ead63d51c3730 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:19 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:21 +0200
s390: pci: Check return value of alloc_irq_desc() proper
alloc_irq_desc() returns an integer and as documented either a valid irq number or a negative error code. Checking for NO_IRQ is definitely not the proper error handling.
--- arch/s390/pci/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/s390/pci/pci.c +3 -3
@@ -401,11 +401,11 @@ static void zpci_irq_handler(struct airq_struct *airq)int arch_setup_msi_irqs (struct pci_dev *pdev,int nvec,int type) {struct zpci_dev *zdev =get_zdev (pdev); -unsigned int hwirq, irq, msi_vecs; +unsigned int hwirq, msi_vecs;unsigned long aisb;struct msi_desc *msi;struct msi_msg msg; -int rc; +int rc, irq;if (type ==PCI_CAP_ID_MSI && nvec >1 )return 1 ;
@@ -433,7 +433,7 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)list_for_each_entry (msi, &pdev->msi_list, list) { rc = -EIO ; irq =irq_alloc_desc (0 );/* Alloc irq on node 0 */ -if (irq ==NO_IRQ ) +if (irq <0 ) goto out_msi; rc =irq_set_msi_desc (irq, msi);if (rc)
PATCH 26/32 s390: Remove pointless arch_show_interrupts()
In reply to Thomas GleixnerS390 is not using the generic show interrupts implementation so the extra arch_show_interrupts() is just useless.
--- arch/s390/kernel/irq.c | 5 ----- 1 file changed, 5 deletions(-)
arch/s390/kernel/irq.c +0 -5
@@ -151,11 +151,6 @@ out:return 0 ; } -int arch_show_interrupts (struct seq_file *p,int prec) -{ -return 0 ; -} -/* * Switch to the asynchronous interrupt stack for softirq execution. */
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] s390: Remove pointless arch_show_interrupts()
s390: Remove pointless arch_show_interrupts()
Commit-ID: 5fdaf1bf8a60f73a11cb4431fd06daa2b295a327 Gitweb: http://git.kernel.org/tip/5fdaf1bf8a60f73a11cb4431fd06daa2b295a327 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:19 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:22 +0200
s390: Remove pointless arch_show_interrupts()
S390 is not using the generic show interrupts implementation so the extra arch_show_interrupts() is just useless.
--- arch/s390/kernel/irq.c | 5 ----- 1 file changed, 5 deletions(-)
arch/s390/kernel/irq.c +0 -5
@@ -151,11 +151,6 @@ out:return 0 ; } -int arch_show_interrupts (struct seq_file *p,int prec) -{ -return 0 ; -} -/* * Switch to the asynchronous interrupt stack for softirq execution. */
PATCH 27/32 s390: Avoid call to irq_reserve_irqs()
In reply to Thomas GleixnerThere is no need to mark the lower interrupts as reserved in order to exclude them from dynamic allocation.
Provide arch_dynirq_lower_bound() to exclude the lower space.
--- arch/s390/kernel/irq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/s390/kernel/irq.c +5 -1
@@ -92,7 +92,6 @@ static const struct irq_class irqclass_svoid __init init_IRQ (void ) { -irq_reserve_irqs (0 ,THIN_INTERRUPT );init_cio_interrupts ();init_airq_interrupts ();init_ext_interrupts ();
@@ -151,6 +150,11 @@ out:return 0 ; } +unsigned int arch_dynirq_lower_bound (unsigned int from) +{ +return from <THIN_INTERRUPT ?THIN_INTERRUPT : from; +} +/* * Switch to the asynchronous interrupt stack for softirq execution. */
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] s390: Avoid call to irq_reserve_irqs()
s390: Avoid call to irq_reserve_irqs()
Commit-ID: be4034016c11f8913d38fccf692007fab1c50be1 Gitweb: http://git.kernel.org/tip/be4034016c11f8913d38fccf692007fab1c50be1 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:20 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:22 +0200
s390: Avoid call to irq_reserve_irqs()
There is no need to mark the lower interrupts as reserved in order to exclude them from dynamic allocation.
Provide arch_dynirq_lower_bound() to exclude the lower space.
--- arch/s390/kernel/irq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/s390/kernel/irq.c +5 -1
@@ -92,7 +92,6 @@ static const struct irq_class irqclass_sub_desc[NR_ARCH_IRQS] = {void __init init_IRQ (void ) { -irq_reserve_irqs (0 ,THIN_INTERRUPT );init_cio_interrupts ();init_airq_interrupts ();init_ext_interrupts ();
@@ -151,6 +150,11 @@ out:return 0 ; } +unsigned int arch_dynirq_lower_bound (unsigned int from) +{ +return from <THIN_INTERRUPT ?THIN_INTERRUPT : from; +} +/* * Switch to the asynchronous interrupt stack for softirq execution. */
PATCH 28/32 genirq: Replace reserve_irqs in core code
In reply to Thomas GleixnerWe want to get rid of the public interface.
--- kernel/irq/chip.c | 5 ++--- kernel/irq/internals.h | 6 ++++++ kernel/irq/irqdesc.c | 7 +++++++ 3 files changed, 15 insertions(+), 3 deletions(-)
kernel/irq/chip.c +2 -3
@@ -40,10 +40,9 @@ int irq_set_chip(unsigned int irq, strucirq_put_desc_unlock (desc, flags);/* * For !CONFIG_SPARSE_IRQ make the irq show up in -* allocated_irqs. For the CONFIG_SPARSE_IRQ case, it is -* already marked, and this call is harmless. +* allocated_irqs. */ -irq_reserve_irq (irq); +irq_mark_irq (irq);return 0 ; }EXPORT_SYMBOL (irq_set_chip);
kernel/irq/internals.h +6 -0
@@ -76,6 +76,12 @@ extern void mask_irq(struct irq_desc *deextern void unmask_irq (struct irq_desc *desc);extern void unmask_threaded_irq (struct irq_desc *desc); +#ifdef CONFIG_SPARSE_IRQ +static inline void irq_mark_irq (unsigned int irq) { } +#else +extern void irq_mark_irq (unsigned int irq); +#endif +extern void init_kstat_irqs (struct irq_desc *desc,int node,int nr);irqreturn_t handle_irq_event_percpu (struct irq_desc *desc,struct irqaction *action);
kernel/irq/irqdesc.c +7 -0
@@ -299,6 +299,13 @@ static int irq_expand_nr_irqs(unsigned i return -ENOMEM; } +void irq_mark_irq (unsigned int irq) +{ +mutex_lock (&sparse_irq_lock); +bitmap_set (allocated_irqs, irq,1 ); +mutex_unlock (&sparse_irq_lock); +} +#endif /* !CONFIG_SPARSE_IRQ */ /**
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] genirq: Replace reserve_irqs in core code
genirq: Replace reserve_irqs in core code
Commit-ID: f63b6a05f2b11537612266a8b27a61f412344a1d Gitweb: http://git.kernel.org/tip/f63b6a05f2b11537612266a8b27a61f412344a1d Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:21 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:22 +0200
genirq: Replace reserve_irqs in core code
We want to get rid of the public interface.
--- kernel/irq/chip.c | 5 ++--- kernel/irq/internals.h | 6 ++++++ kernel/irq/irqdesc.c | 7 +++++++ 3 files changed, 15 insertions(+), 3 deletions(-)
kernel/irq/chip.c +2 -3
@@ -40,10 +40,9 @@ int irq_set_chip(unsigned int irq, struct irq_chip *chip)irq_put_desc_unlock (desc, flags);/* * For !CONFIG_SPARSE_IRQ make the irq show up in -* allocated_irqs. For the CONFIG_SPARSE_IRQ case, it is -* already marked, and this call is harmless. +* allocated_irqs. */ -irq_reserve_irq (irq); +irq_mark_irq (irq);return 0 ; }EXPORT_SYMBOL (irq_set_chip);
kernel/irq/internals.h +6 -0
@@ -76,6 +76,12 @@ extern void mask_irq(struct irq_desc *desc);extern void unmask_irq (struct irq_desc *desc);extern void unmask_threaded_irq (struct irq_desc *desc); +#ifdef CONFIG_SPARSE_IRQ +static inline void irq_mark_irq (unsigned int irq) { } +#else +extern void irq_mark_irq (unsigned int irq); +#endif +extern void init_kstat_irqs (struct irq_desc *desc,int node,int nr);irqreturn_t handle_irq_event_percpu (struct irq_desc *desc,struct irqaction *action);
kernel/irq/irqdesc.c +7 -0
@@ -299,6 +299,13 @@ static int irq_expand_nr_irqs(unsigned int nr) return -ENOMEM; } +void irq_mark_irq (unsigned int irq) +{ +mutex_lock (&sparse_irq_lock); +bitmap_set (allocated_irqs, irq,1 ); +mutex_unlock (&sparse_irq_lock); +} +#endif /* !CONFIG_SPARSE_IRQ */ /**
PATCH 29/32 genirq: Remove irq_reserve_irq[s]
In reply to Thomas GleixnerNo more users. And it's not going to come back. If you need hotplugable irq chips, use irq domains.
--- include/linux/irq.h | 7 ------- kernel/irq/irqdesc.c | 25 ------------------------- 2 files changed, 32 deletions(-)
include/linux/irq.h +0 -7
@@ -617,18 +617,11 @@ int __irq_alloc_descs(int irq, unsigned irq_alloc_descs(-1, from, cnt, node)void irq_free_descs (unsigned int irq,unsigned int cnt); -int irq_reserve_irqs (unsigned int from,unsigned int cnt); -static inline void irq_free_desc (unsigned int irq) {irq_free_descs (irq,1 ); } -static inline int irq_reserve_irq (unsigned int irq) -{ -return irq_reserve_irqs (irq,1 ); -} -#ifdef CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ unsigned int irq_alloc_hwirqs (int cnt,int node);static inline unsigned int irq_alloc_hwirq (int node)
kernel/irq/irqdesc.c +0 -25
@@ -455,31 +455,6 @@ EXPORT_SYMBOL_GPL(irq_free_hwirqs);#endif /** -* irq_reserve_irqs - mark irqs allocated -* @from: mark from irq number -* @cnt: number of irqs to mark -* -* Returns 0 on success or an appropriate error code -*/ -int irq_reserve_irqs (unsigned int from,unsigned int cnt) -{ -unsigned int start; -int ret =0 ; - -if (!cnt || (from + cnt) > nr_irqs) -return -EINVAL ; - -mutex_lock (&sparse_irq_lock); - start =bitmap_find_next_zero_area (allocated_irqs, nr_irqs, from, cnt,0 ); -if (start == from) -bitmap_set (allocated_irqs, start, cnt); -else - ret = -EEXIST ; -mutex_unlock (&sparse_irq_lock); -return ret; -} - -/** * irq_get_next_irq - get next allocated irq number * @offset: where to start the search *
Re: [patch 29/32] genirq: Remove irq_reserve_irq[s]
Quoted 4 lines · Thomas Gleixner
No more users. And it's not going to come back. If you need hotplugable irq chips, use irq domains.
Signed-off-by Thomas Gleixner <[email protected]>
The ironic thing is that irq_domain may end up bringing this function back in some form as an optimization for irq_domains that need a contiguous range, but don't want to allocate all the irq_descs immediately. But if that happens it will be a very private API and it doesn't nullify removing the function now.
g.
Quoted 71 lines
--- include/linux/irq.h | 7 ------- kernel/irq/irqdesc.c | 25 ------------------------- 2 files changed, 32 deletions(-)Index:
tip/include/linux/irq.h
===================================================================include/linux/irq.h +0
-7@@ -617,18 +617,11 @@ int __irq_alloc_descs(int irq, unsigned irq_alloc_descs(-1, from, cnt, node)void irq_free_descs (unsigned int irq,unsigned int cnt); -int irq_reserve_irqs (unsigned int from,unsigned int cnt); -static inline void irq_free_desc (unsigned int irq) {irq_free_descs (irq,1 ); } -static inline int irq_reserve_irq (unsigned int irq) -{ -return irq_reserve_irqs (irq,1 ); -} -#ifdef CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ unsigned int irq_alloc_hwirqs (int cnt,int node);static inline unsigned int irq_alloc_hwirq (int node)Index:
tip/kernel/irq/irqdesc.c
===================================================================kernel/irq/irqdesc.c +0
-26@@ -455,31 +455,6 @@ EXPORT_SYMBOL_GPL(irq_free_hwirqs);#endif /** -* irq_reserve_irqs - mark irqs allocated -* @from: mark from irq number -* @cnt: number of irqs to mark -* -* Returns 0 on success or an appropriate error code -*/ -int irq_reserve_irqs (unsigned int from,unsigned int cnt) -{ -unsigned int start; -int ret =0 ; - -if (!cnt || (from + cnt) > nr_irqs) -return -EINVAL ; - -mutex_lock (&sparse_irq_lock); - start =bitmap_find_next_zero_area (allocated_irqs, nr_irqs, from, cnt,0 ); -if (start == from) -bitmap_set (allocated_irqs, start, cnt); -else - ret = -EEXIST ; -mutex_unlock (&sparse_irq_lock); -return ret; -} - -/** * irq_get_next_irq - get next allocated irq number * @offset: where to start the search * -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 29/32] genirq: Remove irq_reserve_irq[s]
Quoted 6 lines · Grant Likely
Quoted 4 lines · Thomas Gleixner
No more users. And it's not going to come back. If you need hotplugable irq chips, use irq domains.
Signed-off-by Thomas Gleixner <[email protected]>
Quoted 7 lines
Acked-by Grant Likely <[email protected]>The ironic thing is that
irq_domainmay end up bringing this function back in some form as an optimization forirq_domainsthat need a contiguous range, but don't want to allocate all theirq_descsimmediately. But if that happens it will be a very private API and it doesn't nullify removing the function now.
Right. We can deal with it when the need arises, but that's a completely core internal issue then which is not going to be usable outside of kernel/irq.
Thanks,
tglx
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] genirq: Remove irq_reserve_irq[s]
In reply to Thomas Gleixnergenirq: Remove irq_reserve_irq[s]
Commit-ID: 1d008353ba088fdec0b2a944e140ff9154a5fb20 Gitweb: http://git.kernel.org/tip/1d008353ba088fdec0b2a944e140ff9154a5fb20 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:21 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:22 +0200
genirq: Remove irq_reserve_irq[s]
No more users. And it's not going to come back. If you need hotplugable irq chips, use irq domains.
--- include/linux/irq.h | 7 ------- kernel/irq/irqdesc.c | 25 ------------------------- 2 files changed, 32 deletions(-)
include/linux/irq.h +0 -7
@@ -617,18 +617,11 @@ int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, irq_alloc_descs(-1, from, cnt, node)void irq_free_descs (unsigned int irq,unsigned int cnt); -int irq_reserve_irqs (unsigned int from,unsigned int cnt); -static inline void irq_free_desc (unsigned int irq) {irq_free_descs (irq,1 ); } -static inline int irq_reserve_irq (unsigned int irq) -{ -return irq_reserve_irqs (irq,1 ); -} -#ifdef CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ unsigned int irq_alloc_hwirqs (int cnt,int node);static inline unsigned int irq_alloc_hwirq (int node)
kernel/irq/irqdesc.c +0 -25
@@ -455,31 +455,6 @@ EXPORT_SYMBOL_GPL(irq_free_hwirqs);#endif /** -* irq_reserve_irqs - mark irqs allocated -* @from: mark from irq number -* @cnt: number of irqs to mark -* -* Returns 0 on success or an appropriate error code -*/ -int irq_reserve_irqs (unsigned int from,unsigned int cnt) -{ -unsigned int start; -int ret =0 ; - -if (!cnt || (from + cnt) > nr_irqs) -return -EINVAL ; - -mutex_lock (&sparse_irq_lock); - start =bitmap_find_next_zero_area (allocated_irqs, nr_irqs, from, cnt,0 ); -if (start == from) -bitmap_set (allocated_irqs, start, cnt); -else - ret = -EEXIST ; -mutex_unlock (&sparse_irq_lock); -return ret; -} - -/** * irq_get_next_irq - get next allocated irq number * @offset: where to start the search *
PATCH 30/32 genirq: Replace dynamic_irq_init/cleanup
In reply to Thomas GleixnerCreate a new interface and confine it with a config switch which makes clear that this is just legacy support and not to be used for new code.
--- include/linux/irq.h | 4 ++++ kernel/irq/Kconfig | 4 ++++ kernel/irq/irqdesc.c | 7 +++++++ 3 files changed, 15 insertions(+)
include/linux/irq.h +4 -0
@@ -637,6 +637,10 @@ int arch_setup_hwirq(unsigned int irq, ivoid arch_teardown_hwirq (unsigned int irq);#endif +#ifdef CONFIG_GENERIC_IRQ_LEGACY +void irq_init_desc (unsigned int irq); +#endif +#ifndef irq_reg_writel# define irq_reg_writel (val, addr) writel(val, addr)#endif
kernel/irq/Kconfig +4 -0
@@ -5,6 +5,10 @@ menu "IRQ subsystem" config MAY_HAVE_SPARSE_IRQ bool +# Legacy support, required for itanic +config GENERIC_IRQ_LEGACY + bool + # Enable the generic irq autoprobe mechanism config GENERIC_IRQ_PROBE bool
kernel/irq/irqdesc.c +7 -0
@@ -306,6 +306,13 @@ void irq_mark_irq(unsigned int irq) mutex_unlock(&sparse_irq_lock); } +#ifdef CONFIG_GENERIC_IRQ_LEGACY +void irq_init_desc (unsigned int irq) +{ +dynamic_irq_cleanup (irq); +} +#endif +#endif /* !CONFIG_SPARSE_IRQ */ /**
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] genirq: Replace dynamic_irq_init/cleanup
genirq: Replace dynamic_irq_init/cleanup
Commit-ID: c940e01c94e73a2a5318f1b82038e0746aaec753 Gitweb: http://git.kernel.org/tip/c940e01c94e73a2a5318f1b82038e0746aaec753 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:22 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:22 +0200
genirq: Replace dynamic_irq_init/cleanup
Create a new interface and confine it with a config switch which makes clear that this is just legacy support and not to be used for new code.
--- include/linux/irq.h | 4 ++++ kernel/irq/Kconfig | 4 ++++ kernel/irq/irqdesc.c | 7 +++++++ 3 files changed, 15 insertions(+)
include/linux/irq.h +4 -0
@@ -637,6 +637,10 @@ int arch_setup_hwirq(unsigned int irq, int node);void arch_teardown_hwirq (unsigned int irq);#endif +#ifdef CONFIG_GENERIC_IRQ_LEGACY +void irq_init_desc (unsigned int irq); +#endif +#ifndef irq_reg_writel# define irq_reg_writel (val, addr) writel(val, addr)#endif
kernel/irq/Kconfig +4 -0
@@ -5,6 +5,10 @@ menu "IRQ subsystem" config MAY_HAVE_SPARSE_IRQ bool +# Legacy support, required for itanic +config GENERIC_IRQ_LEGACY + bool + # Enable the generic irq autoprobe mechanism config GENERIC_IRQ_PROBE bool
kernel/irq/irqdesc.c +7 -0
@@ -306,6 +306,13 @@ void irq_mark_irq(unsigned int irq) mutex_unlock(&sparse_irq_lock); } +#ifdef CONFIG_GENERIC_IRQ_LEGACY +void irq_init_desc (unsigned int irq) +{ +dynamic_irq_cleanup (irq); +} +#endif +#endif /* !CONFIG_SPARSE_IRQ */ /**
PATCH 31/32 ia64: Use irq_init_desc
In reply to Thomas GleixnerSwitch over to the new interface. No functional change.
--- arch/ia64/Kconfig | 1 + arch/ia64/kernel/iosapic.c | 2 +- arch/ia64/kernel/irq_ia64.c | 7 +++---- 3 files changed, 5 insertions(+), 5 deletions(-)
arch/ia64/Kconfig +1 -0
@@ -32,6 +32,7 @@ config IA64 select GENERIC_IRQ_PROBE select GENERIC_PENDING_IRQ if SMP select GENERIC_IRQ_SHOW + select GENERIC_IRQ_LEGACY select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_HAVE_NMI_SAFE_CMPXCHG select GENERIC_IOMAP
arch/ia64/kernel/iosapic.c +1 -1
@@ -735,7 +735,7 @@ iosapic_register_intr (unsigned int gsi, rte =find_rte (irq, gsi);if (iosapic_intr_info[irq].count ==0 ) {assign_irq_vector (irq); -dynamic_irq_init (irq); +irq_init_desc (irq); }else if (rte->refcnt !=NO_REF_RTE ) { rte->refcnt++; goto unlock_iosapic_lock;
arch/ia64/kernel/irq_ia64.c +3 -4
@@ -382,8 +382,7 @@ void destroy_and_reserve_irq(unsigned in {unsigned long flags; -dynamic_irq_cleanup (irq); - +irq_init_desc (irq);spin_lock_irqsave (&vector_lock, flags);__clear_irq_vector (irq); irq_status[irq] =IRQ_RSVD ;
@@ -416,13 +415,13 @@ int create_irq(void) out:spin_unlock_irqrestore (&vector_lock, flags);if (irq >=0 ) -dynamic_irq_init (irq); +irq_init_desc (irq);return irq; }void destroy_irq (unsigned int irq) { -dynamic_irq_cleanup (irq); +irq_init_desc (irq);clear_irq_vector (irq); }
RE: [patch 31/32] ia64: Use irq_init_desc
Quoted 1 line
Switch over to the new interface. No functional change.
ia64 parts:
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] ia64: Use irq_init_desc
In reply to Thomas Gleixneria64: Use irq_init_desc
Commit-ID: 4debd723f4934910ad1df279d80da16827f9b583 Gitweb: http://git.kernel.org/tip/4debd723f4934910ad1df279d80da16827f9b583 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:22 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:22 +0200
ia64: Use irq_init_desc
Switch over to the new interface. No functional change.
--- arch/ia64/Kconfig | 1 + arch/ia64/kernel/iosapic.c | 2 +- arch/ia64/kernel/irq_ia64.c | 7 +++---- 3 files changed, 5 insertions(+), 5 deletions(-)
arch/ia64/Kconfig +1 -0
@@ -32,6 +32,7 @@ config IA64 select GENERIC_IRQ_PROBE select GENERIC_PENDING_IRQ if SMP select GENERIC_IRQ_SHOW + select GENERIC_IRQ_LEGACY select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_HAVE_NMI_SAFE_CMPXCHG select GENERIC_IOMAP
arch/ia64/kernel/iosapic.c +1 -1
@@ -735,7 +735,7 @@ iosapic_register_intr (unsigned int gsi, rte =find_rte (irq, gsi);if (iosapic_intr_info[irq].count ==0 ) {assign_irq_vector (irq); -dynamic_irq_init (irq); +irq_init_desc (irq); }else if (rte->refcnt !=NO_REF_RTE ) { rte->refcnt++; goto unlock_iosapic_lock;
arch/ia64/kernel/irq_ia64.c +3 -4
@@ -382,8 +382,7 @@ void destroy_and_reserve_irq(unsigned int irq) {unsigned long flags; -dynamic_irq_cleanup (irq); - +irq_init_desc (irq);spin_lock_irqsave (&vector_lock, flags);__clear_irq_vector (irq); irq_status[irq] =IRQ_RSVD ;
@@ -416,13 +415,13 @@ int create_irq(void) out:spin_unlock_irqrestore (&vector_lock, flags);if (irq >=0 ) -dynamic_irq_init (irq); +irq_init_desc (irq);return irq; }void destroy_irq (unsigned int irq) { -dynamic_irq_cleanup (irq); +irq_init_desc (irq);clear_irq_vector (irq); }
PATCH 32/32 genirq: Remove dynamic_irq mess
In reply to Thomas GleixnerNo more users. Get rid of the cruft.
--- include/linux/irq.h | 10 ---------- kernel/irq/irqdesc.c | 23 +++++++---------------- 2 files changed, 7 insertions(+), 26 deletions(-)
include/linux/irq.h +0 -10
@@ -525,16 +525,6 @@ static inline void irq_set_percpu_devid_ IRQ_NOPROBE | IRQ_PER_CPU_DEVID); } -/* -* Dynamic irq helper functions. Obsolete. Use irq_alloc_desc* and -* irq_free_desc instead. -*/ -extern void dynamic_irq_cleanup (unsigned int irq); -static inline void dynamic_irq_init (unsigned int irq) -{ -dynamic_irq_cleanup (irq); -} -/* Set/get chip/data for an IRQ: */ extern int irq_set_chip (unsigned int irq,struct irq_chip *chip);extern int irq_set_handler_data (unsigned int irq,void *data);
kernel/irq/irqdesc.c +7 -16
@@ -278,7 +278,12 @@ EXPORT_SYMBOL(irq_to_desc);static void free_desc (unsigned int irq) { -dynamic_irq_cleanup (irq); +struct irq_desc *desc =irq_to_desc (irq); +unsigned long flags; + +raw_spin_lock_irqsave (&desc->lock, flags); +desc_set_defaults (irq, desc,desc_node (desc),NULL ); +raw_spin_unlock_irqrestore (&desc->lock, flags); } static inline int alloc_descs(unsigned int start, unsigned int cnt, int node,
@@ -309,7 +314,7 @@ void irq_mark_irq(unsigned int irq)#ifdef CONFIG_GENERIC_IRQ_LEGACY void irq_init_desc (unsigned int irq) { -dynamic_irq_cleanup (irq); +free_desc (irq); }#endif
@@ -522,20 +527,6 @@ int irq_set_percpu_devid(unsigned int irreturn 0 ; } -/** -* dynamic_irq_cleanup - cleanup a dynamically allocated irq -* @irq: irq number to initialize -*/ -void dynamic_irq_cleanup (unsigned int irq) -{ -struct irq_desc *desc =irq_to_desc (irq); -unsigned long flags; - -raw_spin_lock_irqsave (&desc->lock, flags); -desc_set_defaults (irq, desc,desc_node (desc),NULL ); -raw_spin_unlock_irqrestore (&desc->lock, flags); -} -void kstat_incr_irq_this_cpu (unsigned int irq) {kstat_incr_irqs_this_cpu (irq,irq_to_desc (irq));
tip-bot for Thomas Gleixner
merge bot[tip:irq/core] genirq: Remove dynamic_irq mess
genirq: Remove dynamic_irq mess
Commit-ID: d8179bc0db8d0c9654d5de43de2874bf6d0a58fa Gitweb: http://git.kernel.org/tip/d8179bc0db8d0c9654d5de43de2874bf6d0a58fa Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 7 May 2014 15:44:23 +0000 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 16 May 2014 14:05:22 +0200
genirq: Remove dynamic_irq mess
No more users. Get rid of the cruft.
--- include/linux/irq.h | 10 ---------- kernel/irq/irqdesc.c | 23 +++++++---------------- 2 files changed, 7 insertions(+), 26 deletions(-)
include/linux/irq.h +0 -10
@@ -525,16 +525,6 @@ static inline void irq_set_percpu_devid_flags(unsigned int irq) IRQ_NOPROBE | IRQ_PER_CPU_DEVID); } -/* -* Dynamic irq helper functions. Obsolete. Use irq_alloc_desc* and -* irq_free_desc instead. -*/ -extern void dynamic_irq_cleanup (unsigned int irq); -static inline void dynamic_irq_init (unsigned int irq) -{ -dynamic_irq_cleanup (irq); -} -/* Set/get chip/data for an IRQ: */ extern int irq_set_chip (unsigned int irq,struct irq_chip *chip);extern int irq_set_handler_data (unsigned int irq,void *data);
kernel/irq/irqdesc.c +7 -16
@@ -278,7 +278,12 @@ EXPORT_SYMBOL(irq_to_desc);static void free_desc (unsigned int irq) { -dynamic_irq_cleanup (irq); +struct irq_desc *desc =irq_to_desc (irq); +unsigned long flags; + +raw_spin_lock_irqsave (&desc->lock, flags); +desc_set_defaults (irq, desc,desc_node (desc),NULL ); +raw_spin_unlock_irqrestore (&desc->lock, flags); } static inline int alloc_descs(unsigned int start, unsigned int cnt, int node,
@@ -309,7 +314,7 @@ void irq_mark_irq(unsigned int irq)#ifdef CONFIG_GENERIC_IRQ_LEGACY void irq_init_desc (unsigned int irq) { -dynamic_irq_cleanup (irq); +free_desc (irq); }#endif
@@ -522,20 +527,6 @@ int irq_set_percpu_devid(unsigned int irq)return 0 ; } -/** -* dynamic_irq_cleanup - cleanup a dynamically allocated irq -* @irq: irq number to initialize -*/ -void dynamic_irq_cleanup (unsigned int irq) -{ -struct irq_desc *desc =irq_to_desc (irq); -unsigned long flags; - -raw_spin_lock_irqsave (&desc->lock, flags); -desc_set_defaults (irq, desc,desc_node (desc),NULL ); -raw_spin_unlock_irqrestore (&desc->lock, flags); -} -void kstat_incr_irq_this_cpu (unsigned int irq) {kstat_incr_irqs_this_cpu (irq,irq_to_desc (irq));
Quoted 30 lines · Thomas Gleixner
This cleanup series addresses a few histerical leftovers:
1)
irq_reserve_irq()The remaining callsites are pointless except s390, but we have a better way to protect the lower interrupt space there.
It's gone for good and it will never come back. Use irq domains, if you want hot pluggable irq chips.
2) create/destroy_irq and their variants
Designed in different circles of hell we have an incompatible zoo of those.
Three different implementations with different semantics vs. the return values. Two use cases which are just reusing the global namespace. And they come along with four different flavours of dynamic irq allocation.
I created a core implementation for that and put it under
GENERIC_IRQ_LEGACY_ALLOC_HWIRQto make clear that this is not for new code. That implementation is used by x86 and tile. I gave up on converting ia64 over, so I moved the create/destroy_irq prototypes into ia64 headers and provided a wrapper for the shared dmar driver.The core implementation is a very basic allocator and that's deliberately so. I don't want more users and every more complex than that wants to use irq domains.
Quoted 8 lines
3) dynamic_irq_init/cleanup
Another leftover from the past. By moving tile and iop13xx to sparse irq there is only ia64 left. I simplified the code and made this available only under a legacy config option to avoid that more people think they need this.
Full diffstat below.
For the whole series:
It all looks sane and a good cleanup. I've not done any testing though.
g.
Quoted 57 lines
Thanks,
tglx
--- arch/arm/Kconfig | 1 arch/arm/mach-iop13xx/include/mach/irqs.h | 2 arch/arm/mach-iop13xx/include/mach/time.h | 3 arch/arm/mach-iop13xx/iq81340mc.c | 1 arch/arm/mach-iop13xx/iq81340sc.c | 1 arch/arm/mach-iop13xx/msi.c | 51 ++--------- arch/arm/mach-iop13xx/setup.c | 1 arch/arm/mach-iop13xx/tpmi.c | 1 arch/ia64/Kconfig | 1 arch/ia64/include/asm/hw_irq.h | 1 arch/ia64/include/asm/irq.h | 3 arch/ia64/include/asm/irq_remapping.h | 2 arch/ia64/kernel/iosapic.c | 2 arch/ia64/kernel/irq_ia64.c | 15 --- arch/mips/pci/msi-xlp.c | 10 -- arch/mips/pci/pci-xlr.c | 10 -- arch/s390/kernel/irq.c | 5 - arch/s390/pci/pci.c | 6 - arch/tile/Kconfig | 2 arch/tile/include/asm/irq.h | 6 - arch/tile/kernel/irq.c | 40 --------- arch/tile/kernel/pci_gx.c | 17 +-- arch/x86/Kconfig | 1 arch/x86/include/asm/io_apic.h | 2 arch/x86/include/asm/irq_remapping.h | 3 arch/x86/kernel/apic/io_apic.c | 130 +++++------------------------- arch/x86/kernel/hpet.c | 5 - arch/x86/platform/uv/uv_irq.c | 10 -- drivers/iommu/dmar.c | 8 - drivers/iommu/irq_remapping.c | 12 +- drivers/net/ethernet/tile/tilegx.c | 6 - drivers/pci/htirq.c | 13 --- drivers/sh/intc/core.c | 6 - drivers/tty/hvc/hvc_tile.c | 8 - drivers/tty/serial/tilegx.c | 8 - drivers/usb/host/ehci-tilegx.c | 8 - drivers/usb/host/ohci-tilegx.c | 8 - drivers/xen/events/events_base.c | 17 --- include/linux/irq.h | 38 +++----- kernel/irq/Kconfig | 9 ++ kernel/irq/chip.c | 5 - kernel/irq/internals.h | 6 + kernel/irq/irqdesc.c | 95 ++++++++++++++------- 43 files changed, 216 insertions(+), 363 deletions(-)--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/