Skip to content

Commit

Permalink
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/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()
  ...
  • Loading branch information
torvalds committed Jun 4, 2014
2 parents 82e627e + c0ffa79 commit d09cc36
Show file tree
Hide file tree
Showing 56 changed files with 597 additions and 396 deletions.
3 changes: 1 addition & 2 deletions Documentation/IRQ-domain.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ An interrupt controller driver creates and registers an irq_domain by
calling one of the irq_domain_add_*() functions (each mapping method
has a different allocator function, more on that later). The function
will return a pointer to the irq_domain on success. The caller must
provide the allocator function with an irq_domain_ops structure with
the .map callback populated as a minimum.
provide the allocator function with an irq_domain_ops structure.

In most cases, the irq_domain will begin empty without any mappings
between hwirq and IRQ numbers. Mappings are added to the irq_domain
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Broadcom Generic Level 2 Interrupt Controller

Required properties:

- compatible: should be "brcm,l2-intc"
- reg: specifies the base physical address and size of the registers
- interrupt-controller: identifies the node as an interrupt controller
- #interrupt-cells: specifies the number of cells needed to encode an
interrupt source. Should be 1.
- interrupt-parent: specifies the phandle to the parent interrupt controller
this controller is cacaded from
- interrupts: specifies the interrupt line in the interrupt-parent irq space
to be used for cascading

Optional properties:

- brcm,irq-can-wake: If present, this means the L2 controller can be used as a
wakeup source for system suspend/resume.

Example:

hif_intr2_intc: interrupt-controller@f0441000 {
compatible = "brcm,l2-intc";
reg = <0xf0441000 0x30>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&intc>;
interrupts = <0x0 0x20 0x0>;
};
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-iop13xx/include/mach/irqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */
3 changes: 3 additions & 0 deletions arch/arm/mach-iop13xx/include/mach/time.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-iop13xx/iq81340mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions arch/arm/mach-iop13xx/iq81340sc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
52 changes: 12 additions & 40 deletions arch/arm/mach-iop13xx/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
#include <linux/msi.h>
#include <asm/mach/irq.h>
#include <asm/irq.h>


#define IOP13XX_NUM_MSI_IRQS 128
static DECLARE_BITMAP(msi_irq_in_use, IOP13XX_NUM_MSI_IRQS);
#include <mach/irqs.h>

/* IMIPR0 CP6 R8 Page 1
*/
Expand Down Expand Up @@ -121,41 +118,6 @@ void __init iop13xx_msi_init(void)
irq_set_chained_handler(IRQ_IOP13XX_INBD_MSI, iop13xx_msi_handler);
}

/*
* Dynamic irq allocate and deallocation
*/
int create_irq(void)
{
int irq, pos;

again:
pos = find_first_zero_bit(msi_irq_in_use, IOP13XX_NUM_MSI_IRQS);
irq = IRQ_IOP13XX_MSI_0 + pos;
if (irq > NR_IRQS)
return -ENOSPC;
/* test_and_set_bit operates on 32-bits at a time */
if (test_and_set_bit(pos, msi_irq_in_use))
goto again;

dynamic_irq_init(irq);

return irq;
}

void destroy_irq(unsigned int irq)
{
int pos = irq - IRQ_IOP13XX_MSI_0;

dynamic_irq_cleanup(irq);

clear_bit(pos, msi_irq_in_use);
}

void arch_teardown_msi_irq(unsigned int irq)
{
destroy_irq(irq);
}

static void iop13xx_msi_nop(struct irq_data *d)
{
return;
Expand All @@ -172,12 +134,17 @@ static struct irq_chip iop13xx_msi_chip = {

int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
{
int id, irq = create_irq();
int id, irq = irq_alloc_desc_from(IRQ_IOP13XX_MSI_0, -1);
struct msi_msg msg;

if (irq < 0)
return irq;

if (irq >= NR_IOP13XX_IRQS) {
irq_free_desc(irq);
return -ENOSPC;
}

irq_set_msi_desc(irq, desc);

msg.address_hi = 0x0;
Expand All @@ -191,3 +158,8 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)

return 0;
}

void arch_teardown_msi_irq(unsigned int irq)
{
irq_free_desc(irq);
}
1 change: 1 addition & 0 deletions arch/arm/mach-iop13xx/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-iop13xx/tpmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions arch/ia64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/ia64/include/asm/hw_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 3 additions & 0 deletions arch/ia64/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
2 changes: 2 additions & 0 deletions arch/ia64/include/asm/irq_remapping.h
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion arch/ia64/kernel/iosapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 3 additions & 12 deletions arch/ia64/kernel/irq_ia64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -390,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;
Expand Down Expand Up @@ -424,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);
}

Expand Down
10 changes: 1 addition & 9 deletions arch/mips/pci/msi-xlp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 1 addition & 9 deletions arch/mips/pci/pci-xlr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions arch/s390/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -151,9 +150,9 @@ int show_interrupts(struct seq_file *p, void *v)
return 0;
}

int arch_show_interrupts(struct seq_file *p, int prec)
unsigned int arch_dynirq_lower_bound(unsigned int from)
{
return 0;
return from < THIN_INTERRUPT ? THIN_INTERRUPT : from;
}

/*
Expand Down
6 changes: 3 additions & 3 deletions arch/s390/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions arch/tile/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions arch/tile/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading

0 comments on commit d09cc36

Please sign in to comment.