aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 18:59:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 18:59:13 -0400
commitd09cc3659db494aca4b3bb2393c533fb4946b794 (patch)
tree158d1dd5fa5fddf1c99da677a193b8561c11274d /arch/tile
parent82e627eb5e07d7993216c9e63fb5550cf6ed25d7 (diff)
parentc0ffa793994a7a69c37a96dabf38323eae1dffa6 (diff)
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
Pull core irq updates from Thomas Gleixner: "The irq department delivers: - Another tree wide update to get rid of the horrible create_irq interface along with its even more horrible variants. That also gets rid of the last leftovers of the initial sparse irq hackery. arch/driver specific changes have been either acked or ignored. - A fix for the spurious interrupt detection logic with threaded interrupts. - A new ARM SoC interrupt controller - The usual pile of fixes and improvements all over the place" * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (40 commits) Documentation: brcmstb-l2: Add Broadcom STB Level-2 interrupt controller binding irqchip: brcmstb-l2: Add Broadcom Set Top Box Level-2 interrupt controller genirq: Improve documentation to match current implementation ARM: iop13xx: fix msi support with sparse IRQ genirq: Provide !SMP stub for irq_set_affinity_notifier() irqchip: armada-370-xp: Move the devicetree binding documentation irqchip: gic: Use mask field in GICC_IAR genirq: Remove dynamic_irq mess ia64: Use irq_init_desc genirq: Replace dynamic_irq_init/cleanup genirq: Remove irq_reserve_irq[s] genirq: Replace reserve_irqs in core code s390: Avoid call to irq_reserve_irqs() s390: Remove pointless arch_show_interrupts() s390: pci: Check return value of alloc_irq_desc() proper sh: intc: Remove pointless irq_reserve_irqs() invocation x86, irq: Remove pointless irq_reserve_irqs() call genirq: Make create/destroy_irq() ia64 private tile: Use SPARSE_IRQ tile: pci: Use irq_alloc/free_hwirq() ...
Diffstat (limited to 'arch/tile')
-rw-r--r--arch/tile/Kconfig2
-rw-r--r--arch/tile/include/asm/irq.h6
-rw-r--r--arch/tile/kernel/irq.c40
-rw-r--r--arch/tile/kernel/pci_gx.c17
4 files changed, 17 insertions, 48 deletions
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index 85258ca43ff5..4f3006b600e3 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -125,6 +125,8 @@ config HVC_TILE
125 125
126config TILEGX 126config TILEGX
127 bool "Building for TILE-Gx (64-bit) processor" 127 bool "Building for TILE-Gx (64-bit) processor"
128 select SPARSE_IRQ
129 select GENERIC_IRQ_LEGACY_ALLOC_HWIRQ
128 select HAVE_FUNCTION_TRACER 130 select HAVE_FUNCTION_TRACER
129 select HAVE_FUNCTION_TRACE_MCOUNT_TEST 131 select HAVE_FUNCTION_TRACE_MCOUNT_TEST
130 select HAVE_FUNCTION_GRAPH_TRACER 132 select HAVE_FUNCTION_GRAPH_TRACER
diff --git a/arch/tile/include/asm/irq.h b/arch/tile/include/asm/irq.h
index 33cff9a3058b..1fe86911838b 100644
--- a/arch/tile/include/asm/irq.h
+++ b/arch/tile/include/asm/irq.h
@@ -18,10 +18,12 @@
18#include <linux/hardirq.h> 18#include <linux/hardirq.h>
19 19
20/* The hypervisor interface provides 32 IRQs. */ 20/* The hypervisor interface provides 32 IRQs. */
21#define NR_IRQS 32 21#define NR_IRQS 32
22 22
23/* IRQ numbers used for linux IPIs. */ 23/* IRQ numbers used for linux IPIs. */
24#define IRQ_RESCHEDULE 0 24#define IRQ_RESCHEDULE 0
25/* Interrupts for dynamic allocation start at 1. Let the core allocate irq0 */
26#define NR_IRQS_LEGACY 1
25 27
26#define irq_canonicalize(irq) (irq) 28#define irq_canonicalize(irq) (irq)
27 29
diff --git a/arch/tile/kernel/irq.c b/arch/tile/kernel/irq.c
index 906a76bdb31d..637f2ffaa5f5 100644
--- a/arch/tile/kernel/irq.c
+++ b/arch/tile/kernel/irq.c
@@ -54,13 +54,6 @@ static DEFINE_PER_CPU(unsigned long, irq_disable_mask)
54 */ 54 */
55static DEFINE_PER_CPU(int, irq_depth); 55static DEFINE_PER_CPU(int, irq_depth);
56 56
57/* State for allocating IRQs on Gx. */
58#if CHIP_HAS_IPI()
59static unsigned long available_irqs = ((1UL << NR_IRQS) - 1) &
60 (~(1UL << IRQ_RESCHEDULE));
61static DEFINE_SPINLOCK(available_irqs_lock);
62#endif
63
64#if CHIP_HAS_IPI() 57#if CHIP_HAS_IPI()
65/* Use SPRs to manipulate device interrupts. */ 58/* Use SPRs to manipulate device interrupts. */
66#define mask_irqs(irq_mask) __insn_mtspr(SPR_IPI_MASK_SET_K, irq_mask) 59#define mask_irqs(irq_mask) __insn_mtspr(SPR_IPI_MASK_SET_K, irq_mask)
@@ -278,38 +271,11 @@ int arch_show_interrupts(struct seq_file *p, int prec)
278 return 0; 271 return 0;
279} 272}
280 273
281/*
282 * Generic, controller-independent functions:
283 */
284
285#if CHIP_HAS_IPI() 274#if CHIP_HAS_IPI()
286int create_irq(void) 275int arch_setup_hwirq(unsigned int irq, int node)
287{ 276{
288 unsigned long flags; 277 return irq >= NR_IRQS ? -EINVAL : 0;
289 int result;
290
291 spin_lock_irqsave(&available_irqs_lock, flags);
292 if (available_irqs == 0)
293 result = -ENOMEM;
294 else {
295 result = __ffs(available_irqs);
296 available_irqs &= ~(1UL << result);
297 dynamic_irq_init(result);
298 }
299 spin_unlock_irqrestore(&available_irqs_lock, flags);
300
301 return result;
302} 278}
303EXPORT_SYMBOL(create_irq);
304 279
305void destroy_irq(unsigned int irq) 280void arch_teardown_hwirq(unsigned int irq) { }
306{
307 unsigned long flags;
308
309 spin_lock_irqsave(&available_irqs_lock, flags);
310 available_irqs |= (1UL << irq);
311 dynamic_irq_cleanup(irq);
312 spin_unlock_irqrestore(&available_irqs_lock, flags);
313}
314EXPORT_SYMBOL(destroy_irq);
315#endif 281#endif
diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c
index 077b7bc437e5..e39f9c542807 100644
--- a/arch/tile/kernel/pci_gx.c
+++ b/arch/tile/kernel/pci_gx.c
@@ -350,10 +350,9 @@ static int tile_init_irqs(struct pci_controller *controller)
350 int cpu; 350 int cpu;
351 351
352 /* Ask the kernel to allocate an IRQ. */ 352 /* Ask the kernel to allocate an IRQ. */
353 irq = create_irq(); 353 irq = irq_alloc_hwirq(-1);
354 if (irq < 0) { 354 if (!irq) {
355 pr_err("PCI: no free irq vectors, failed for %d\n", i); 355 pr_err("PCI: no free irq vectors, failed for %d\n", i);
356
357 goto free_irqs; 356 goto free_irqs;
358 } 357 }
359 controller->irq_intx_table[i] = irq; 358 controller->irq_intx_table[i] = irq;
@@ -382,7 +381,7 @@ static int tile_init_irqs(struct pci_controller *controller)
382 381
383free_irqs: 382free_irqs:
384 for (j = 0; j < i; j++) 383 for (j = 0; j < i; j++)
385 destroy_irq(controller->irq_intx_table[j]); 384 irq_free_hwirq(controller->irq_intx_table[j]);
386 385
387 return -1; 386 return -1;
388} 387}
@@ -1500,9 +1499,9 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
1500 int irq; 1499 int irq;
1501 int ret; 1500 int ret;
1502 1501
1503 irq = create_irq(); 1502 irq = irq_alloc_hwirq(-1);
1504 if (irq < 0) 1503 if (!irq)
1505 return irq; 1504 return -ENOSPC;
1506 1505
1507 /* 1506 /*
1508 * Since we use a 64-bit Mem-Map to accept the MSI write, we fail 1507 * Since we use a 64-bit Mem-Map to accept the MSI write, we fail
@@ -1601,11 +1600,11 @@ hv_msi_config_failure:
1601 /* Free mem-map */ 1600 /* Free mem-map */
1602msi_mem_map_alloc_failure: 1601msi_mem_map_alloc_failure:
1603is_64_failure: 1602is_64_failure:
1604 destroy_irq(irq); 1603 irq_free_hwirq(irq);
1605 return ret; 1604 return ret;
1606} 1605}
1607 1606
1608void arch_teardown_msi_irq(unsigned int irq) 1607void arch_teardown_msi_irq(unsigned int irq)
1609{ 1608{
1610 destroy_irq(irq); 1609 irq_free_hwirq(irq);
1611} 1610}