Skip to content

Commit 683b6c6

Browse files
committed
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq code updates from Thomas Gleixner: "The irq department proudly presents: - Another tree wide sweep of irq infrastructure abuse. Clear winner of the trainwreck engineering contest was: #include "../../../kernel/irq/settings.h" - Tree wide update of irq_set_affinity() callbacks which miss a cpu online check when picking a single cpu out of the affinity mask. - Tree wide consolidation of interrupt statistics. - Updates to the threaded interrupt infrastructure to allow explicit wakeup of the interrupt thread and a variant of synchronize_irq() which synchronizes only the hard interrupt handler. Both are needed to replace the homebrewn thread handling in the mmc/sdhci code. - New irq chip callbacks to allow proper support for GPIO based irqs. The GPIO based interrupts need to request/release GPIO resources from request/free_irq. - A few new ARM interrupt chips. No revolutionary new hardware, just differently wreckaged variations of the scheme. - Small improvments, cleanups and updates all over the place" I was hoping that that trainwreck engineering contest was a April Fools' joke. But no. * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (68 commits) irqchip: sun7i/sun6i: Disable NMI before registering the handler ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller ARM: sun7i/sun6i: irqchip: Update the documentation ARM: sun7i/sun6i: dts: Add NMI irqchip support ARM: sun7i/sun6i: irqchip: Add irqchip driver for NMI controller genirq: Export symbol no_action() arm: omap: Fix typo in ams-delta-fiq.c m68k: atari: Fix the last kernel_stat.h fallout irqchip: sun4i: Simplify sun4i_irq_ack irqchip: sun4i: Use handle_fasteoi_irq for all interrupts genirq: procfs: Make smp_affinity values go+r softirq: Add linux/irq.h to make it compile again m68k: amiga: Add linux/irq.h to make it compile again irqchip: sun4i: Don't ack IRQs > 0, fix acking of IRQ 0 irqchip: sun4i: Fix a comment about mask register initialization irqchip: sun4i: Fix irq 0 not working genirq: Add a new IRQCHIP_EOI_THREADED flag genirq: Document IRQCHIP_ONESHOT_SAFE flag ARM: sunxi: dt: Convert to the new irq controller compatibles irqchip: sunxi: Change compatibles ...
2 parents 1ead658 + 1b422ec commit 683b6c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+705
-393
lines changed

Documentation/devicetree/bindings/arm/armada-370-xp-mpic.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Marvell Armada 370 and Armada XP Interrupt Controller
1+
Marvell Armada 370, 375, 38x, XP Interrupt Controller
22
-----------------------------------------------------
33

44
Required properties:
@@ -16,7 +16,13 @@ Required properties:
1616
automatically map to the interrupt controller registers of the
1717
current CPU)
1818

19+
Optional properties:
1920

21+
- interrupts: If defined, then it indicates that this MPIC is
22+
connected as a slave to another interrupt controller. This is
23+
typically the case on Armada 375 and Armada 38x, where the MPIC is
24+
connected as a slave to the Cortex-A9 GIC. The provided interrupt
25+
indicate to which GIC interrupt the MPIC output is connected.
2026

2127
Example:
2228

Documentation/devicetree/bindings/interrupt-controller/allwinner,sun4i-ic.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Allwinner Sunxi Interrupt Controller
22

33
Required properties:
44

5-
- compatible : should be "allwinner,sun4i-ic"
5+
- compatible : should be "allwinner,sun4i-a10-ic"
66
- reg : Specifies base physical address and size of the registers.
77
- interrupt-controller : Identifies the node as an interrupt controller
88
- #interrupt-cells : Specifies the number of cells needed to encode an
@@ -11,7 +11,7 @@ Required properties:
1111
Example:
1212

1313
intc: interrupt-controller {
14-
compatible = "allwinner,sun4i-ic";
14+
compatible = "allwinner,sun4i-a10-ic";
1515
reg = <0x01c20400 0x400>;
1616
interrupt-controller;
1717
#interrupt-cells = <1>;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Allwinner Sunxi NMI Controller
2+
==============================
3+
4+
Required properties:
5+
6+
- compatible : should be "allwinner,sun7i-a20-sc-nmi" or
7+
"allwinner,sun6i-a31-sc-nmi"
8+
- reg : Specifies base physical address and size of the registers.
9+
- interrupt-controller : Identifies the node as an interrupt controller
10+
- #interrupt-cells : Specifies the number of cells needed to encode an
11+
interrupt source. The value shall be 2. The first cell is the IRQ number, the
12+
second cell the trigger type as defined in interrupt.txt in this directory.
13+
- interrupt-parent: Specifies the parent interrupt controller.
14+
- interrupts: Specifies the interrupt line (NMI) which is handled by
15+
the interrupt controller in the parent controller's notation. This value
16+
shall be the NMI.
17+
18+
Example:
19+
20+
sc-nmi-intc@01c00030 {
21+
compatible = "allwinner,sun7i-a20-sc-nmi";
22+
interrupt-controller;
23+
#interrupt-cells = <2>;
24+
reg = <0x01c00030 0x0c>;
25+
interrupt-parent = <&gic>;
26+
interrupts = <0 0 4>;
27+
};

arch/arm/boot/dts/sun4i-a10.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@
331331
};
332332

333333
intc: interrupt-controller@01c20400 {
334-
compatible = "allwinner,sun4i-ic";
334+
compatible = "allwinner,sun4i-a10-ic";
335335
reg = <0x01c20400 0x400>;
336336
interrupt-controller;
337337
#interrupt-cells = <1>;

arch/arm/boot/dts/sun5i-a10s.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@
294294
};
295295

296296
intc: interrupt-controller@01c20400 {
297-
compatible = "allwinner,sun4i-ic";
297+
compatible = "allwinner,sun4i-a10-ic";
298298
reg = <0x01c20400 0x400>;
299299
interrupt-controller;
300300
#interrupt-cells = <1>;

arch/arm/boot/dts/sun5i-a13.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@
275275
ranges;
276276

277277
intc: interrupt-controller@01c20400 {
278-
compatible = "allwinner,sun4i-ic";
278+
compatible = "allwinner,sun4i-a10-ic";
279279
reg = <0x01c20400 0x400>;
280280
interrupt-controller;
281281
#interrupt-cells = <1>;

arch/arm/boot/dts/sun6i-a31.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@
190190
#size-cells = <1>;
191191
ranges;
192192

193+
nmi_intc: interrupt-controller@01f00c0c {
194+
compatible = "allwinner,sun6i-a31-sc-nmi";
195+
interrupt-controller;
196+
#interrupt-cells = <2>;
197+
reg = <0x01f00c0c 0x38>;
198+
interrupts = <0 32 4>;
199+
};
200+
193201
pio: pinctrl@01c20800 {
194202
compatible = "allwinner,sun6i-a31-pinctrl";
195203
reg = <0x01c20800 0x400>;

arch/arm/boot/dts/sun7i-a20.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,14 @@
339339
#size-cells = <1>;
340340
ranges;
341341

342+
nmi_intc: interrupt-controller@01c00030 {
343+
compatible = "allwinner,sun7i-a20-sc-nmi";
344+
interrupt-controller;
345+
#interrupt-cells = <2>;
346+
reg = <0x01c00030 0x0c>;
347+
interrupts = <0 0 4>;
348+
};
349+
342350
emac: ethernet@01c0b000 {
343351
compatible = "allwinner,sun4i-a10-emac";
344352
reg = <0x01c0b000 0x1000>;

arch/arm/mach-imx/pm-imx6q.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static void imx6q_enable_wb(bool enable)
120120

121121
int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
122122
{
123-
struct irq_desc *iomuxc_irq_desc;
123+
struct irq_data *iomuxc_irq_data = irq_get_irq_data(32);
124124
u32 val = readl_relaxed(ccm_base + CLPCR);
125125

126126
val &= ~BM_CLPCR_LPM;
@@ -167,10 +167,9 @@ int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
167167
* 3) Software should mask IRQ #32 right after CCM Low-Power mode
168168
* is set (set bits 0-1 of CCM_CLPCR).
169169
*/
170-
iomuxc_irq_desc = irq_to_desc(32);
171-
imx_gpc_irq_unmask(&iomuxc_irq_desc->irq_data);
170+
imx_gpc_irq_unmask(iomuxc_irq_data);
172171
writel_relaxed(val, ccm_base + CLPCR);
173-
imx_gpc_irq_mask(&iomuxc_irq_desc->irq_data);
172+
imx_gpc_irq_mask(iomuxc_irq_data);
174173

175174
return 0;
176175
}

arch/arm/mach-mmp/pm-mmp2.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,8 @@
2727

2828
int mmp2_set_wake(struct irq_data *d, unsigned int on)
2929
{
30-
int irq = d->irq;
31-
struct irq_desc *desc = irq_to_desc(irq);
3230
unsigned long data = 0;
33-
34-
if (unlikely(irq >= nr_irqs)) {
35-
pr_err("IRQ nubmers are out of boundary!\n");
36-
return -EINVAL;
37-
}
38-
39-
if (on) {
40-
if (desc->action)
41-
desc->action->flags |= IRQF_NO_SUSPEND;
42-
} else {
43-
if (desc->action)
44-
desc->action->flags &= ~IRQF_NO_SUSPEND;
45-
}
31+
int irq = d->irq;
4632

4733
/* enable wakeup sources */
4834
switch (irq) {

arch/arm/mach-mmp/pm-pxa910.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,8 @@
2727

2828
int pxa910_set_wake(struct irq_data *data, unsigned int on)
2929
{
30-
int irq = data->irq;
31-
struct irq_desc *desc = irq_to_desc(data->irq);
3230
uint32_t awucrm = 0, apcr = 0;
33-
34-
if (unlikely(irq >= nr_irqs)) {
35-
pr_err("IRQ nubmers are out of boundary!\n");
36-
return -EINVAL;
37-
}
38-
39-
if (on) {
40-
if (desc->action)
41-
desc->action->flags |= IRQF_NO_SUSPEND;
42-
} else {
43-
if (desc->action)
44-
desc->action->flags &= ~IRQF_NO_SUSPEND;
45-
}
31+
int irq = data->irq;
4632

4733
/* setting wakeup sources */
4834
switch (irq) {
@@ -115,9 +101,11 @@ int pxa910_set_wake(struct irq_data *data, unsigned int on)
115101
if (irq >= IRQ_GPIO_START && irq < IRQ_BOARD_START) {
116102
awucrm = MPMU_AWUCRM_WAKEUP(2);
117103
apcr |= MPMU_APCR_SLPWP2;
118-
} else
104+
} else {
105+
/* FIXME: This should return a proper error code ! */
119106
printk(KERN_ERR "Error: no defined wake up source irq: %d\n",
120107
irq);
108+
}
121109
}
122110

123111
if (on) {

arch/arm/mach-omap1/ams-delta-fiq.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,10 @@ static unsigned int irq_counter[16];
4444

4545
static irqreturn_t deferred_fiq(int irq, void *dev_id)
4646
{
47-
struct irq_desc *irq_desc;
48-
struct irq_chip *irq_chip = NULL;
4947
int gpio, irq_num, fiq_count;
48+
struct irq_chip *irq_chip;
5049

51-
irq_desc = irq_to_desc(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK));
52-
if (irq_desc)
53-
irq_chip = irq_desc->irq_data.chip;
50+
irq_chip = irq_get_chip(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK));
5451

5552
/*
5653
* For each handled GPIO interrupt, keep calling its interrupt handler

arch/ia64/kernel/irq_ia64.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ static irqreturn_t smp_irq_move_cleanup_interrupt(int irq, void *dev_id)
364364

365365
static struct irqaction irq_move_irqaction = {
366366
.handler = smp_irq_move_cleanup_interrupt,
367-
.flags = IRQF_DISABLED,
368367
.name = "irq_move"
369368
};
370369

@@ -489,14 +488,13 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
489488
ia64_srlz_d();
490489
while (vector != IA64_SPURIOUS_INT_VECTOR) {
491490
int irq = local_vector_to_irq(vector);
492-
struct irq_desc *desc = irq_to_desc(irq);
493491

494492
if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) {
495493
smp_local_flush_tlb();
496-
kstat_incr_irqs_this_cpu(irq, desc);
494+
kstat_incr_irq_this_cpu(irq);
497495
} else if (unlikely(IS_RESCHEDULE(vector))) {
498496
scheduler_ipi();
499-
kstat_incr_irqs_this_cpu(irq, desc);
497+
kstat_incr_irq_this_cpu(irq);
500498
} else {
501499
ia64_setreg(_IA64_REG_CR_TPR, vector);
502500
ia64_srlz_d();
@@ -549,13 +547,12 @@ void ia64_process_pending_intr(void)
549547
*/
550548
while (vector != IA64_SPURIOUS_INT_VECTOR) {
551549
int irq = local_vector_to_irq(vector);
552-
struct irq_desc *desc = irq_to_desc(irq);
553550

554551
if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) {
555552
smp_local_flush_tlb();
556-
kstat_incr_irqs_this_cpu(irq, desc);
553+
kstat_incr_irq_this_cpu(irq);
557554
} else if (unlikely(IS_RESCHEDULE(vector))) {
558-
kstat_incr_irqs_this_cpu(irq, desc);
555+
kstat_incr_irq_this_cpu(irq);
559556
} else {
560557
struct pt_regs *old_regs = set_irq_regs(NULL);
561558

@@ -602,7 +599,6 @@ static irqreturn_t dummy_handler (int irq, void *dev_id)
602599

603600
static struct irqaction ipi_irqaction = {
604601
.handler = handle_IPI,
605-
.flags = IRQF_DISABLED,
606602
.name = "IPI"
607603
};
608604

@@ -611,13 +607,11 @@ static struct irqaction ipi_irqaction = {
611607
*/
612608
static struct irqaction resched_irqaction = {
613609
.handler = dummy_handler,
614-
.flags = IRQF_DISABLED,
615610
.name = "resched"
616611
};
617612

618613
static struct irqaction tlb_irqaction = {
619614
.handler = dummy_handler,
620-
.flags = IRQF_DISABLED,
621615
.name = "tlb_flush"
622616
};
623617

arch/ia64/kernel/mca.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,38 +1772,32 @@ __setup("disable_cpe_poll", ia64_mca_disable_cpe_polling);
17721772

17731773
static struct irqaction cmci_irqaction = {
17741774
.handler = ia64_mca_cmc_int_handler,
1775-
.flags = IRQF_DISABLED,
17761775
.name = "cmc_hndlr"
17771776
};
17781777

17791778
static struct irqaction cmcp_irqaction = {
17801779
.handler = ia64_mca_cmc_int_caller,
1781-
.flags = IRQF_DISABLED,
17821780
.name = "cmc_poll"
17831781
};
17841782

17851783
static struct irqaction mca_rdzv_irqaction = {
17861784
.handler = ia64_mca_rendez_int_handler,
1787-
.flags = IRQF_DISABLED,
17881785
.name = "mca_rdzv"
17891786
};
17901787

17911788
static struct irqaction mca_wkup_irqaction = {
17921789
.handler = ia64_mca_wakeup_int_handler,
1793-
.flags = IRQF_DISABLED,
17941790
.name = "mca_wkup"
17951791
};
17961792

17971793
#ifdef CONFIG_ACPI
17981794
static struct irqaction mca_cpe_irqaction = {
17991795
.handler = ia64_mca_cpe_int_handler,
1800-
.flags = IRQF_DISABLED,
18011796
.name = "cpe_hndlr"
18021797
};
18031798

18041799
static struct irqaction mca_cpep_irqaction = {
18051800
.handler = ia64_mca_cpe_int_caller,
1806-
.flags = IRQF_DISABLED,
18071801
.name = "cpe_poll"
18081802
};
18091803
#endif /* CONFIG_ACPI */

arch/ia64/kernel/msi_ia64.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ static int ia64_set_msi_irq_affinity(struct irq_data *idata,
1717
{
1818
struct msi_msg msg;
1919
u32 addr, data;
20-
int cpu = first_cpu(*cpu_mask);
20+
int cpu = cpumask_first_and(cpu_mask, cpu_online_mask);
2121
unsigned int irq = idata->irq;
2222

23-
if (!cpu_online(cpu))
24-
return -1;
25-
2623
if (irq_prepare_move(irq, cpu))
2724
return -1;
2825

@@ -139,10 +136,7 @@ static int dmar_msi_set_affinity(struct irq_data *data,
139136
unsigned int irq = data->irq;
140137
struct irq_cfg *cfg = irq_cfg + irq;
141138
struct msi_msg msg;
142-
int cpu = cpumask_first(mask);
143-
144-
if (!cpu_online(cpu))
145-
return -1;
139+
int cpu = cpumask_first_and(mask, cpu_online_mask);
146140

147141
if (irq_prepare_move(irq, cpu))
148142
return -1;

arch/ia64/kernel/perfmon.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6387,7 +6387,6 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx)
63876387

63886388
static struct irqaction perfmon_irqaction = {
63896389
.handler = pfm_interrupt_handler,
6390-
.flags = IRQF_DISABLED,
63916390
.name = "perfmon"
63926391
};
63936392

arch/ia64/kernel/time.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static cycle_t itc_get_cycles(struct clocksource *cs)
380380

381381
static struct irqaction timer_irqaction = {
382382
.handler = timer_interrupt,
383-
.flags = IRQF_DISABLED | IRQF_IRQPOLL,
383+
.flags = IRQF_IRQPOLL,
384384
.name = "timer"
385385
};
386386

arch/ia64/sn/kernel/irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ static int sn_set_affinity_irq(struct irq_data *data,
209209
nasid_t nasid;
210210
int slice;
211211

212-
nasid = cpuid_to_nasid(cpumask_first(mask));
213-
slice = cpuid_to_slice(cpumask_first(mask));
212+
nasid = cpuid_to_nasid(cpumask_first_and(mask, cpu_online_mask));
213+
slice = cpuid_to_slice(cpumask_first_and(mask, cpu_online_mask));
214214

215215
list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe,
216216
sn_irq_lh[irq], list)

arch/ia64/sn/kernel/msi_sn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static int sn_set_msi_irq_affinity(struct irq_data *data,
166166
struct sn_pcibus_provider *provider;
167167
unsigned int cpu, irq = data->irq;
168168

169-
cpu = cpumask_first(cpu_mask);
169+
cpu = cpumask_first_and(cpu_mask, cpu_online_mask);
170170
sn_irq_info = sn_msi_info[irq].sn_irq_info;
171171
if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0)
172172
return -1;

arch/m68k/amiga/cia.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/init.h>
1919
#include <linux/seq_file.h>
2020
#include <linux/interrupt.h>
21+
#include <linux/irq.h>
2122

2223
#include <asm/irq.h>
2324
#include <asm/amigahw.h>

0 commit comments

Comments
 (0)