Skip to content

Commit 78f8601

Browse files
committed
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq updates from Thomas Gleixner: "The interrupt departement delivers this time: - New infrastructure to manage NMIs on platforms which have a sane NMI delivery, i.e. identifiable NMI vectors instead of a single lump. - Simplification of the interrupt affinity management so drivers don't have to implement ugly loops around the PCI/MSI enablement. - Speedup for interrupt statistics in /proc/stat - Provide a function to retrieve the default irq domain - A new interrupt controller for the Loongson LS1X platform - Affinity support for the SiFive PLIC - Better support for the iMX irqsteer driver - NUMA aware memory allocations for GICv3 - The usual small fixes, improvements and cleanups all over the place" * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits) irqchip/imx-irqsteer: Add multi output interrupts support irqchip/imx-irqsteer: Change to use reg_num instead of irq_group dt-bindings: irq: imx-irqsteer: Add multi output interrupts support dt-binding: irq: imx-irqsteer: Use irq number instead of group number irqchip/brcmstb-l2: Use _irqsave locking variants in non-interrupt code irqchip/gicv3-its: Use NUMA aware memory allocation for ITS tables irqdomain: Allow the default irq domain to be retrieved irqchip/sifive-plic: Implement irq_set_affinity() for SMP host irqchip/sifive-plic: Differentiate between PLIC handler and context irqchip/sifive-plic: Add warning in plic_init() if handler already present irqchip/sifive-plic: Pre-compute context hart base and enable base PCI/MSI: Remove obsolete sanity checks for multiple interrupt sets genirq/affinity: Remove the leftovers of the original set support nvme-pci: Simplify interrupt allocation genirq/affinity: Add new callback for (re)calculating interrupt sets genirq/affinity: Store interrupt sets size in struct irq_affinity genirq/affinity: Code consolidation irqchip/irq-sifive-plic: Check and continue in case of an invalid cpuid. irqchip/i8259: Fix shutdown order by moving syscore_ops registration dt-bindings: interrupt-controller: loongson ls1x intc ...
2 parents 1848319 + a324ca9 commit 78f8601

30 files changed

Lines changed: 1177 additions & 281 deletions

‎Documentation/devicetree/bindings/interrupt-controller/fsl,irqsteer.txt‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Required properties:
66
- "fsl,imx8m-irqsteer"
77
- "fsl,imx-irqsteer"
88
- reg: Physical base address and size of registers.
9-
- interrupts: Should contain the parent interrupt line used to multiplex the
10-
input interrupts.
9+
- interrupts: Should contain the up to 8 parent interrupt lines used to
10+
multiplex the input interrupts. They should be specified sequentially
11+
from output 0 to 7.
1112
- clocks: Should contain one clock for entry in clock-names
1213
see Documentation/devicetree/bindings/clock/clock-bindings.txt
1314
- clock-names:
@@ -16,8 +17,8 @@ Required properties:
1617
- #interrupt-cells: Specifies the number of cells needed to encode an
1718
interrupt source. The value must be 1.
1819
- fsl,channel: The output channel that all input IRQs should be steered into.
19-
- fsl,irq-groups: Number of IRQ groups managed by this controller instance.
20-
Each group manages 64 input interrupts.
20+
- fsl,num-irqs: Number of input interrupts of this channel.
21+
Should be multiple of 32 input interrupts and up to 512 interrupts.
2122

2223
Example:
2324

@@ -28,7 +29,7 @@ Example:
2829
clocks = <&clk IMX8MQ_CLK_DISP_APB_ROOT>;
2930
clock-names = "ipg";
3031
fsl,channel = <0>;
31-
fsl,irq-groups = <1>;
32+
fsl,num-irqs = <64>;
3233
interrupt-controller;
3334
#interrupt-cells = <1>;
3435
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Loongson ls1x Interrupt Controller
2+
3+
Required properties:
4+
5+
- compatible : should be "loongson,ls1x-intc". Valid strings are:
6+
7+
- reg : Specifies base physical address and size of the registers.
8+
- interrupt-controller : Identifies the node as an interrupt controller
9+
- #interrupt-cells : Specifies the number of cells needed to encode an
10+
interrupt source. The value shall be 2.
11+
- interrupts : Specifies the CPU interrupt the controller is connected to.
12+
13+
Example:
14+
15+
intc: interrupt-controller@1fd01040 {
16+
compatible = "loongson,ls1x-intc";
17+
reg = <0x1fd01040 0x18>;
18+
19+
interrupt-controller;
20+
#interrupt-cells = <2>;
21+
22+
interrupt-parent = <&cpu_intc>;
23+
interrupts = <2>;
24+
};

‎drivers/irqchip/Kconfig‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,15 @@ config IMX_IRQSTEER
406406
help
407407
Support for the i.MX IRQSTEER interrupt multiplexer/remapper.
408408

409+
config LS1X_IRQ
410+
bool "Loongson-1 Interrupt Controller"
411+
depends on MACH_LOONGSON32
412+
default y
413+
select IRQ_DOMAIN
414+
select GENERIC_IRQ_CHIP
415+
help
416+
Support for the Loongson-1 platform Interrupt Controller.
417+
409418
endmenu
410419

411420
config SIFIVE_PLIC

‎drivers/irqchip/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,4 @@ obj-$(CONFIG_CSKY_APB_INTC) += irq-csky-apb-intc.o
9494
obj-$(CONFIG_SIFIVE_PLIC) += irq-sifive-plic.o
9595
obj-$(CONFIG_IMX_IRQSTEER) += irq-imx-irqsteer.o
9696
obj-$(CONFIG_MADERA_IRQ) += irq-madera.o
97+
obj-$(CONFIG_LS1X_IRQ) += irq-ls1x.o

‎drivers/irqchip/irq-brcmstb-l2.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ static void brcmstb_l2_intc_suspend(struct irq_data *d)
129129
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
130130
struct irq_chip_type *ct = irq_data_get_chip_type(d);
131131
struct brcmstb_l2_intc_data *b = gc->private;
132+
unsigned long flags;
132133

133-
irq_gc_lock(gc);
134+
irq_gc_lock_irqsave(gc, flags);
134135
/* Save the current mask */
135136
b->saved_mask = irq_reg_readl(gc, ct->regs.mask);
136137

@@ -139,16 +140,17 @@ static void brcmstb_l2_intc_suspend(struct irq_data *d)
139140
irq_reg_writel(gc, ~gc->wake_active, ct->regs.disable);
140141
irq_reg_writel(gc, gc->wake_active, ct->regs.enable);
141142
}
142-
irq_gc_unlock(gc);
143+
irq_gc_unlock_irqrestore(gc, flags);
143144
}
144145

145146
static void brcmstb_l2_intc_resume(struct irq_data *d)
146147
{
147148
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
148149
struct irq_chip_type *ct = irq_data_get_chip_type(d);
149150
struct brcmstb_l2_intc_data *b = gc->private;
151+
unsigned long flags;
150152

151-
irq_gc_lock(gc);
153+
irq_gc_lock_irqsave(gc, flags);
152154
if (ct->chip.irq_ack) {
153155
/* Clear unmasked non-wakeup interrupts */
154156
irq_reg_writel(gc, ~b->saved_mask & ~gc->wake_active,
@@ -158,7 +160,7 @@ static void brcmstb_l2_intc_resume(struct irq_data *d)
158160
/* Restore the saved mask */
159161
irq_reg_writel(gc, b->saved_mask, ct->regs.disable);
160162
irq_reg_writel(gc, ~b->saved_mask, ct->regs.enable);
161-
irq_gc_unlock(gc);
163+
irq_gc_unlock_irqrestore(gc, flags);
162164
}
163165

164166
static int __init brcmstb_l2_intc_of_init(struct device_node *np,

‎drivers/irqchip/irq-gic-v3-its.c‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,7 @@ static int its_setup_baser(struct its_node *its, struct its_baser *baser,
17461746
u64 type = GITS_BASER_TYPE(val);
17471747
u64 baser_phys, tmp;
17481748
u32 alloc_pages;
1749+
struct page *page;
17491750
void *base;
17501751

17511752
retry_alloc_baser:
@@ -1758,10 +1759,11 @@ static int its_setup_baser(struct its_node *its, struct its_baser *baser,
17581759
order = get_order(GITS_BASER_PAGES_MAX * psz);
17591760
}
17601761

1761-
base = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, order);
1762-
if (!base)
1762+
page = alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO, order);
1763+
if (!page)
17631764
return -ENOMEM;
17641765

1766+
base = (void *)page_address(page);
17651767
baser_phys = virt_to_phys(base);
17661768

17671769
/* Check if the physical address of the memory is above 48bits */
@@ -1955,6 +1957,8 @@ static int its_alloc_tables(struct its_node *its)
19551957
indirect = its_parse_indirect_baser(its, baser,
19561958
psz, &order,
19571959
its->device_ids);
1960+
break;
1961+
19581962
case GITS_BASER_TYPE_VCPU:
19591963
indirect = its_parse_indirect_baser(its, baser,
19601964
psz, &order,
@@ -2292,7 +2296,8 @@ static struct its_baser *its_get_baser(struct its_node *its, u32 type)
22922296
return NULL;
22932297
}
22942298

2295-
static bool its_alloc_table_entry(struct its_baser *baser, u32 id)
2299+
static bool its_alloc_table_entry(struct its_node *its,
2300+
struct its_baser *baser, u32 id)
22962301
{
22972302
struct page *page;
22982303
u32 esz, idx;
@@ -2312,7 +2317,8 @@ static bool its_alloc_table_entry(struct its_baser *baser, u32 id)
23122317

23132318
/* Allocate memory for 2nd level table */
23142319
if (!table[idx]) {
2315-
page = alloc_pages(GFP_KERNEL | __GFP_ZERO, get_order(baser->psz));
2320+
page = alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO,
2321+
get_order(baser->psz));
23162322
if (!page)
23172323
return false;
23182324

@@ -2343,7 +2349,7 @@ static bool its_alloc_device_table(struct its_node *its, u32 dev_id)
23432349
if (!baser)
23442350
return (ilog2(dev_id) < its->device_ids);
23452351

2346-
return its_alloc_table_entry(baser, dev_id);
2352+
return its_alloc_table_entry(its, baser, dev_id);
23472353
}
23482354

23492355
static bool its_alloc_vpe_table(u32 vpe_id)
@@ -2367,7 +2373,7 @@ static bool its_alloc_vpe_table(u32 vpe_id)
23672373
if (!baser)
23682374
return false;
23692375

2370-
if (!its_alloc_table_entry(baser, vpe_id))
2376+
if (!its_alloc_table_entry(its, baser, vpe_id))
23712377
return false;
23722378
}
23732379

@@ -2401,7 +2407,7 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id,
24012407
nr_ites = max(2, nvecs);
24022408
sz = nr_ites * its->ite_size;
24032409
sz = max(sz, ITS_ITT_ALIGN) + ITS_ITT_ALIGN - 1;
2404-
itt = kzalloc(sz, GFP_KERNEL);
2410+
itt = kzalloc_node(sz, GFP_KERNEL, its->numa_node);
24052411
if (alloc_lpis) {
24062412
lpi_map = its_lpi_alloc(nvecs, &lpi_base, &nr_lpis);
24072413
if (lpi_map)
@@ -3543,6 +3549,7 @@ static int __init its_probe_one(struct resource *res,
35433549
void __iomem *its_base;
35443550
u32 val, ctlr;
35453551
u64 baser, tmp, typer;
3552+
struct page *page;
35463553
int err;
35473554

35483555
its_base = ioremap(res->start, resource_size(res));
@@ -3599,12 +3606,13 @@ static int __init its_probe_one(struct resource *res,
35993606

36003607
its->numa_node = numa_node;
36013608

3602-
its->cmd_base = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
3603-
get_order(ITS_CMD_QUEUE_SZ));
3604-
if (!its->cmd_base) {
3609+
page = alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO,
3610+
get_order(ITS_CMD_QUEUE_SZ));
3611+
if (!page) {
36053612
err = -ENOMEM;
36063613
goto out_free_its;
36073614
}
3615+
its->cmd_base = (void *)page_address(page);
36083616
its->cmd_write = its->cmd_base;
36093617
its->fwnode_handle = handle;
36103618
its->get_msi_base = its_irq_get_msi_base;

‎drivers/irqchip/irq-i8259.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,6 @@ static struct syscore_ops i8259_syscore_ops = {
225225
.shutdown = i8259A_shutdown,
226226
};
227227

228-
static int __init i8259A_init_sysfs(void)
229-
{
230-
register_syscore_ops(&i8259_syscore_ops);
231-
return 0;
232-
}
233-
234-
device_initcall(i8259A_init_sysfs);
235-
236228
static void init_8259A(int auto_eoi)
237229
{
238230
unsigned long flags;
@@ -332,6 +324,7 @@ struct irq_domain * __init __init_i8259_irqs(struct device_node *node)
332324
panic("Failed to add i8259 IRQ domain");
333325

334326
setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2);
327+
register_syscore_ops(&i8259_syscore_ops);
335328
return domain;
336329
}
337330

0 commit comments

Comments
 (0)