Skip to content

Commit 30e4c9a

Browse files
committed
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull IRQ fixes from Ingo Molnar: "Mostly irqchip driver fixes, but also an irq core crash fix and a build fix" * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/mxs: Add missing set_handle_irq() irqchip/atmel-aic: Fix wrong bit operation for IRQ priority irqchip/gic-v3-its: Recompute the number of pages on page size change base: Export platform_msi_domain_[alloc,free]_irqs of: MSI: Simplify irqdomain lookup irqdomain: Allow domain lookup with DOMAIN_BUS_WIRED token irqchip: Fix dependencies for archs w/o HAS_IOMEM irqchip/s3c24xx: Mark init_eint as __maybe_unused genirq: Validate action before dereferencing it in handle_irq_event_percpu()
2 parents f25a96e + c5b6352 commit 30e4c9a

File tree

10 files changed

+27
-24
lines changed

10 files changed

+27
-24
lines changed

drivers/base/platform-msi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ int platform_msi_domain_alloc_irqs(struct device *dev, unsigned int nvec,
284284

285285
return err;
286286
}
287+
EXPORT_SYMBOL_GPL(platform_msi_domain_alloc_irqs);
287288

288289
/**
289290
* platform_msi_domain_free_irqs - Free MSI interrupts for @dev
@@ -301,6 +302,7 @@ void platform_msi_domain_free_irqs(struct device *dev)
301302
msi_domain_free_irqs(dev->msi_domain, dev);
302303
platform_msi_free_descs(dev, 0, MAX_DEV_MSIS);
303304
}
305+
EXPORT_SYMBOL_GPL(platform_msi_domain_free_irqs);
304306

305307
/**
306308
* platform_msi_get_host_data - Query the private data associated with

drivers/irqchip/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ config TB10X_IRQC
159159
config TS4800_IRQ
160160
tristate "TS-4800 IRQ controller"
161161
select IRQ_DOMAIN
162+
depends on HAS_IOMEM
162163
help
163164
Support for the TS-4800 FPGA IRQ controller
164165

drivers/irqchip/irq-atmel-aic-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int aic_common_set_priority(int priority, unsigned *val)
8686
priority > AT91_AIC_IRQ_MAX_PRIORITY)
8787
return -EINVAL;
8888

89-
*val &= AT91_AIC_PRIOR;
89+
*val &= ~AT91_AIC_PRIOR;
9090
*val |= priority;
9191

9292
return 0;

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ static int its_alloc_tables(const char *node_name, struct its_node *its)
875875
}
876876

877877
alloc_size = (1 << order) * PAGE_SIZE;
878+
retry_alloc_baser:
878879
alloc_pages = (alloc_size / psz);
879880
if (alloc_pages > GITS_BASER_PAGES_MAX) {
880881
alloc_pages = GITS_BASER_PAGES_MAX;
@@ -938,13 +939,16 @@ static int its_alloc_tables(const char *node_name, struct its_node *its)
938939
* size and retry. If we reach 4K, then
939940
* something is horribly wrong...
940941
*/
942+
free_pages((unsigned long)base, order);
943+
its->tables[i] = NULL;
944+
941945
switch (psz) {
942946
case SZ_16K:
943947
psz = SZ_4K;
944-
goto retry_baser;
948+
goto retry_alloc_baser;
945949
case SZ_64K:
946950
psz = SZ_16K;
947-
goto retry_baser;
951+
goto retry_alloc_baser;
948952
}
949953
}
950954

drivers/irqchip/irq-mxs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ static int __init asm9260_of_init(struct device_node *np,
241241
writel(0, icoll_priv.intr + i);
242242

243243
icoll_add_domain(np, ASM9260_NUM_IRQS);
244+
set_handle_irq(icoll_handle_irq);
244245

245246
return 0;
246247
}

drivers/irqchip/irq-s3c24xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ static struct s3c_irq_intc * __init s3c24xx_init_intc(struct device_node *np,
605605
return ERR_PTR(ret);
606606
}
607607

608-
static struct s3c_irq_data init_eint[32] = {
608+
static struct s3c_irq_data __maybe_unused init_eint[32] = {
609609
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */
610610
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */
611611
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */

drivers/of/irq.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -679,18 +679,6 @@ u32 of_msi_map_rid(struct device *dev, struct device_node *msi_np, u32 rid_in)
679679
return __of_msi_map_rid(dev, &msi_np, rid_in);
680680
}
681681

682-
static struct irq_domain *__of_get_msi_domain(struct device_node *np,
683-
enum irq_domain_bus_token token)
684-
{
685-
struct irq_domain *d;
686-
687-
d = irq_find_matching_host(np, token);
688-
if (!d)
689-
d = irq_find_host(np);
690-
691-
return d;
692-
}
693-
694682
/**
695683
* of_msi_map_get_device_domain - Use msi-map to find the relevant MSI domain
696684
* @dev: device for which the mapping is to be done.
@@ -706,7 +694,7 @@ struct irq_domain *of_msi_map_get_device_domain(struct device *dev, u32 rid)
706694
struct device_node *np = NULL;
707695

708696
__of_msi_map_rid(dev, &np, rid);
709-
return __of_get_msi_domain(np, DOMAIN_BUS_PCI_MSI);
697+
return irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI);
710698
}
711699

712700
/**
@@ -730,7 +718,7 @@ struct irq_domain *of_msi_get_domain(struct device *dev,
730718
/* Check for a single msi-parent property */
731719
msi_np = of_parse_phandle(np, "msi-parent", 0);
732720
if (msi_np && !of_property_read_bool(msi_np, "#msi-cells")) {
733-
d = __of_get_msi_domain(msi_np, token);
721+
d = irq_find_matching_host(msi_np, token);
734722
if (!d)
735723
of_node_put(msi_np);
736724
return d;
@@ -744,7 +732,7 @@ struct irq_domain *of_msi_get_domain(struct device *dev,
744732
while (!of_parse_phandle_with_args(np, "msi-parent",
745733
"#msi-cells",
746734
index, &args)) {
747-
d = __of_get_msi_domain(args.np, token);
735+
d = irq_find_matching_host(args.np, token);
748736
if (d)
749737
return d;
750738

include/linux/irqdomain.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ struct irq_fwspec {
7070
*/
7171
enum irq_domain_bus_token {
7272
DOMAIN_BUS_ANY = 0,
73+
DOMAIN_BUS_WIRED,
7374
DOMAIN_BUS_PCI_MSI,
7475
DOMAIN_BUS_PLATFORM_MSI,
7576
DOMAIN_BUS_NEXUS,

kernel/irq/handle.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc)
138138
unsigned int flags = 0, irq = desc->irq_data.irq;
139139
struct irqaction *action = desc->action;
140140

141-
do {
141+
/* action might have become NULL since we dropped the lock */
142+
while (action) {
142143
irqreturn_t res;
143144

144145
trace_irq_handler_entry(irq, action);
@@ -173,7 +174,7 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc)
173174

174175
retval |= res;
175176
action = action->next;
176-
} while (action);
177+
}
177178

178179
add_interrupt_randomness(irq, flags);
179180

kernel/irq/irqdomain.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,15 @@ unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec)
575575
unsigned int type = IRQ_TYPE_NONE;
576576
int virq;
577577

578-
if (fwspec->fwnode)
579-
domain = irq_find_matching_fwnode(fwspec->fwnode, DOMAIN_BUS_ANY);
580-
else
578+
if (fwspec->fwnode) {
579+
domain = irq_find_matching_fwnode(fwspec->fwnode,
580+
DOMAIN_BUS_WIRED);
581+
if (!domain)
582+
domain = irq_find_matching_fwnode(fwspec->fwnode,
583+
DOMAIN_BUS_ANY);
584+
} else {
581585
domain = irq_default_domain;
586+
}
582587

583588
if (!domain) {
584589
pr_warn("no irq domain found for %s !\n",

0 commit comments

Comments
 (0)