Skip to content

Commit a324ca9

Browse files
committed
Merge tag 'irqchip-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core
Pull irqchip updates from Marc Zyngier - Core pseudo-NMI handling code - Allow the default irq domain to be retrieved - 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 - A handful of other fixes (i8259, GICv3, PLIC)
2 parents 4e6b26d + 28528fc commit a324ca9

20 files changed

Lines changed: 964 additions & 101 deletions

File tree

‎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
@@ -1737,6 +1737,7 @@ static int its_setup_baser(struct its_node *its, struct its_baser *baser,
17371737
u64 type = GITS_BASER_TYPE(val);
17381738
u64 baser_phys, tmp;
17391739
u32 alloc_pages;
1740+
struct page *page;
17401741
void *base;
17411742

17421743
retry_alloc_baser:
@@ -1749,10 +1750,11 @@ static int its_setup_baser(struct its_node *its, struct its_baser *baser,
17491750
order = get_order(GITS_BASER_PAGES_MAX * psz);
17501751
}
17511752

1752-
base = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, order);
1753-
if (!base)
1753+
page = alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO, order);
1754+
if (!page)
17541755
return -ENOMEM;
17551756

1757+
base = (void *)page_address(page);
17561758
baser_phys = virt_to_phys(base);
17571759

17581760
/* Check if the physical address of the memory is above 48bits */
@@ -1946,6 +1948,8 @@ static int its_alloc_tables(struct its_node *its)
19461948
indirect = its_parse_indirect_baser(its, baser,
19471949
psz, &order,
19481950
its->device_ids);
1951+
break;
1952+
19491953
case GITS_BASER_TYPE_VCPU:
19501954
indirect = its_parse_indirect_baser(its, baser,
19511955
psz, &order,
@@ -2236,7 +2240,8 @@ static struct its_baser *its_get_baser(struct its_node *its, u32 type)
22362240
return NULL;
22372241
}
22382242

2239-
static bool its_alloc_table_entry(struct its_baser *baser, u32 id)
2243+
static bool its_alloc_table_entry(struct its_node *its,
2244+
struct its_baser *baser, u32 id)
22402245
{
22412246
struct page *page;
22422247
u32 esz, idx;
@@ -2256,7 +2261,8 @@ static bool its_alloc_table_entry(struct its_baser *baser, u32 id)
22562261

22572262
/* Allocate memory for 2nd level table */
22582263
if (!table[idx]) {
2259-
page = alloc_pages(GFP_KERNEL | __GFP_ZERO, get_order(baser->psz));
2264+
page = alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO,
2265+
get_order(baser->psz));
22602266
if (!page)
22612267
return false;
22622268

@@ -2287,7 +2293,7 @@ static bool its_alloc_device_table(struct its_node *its, u32 dev_id)
22872293
if (!baser)
22882294
return (ilog2(dev_id) < its->device_ids);
22892295

2290-
return its_alloc_table_entry(baser, dev_id);
2296+
return its_alloc_table_entry(its, baser, dev_id);
22912297
}
22922298

22932299
static bool its_alloc_vpe_table(u32 vpe_id)
@@ -2311,7 +2317,7 @@ static bool its_alloc_vpe_table(u32 vpe_id)
23112317
if (!baser)
23122318
return false;
23132319

2314-
if (!its_alloc_table_entry(baser, vpe_id))
2320+
if (!its_alloc_table_entry(its, baser, vpe_id))
23152321
return false;
23162322
}
23172323

@@ -2345,7 +2351,7 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id,
23452351
nr_ites = max(2, nvecs);
23462352
sz = nr_ites * its->ite_size;
23472353
sz = max(sz, ITS_ITT_ALIGN) + ITS_ITT_ALIGN - 1;
2348-
itt = kzalloc(sz, GFP_KERNEL);
2354+
itt = kzalloc_node(sz, GFP_KERNEL, its->numa_node);
23492355
if (alloc_lpis) {
23502356
lpi_map = its_lpi_alloc(nvecs, &lpi_base, &nr_lpis);
23512357
if (lpi_map)
@@ -3487,6 +3493,7 @@ static int __init its_probe_one(struct resource *res,
34873493
void __iomem *its_base;
34883494
u32 val, ctlr;
34893495
u64 baser, tmp, typer;
3496+
struct page *page;
34903497
int err;
34913498

34923499
its_base = ioremap(res->start, resource_size(res));
@@ -3542,12 +3549,13 @@ static int __init its_probe_one(struct resource *res,
35423549

35433550
its->numa_node = numa_node;
35443551

3545-
its->cmd_base = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
3546-
get_order(ITS_CMD_QUEUE_SZ));
3547-
if (!its->cmd_base) {
3552+
page = alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO,
3553+
get_order(ITS_CMD_QUEUE_SZ));
3554+
if (!page) {
35483555
err = -ENOMEM;
35493556
goto out_free_its;
35503557
}
3558+
its->cmd_base = (void *)page_address(page);
35513559
its->cmd_write = its->cmd_base;
35523560
its->fwnode_handle = handle;
35533561
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)