Skip to content

Commit afa8443

Browse files
committed
Merge tag 'irq-urgent-2026-03-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irqchip driver fixes from Ingo Molnar: - Fix frozen interrupt bug in the sifive-plic driver - Limit per-device MSI interrupts on uncommon gic-v3-its hardware variants - Address Sparse warning by constifying a variable in the MMP driver - Revert broken commit and also fix an error check in the ls-extirq driver * tag 'irq-urgent-2026-03-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/ls-extirq: Fix devm_of_iomap() error check Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator" irqchip/mmp: Make icu_irq_chip variable static const irqchip/gic-v3-its: Limit number of per-device MSIs to the range the ITS supports irqchip/sifive-plic: Fix frozen interrupt due to affinity setting
2 parents 39c6332 + fe5669e commit afa8443

File tree

5 files changed

+46
-21
lines changed

5 files changed

+46
-21
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,6 +3474,7 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id,
34743474
int lpi_base;
34753475
int nr_lpis;
34763476
int nr_ites;
3477+
int id_bits;
34773478
int sz;
34783479

34793480
if (!its_alloc_device_table(its, dev_id))
@@ -3485,7 +3486,10 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id,
34853486
/*
34863487
* Even if the device wants a single LPI, the ITT must be
34873488
* sized as a power of two (and you need at least one bit...).
3489+
* Also honor the ITS's own EID limit.
34883490
*/
3491+
id_bits = FIELD_GET(GITS_TYPER_IDBITS, its->typer) + 1;
3492+
nvecs = min_t(unsigned int, nvecs, BIT(id_bits));
34893493
nr_ites = max(2, nvecs);
34903494
sz = nr_ites * (FIELD_GET(GITS_TYPER_ITT_ENTRY_SIZE, its->typer) + 1);
34913495
sz = max(sz, ITS_ITT_ALIGN);

drivers/irqchip/irq-ls-extirq.c

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -125,32 +125,45 @@ static const struct irq_domain_ops extirq_domain_ops = {
125125
static int
126126
ls_extirq_parse_map(struct ls_extirq_data *priv, struct device_node *node)
127127
{
128-
struct of_imap_parser imap_parser;
129-
struct of_imap_item imap_item;
128+
const __be32 *map;
129+
u32 mapsize;
130130
int ret;
131131

132-
ret = of_imap_parser_init(&imap_parser, node, &imap_item);
133-
if (ret)
134-
return ret;
132+
map = of_get_property(node, "interrupt-map", &mapsize);
133+
if (!map)
134+
return -ENOENT;
135+
if (mapsize % sizeof(*map))
136+
return -EINVAL;
137+
mapsize /= sizeof(*map);
135138

136-
for_each_of_imap_item(&imap_parser, &imap_item) {
139+
while (mapsize) {
137140
struct device_node *ipar;
138-
u32 hwirq;
139-
int i;
141+
u32 hwirq, intsize, j;
140142

141-
hwirq = imap_item.child_imap[0];
142-
if (hwirq >= MAXIRQ) {
143-
of_node_put(imap_item.parent_args.np);
143+
if (mapsize < 3)
144+
return -EINVAL;
145+
hwirq = be32_to_cpup(map);
146+
if (hwirq >= MAXIRQ)
144147
return -EINVAL;
145-
}
146148
priv->nirq = max(priv->nirq, hwirq + 1);
147149

148-
ipar = of_node_get(imap_item.parent_args.np);
149-
priv->map[hwirq].fwnode = of_fwnode_handle(ipar);
150+
ipar = of_find_node_by_phandle(be32_to_cpup(map + 2));
151+
map += 3;
152+
mapsize -= 3;
153+
if (!ipar)
154+
return -EINVAL;
155+
priv->map[hwirq].fwnode = &ipar->fwnode;
156+
ret = of_property_read_u32(ipar, "#interrupt-cells", &intsize);
157+
if (ret)
158+
return ret;
150159

151-
priv->map[hwirq].param_count = imap_item.parent_args.args_count;
152-
for (i = 0; i < priv->map[hwirq].param_count; i++)
153-
priv->map[hwirq].param[i] = imap_item.parent_args.args[i];
160+
if (intsize > mapsize)
161+
return -EINVAL;
162+
163+
priv->map[hwirq].param_count = intsize;
164+
for (j = 0; j < intsize; ++j)
165+
priv->map[hwirq].param[j] = be32_to_cpup(map++);
166+
mapsize -= intsize;
154167
}
155168
return 0;
156169
}
@@ -177,8 +190,10 @@ static int ls_extirq_probe(struct platform_device *pdev)
177190
return dev_err_probe(dev, -ENOMEM, "Failed to allocate memory\n");
178191

179192
priv->intpcr = devm_of_iomap(dev, node, 0, NULL);
180-
if (!priv->intpcr)
181-
return dev_err_probe(dev, -ENOMEM, "Cannot ioremap OF node %pOF\n", node);
193+
if (IS_ERR(priv->intpcr)) {
194+
return dev_err_probe(dev, PTR_ERR(priv->intpcr),
195+
"Cannot ioremap OF node %pOF\n", node);
196+
}
182197

183198
ret = ls_extirq_parse_map(priv, node);
184199
if (ret)

drivers/irqchip/irq-mmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static void icu_unmask_irq(struct irq_data *d)
136136
}
137137
}
138138

139-
struct irq_chip icu_irq_chip = {
139+
static const struct irq_chip icu_irq_chip = {
140140
.name = "icu_irq",
141141
.irq_mask = icu_mask_irq,
142142
.irq_mask_ack = icu_mask_ack_irq,

drivers/irqchip/irq-sifive-plic.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,13 @@ static void plic_irq_disable(struct irq_data *d)
172172
static void plic_irq_eoi(struct irq_data *d)
173173
{
174174
struct plic_handler *handler = this_cpu_ptr(&plic_handlers);
175+
u32 __iomem *reg;
176+
bool enabled;
177+
178+
reg = handler->enable_base + (d->hwirq / 32) * sizeof(u32);
179+
enabled = readl(reg) & BIT(d->hwirq % 32);
175180

176-
if (unlikely(irqd_irq_disabled(d))) {
181+
if (unlikely(!enabled)) {
177182
plic_toggle(handler, d->hwirq, 1);
178183
writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
179184
plic_toggle(handler, d->hwirq, 0);

include/linux/irqchip/arm-gic-v3.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@
394394
#define GITS_TYPER_VLPIS (1UL << 1)
395395
#define GITS_TYPER_ITT_ENTRY_SIZE_SHIFT 4
396396
#define GITS_TYPER_ITT_ENTRY_SIZE GENMASK_ULL(7, 4)
397+
#define GITS_TYPER_IDBITS GENMASK_ULL(12, 8)
397398
#define GITS_TYPER_IDBITS_SHIFT 8
398399
#define GITS_TYPER_DEVBITS_SHIFT 13
399400
#define GITS_TYPER_DEVBITS GENMASK_ULL(17, 13)

0 commit comments

Comments
 (0)