Commit 30e4c9ad authored by Linus Torvalds's avatar Linus Torvalds

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()
parents f25a96ea c5b63520
...@@ -284,6 +284,7 @@ int platform_msi_domain_alloc_irqs(struct device *dev, unsigned int nvec, ...@@ -284,6 +284,7 @@ int platform_msi_domain_alloc_irqs(struct device *dev, unsigned int nvec,
return err; return err;
} }
EXPORT_SYMBOL_GPL(platform_msi_domain_alloc_irqs);
/** /**
* platform_msi_domain_free_irqs - Free MSI interrupts for @dev * platform_msi_domain_free_irqs - Free MSI interrupts for @dev
...@@ -301,6 +302,7 @@ void platform_msi_domain_free_irqs(struct device *dev) ...@@ -301,6 +302,7 @@ void platform_msi_domain_free_irqs(struct device *dev)
msi_domain_free_irqs(dev->msi_domain, dev); msi_domain_free_irqs(dev->msi_domain, dev);
platform_msi_free_descs(dev, 0, MAX_DEV_MSIS); platform_msi_free_descs(dev, 0, MAX_DEV_MSIS);
} }
EXPORT_SYMBOL_GPL(platform_msi_domain_free_irqs);
/** /**
* platform_msi_get_host_data - Query the private data associated with * platform_msi_get_host_data - Query the private data associated with
......
...@@ -159,6 +159,7 @@ config TB10X_IRQC ...@@ -159,6 +159,7 @@ config TB10X_IRQC
config TS4800_IRQ config TS4800_IRQ
tristate "TS-4800 IRQ controller" tristate "TS-4800 IRQ controller"
select IRQ_DOMAIN select IRQ_DOMAIN
depends on HAS_IOMEM
help help
Support for the TS-4800 FPGA IRQ controller Support for the TS-4800 FPGA IRQ controller
......
...@@ -86,7 +86,7 @@ int aic_common_set_priority(int priority, unsigned *val) ...@@ -86,7 +86,7 @@ int aic_common_set_priority(int priority, unsigned *val)
priority > AT91_AIC_IRQ_MAX_PRIORITY) priority > AT91_AIC_IRQ_MAX_PRIORITY)
return -EINVAL; return -EINVAL;
*val &= AT91_AIC_PRIOR; *val &= ~AT91_AIC_PRIOR;
*val |= priority; *val |= priority;
return 0; return 0;
......
...@@ -875,6 +875,7 @@ static int its_alloc_tables(const char *node_name, struct its_node *its) ...@@ -875,6 +875,7 @@ static int its_alloc_tables(const char *node_name, struct its_node *its)
} }
alloc_size = (1 << order) * PAGE_SIZE; alloc_size = (1 << order) * PAGE_SIZE;
retry_alloc_baser:
alloc_pages = (alloc_size / psz); alloc_pages = (alloc_size / psz);
if (alloc_pages > GITS_BASER_PAGES_MAX) { if (alloc_pages > GITS_BASER_PAGES_MAX) {
alloc_pages = GITS_BASER_PAGES_MAX; alloc_pages = GITS_BASER_PAGES_MAX;
...@@ -938,13 +939,16 @@ static int its_alloc_tables(const char *node_name, struct its_node *its) ...@@ -938,13 +939,16 @@ static int its_alloc_tables(const char *node_name, struct its_node *its)
* size and retry. If we reach 4K, then * size and retry. If we reach 4K, then
* something is horribly wrong... * something is horribly wrong...
*/ */
free_pages((unsigned long)base, order);
its->tables[i] = NULL;
switch (psz) { switch (psz) {
case SZ_16K: case SZ_16K:
psz = SZ_4K; psz = SZ_4K;
goto retry_baser; goto retry_alloc_baser;
case SZ_64K: case SZ_64K:
psz = SZ_16K; psz = SZ_16K;
goto retry_baser; goto retry_alloc_baser;
} }
} }
......
...@@ -241,6 +241,7 @@ static int __init asm9260_of_init(struct device_node *np, ...@@ -241,6 +241,7 @@ static int __init asm9260_of_init(struct device_node *np,
writel(0, icoll_priv.intr + i); writel(0, icoll_priv.intr + i);
icoll_add_domain(np, ASM9260_NUM_IRQS); icoll_add_domain(np, ASM9260_NUM_IRQS);
set_handle_irq(icoll_handle_irq);
return 0; return 0;
} }
......
...@@ -605,7 +605,7 @@ static struct s3c_irq_intc * __init s3c24xx_init_intc(struct device_node *np, ...@@ -605,7 +605,7 @@ static struct s3c_irq_intc * __init s3c24xx_init_intc(struct device_node *np,
return ERR_PTR(ret); return ERR_PTR(ret);
} }
static struct s3c_irq_data init_eint[32] = { static struct s3c_irq_data __maybe_unused init_eint[32] = {
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */ { .type = S3C_IRQTYPE_NONE, }, /* reserved */
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */ { .type = S3C_IRQTYPE_NONE, }, /* reserved */
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */ { .type = S3C_IRQTYPE_NONE, }, /* reserved */
......
...@@ -679,18 +679,6 @@ u32 of_msi_map_rid(struct device *dev, struct device_node *msi_np, u32 rid_in) ...@@ -679,18 +679,6 @@ u32 of_msi_map_rid(struct device *dev, struct device_node *msi_np, u32 rid_in)
return __of_msi_map_rid(dev, &msi_np, rid_in); return __of_msi_map_rid(dev, &msi_np, rid_in);
} }
static struct irq_domain *__of_get_msi_domain(struct device_node *np,
enum irq_domain_bus_token token)
{
struct irq_domain *d;
d = irq_find_matching_host(np, token);
if (!d)
d = irq_find_host(np);
return d;
}
/** /**
* of_msi_map_get_device_domain - Use msi-map to find the relevant MSI domain * of_msi_map_get_device_domain - Use msi-map to find the relevant MSI domain
* @dev: device for which the mapping is to be done. * @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) ...@@ -706,7 +694,7 @@ struct irq_domain *of_msi_map_get_device_domain(struct device *dev, u32 rid)
struct device_node *np = NULL; struct device_node *np = NULL;
__of_msi_map_rid(dev, &np, rid); __of_msi_map_rid(dev, &np, rid);
return __of_get_msi_domain(np, DOMAIN_BUS_PCI_MSI); return irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI);
} }
/** /**
...@@ -730,7 +718,7 @@ struct irq_domain *of_msi_get_domain(struct device *dev, ...@@ -730,7 +718,7 @@ struct irq_domain *of_msi_get_domain(struct device *dev,
/* Check for a single msi-parent property */ /* Check for a single msi-parent property */
msi_np = of_parse_phandle(np, "msi-parent", 0); msi_np = of_parse_phandle(np, "msi-parent", 0);
if (msi_np && !of_property_read_bool(msi_np, "#msi-cells")) { if (msi_np && !of_property_read_bool(msi_np, "#msi-cells")) {
d = __of_get_msi_domain(msi_np, token); d = irq_find_matching_host(msi_np, token);
if (!d) if (!d)
of_node_put(msi_np); of_node_put(msi_np);
return d; return d;
...@@ -744,7 +732,7 @@ struct irq_domain *of_msi_get_domain(struct device *dev, ...@@ -744,7 +732,7 @@ struct irq_domain *of_msi_get_domain(struct device *dev,
while (!of_parse_phandle_with_args(np, "msi-parent", while (!of_parse_phandle_with_args(np, "msi-parent",
"#msi-cells", "#msi-cells",
index, &args)) { index, &args)) {
d = __of_get_msi_domain(args.np, token); d = irq_find_matching_host(args.np, token);
if (d) if (d)
return d; return d;
......
...@@ -70,6 +70,7 @@ struct irq_fwspec { ...@@ -70,6 +70,7 @@ struct irq_fwspec {
*/ */
enum irq_domain_bus_token { enum irq_domain_bus_token {
DOMAIN_BUS_ANY = 0, DOMAIN_BUS_ANY = 0,
DOMAIN_BUS_WIRED,
DOMAIN_BUS_PCI_MSI, DOMAIN_BUS_PCI_MSI,
DOMAIN_BUS_PLATFORM_MSI, DOMAIN_BUS_PLATFORM_MSI,
DOMAIN_BUS_NEXUS, DOMAIN_BUS_NEXUS,
......
...@@ -138,7 +138,8 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc) ...@@ -138,7 +138,8 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc)
unsigned int flags = 0, irq = desc->irq_data.irq; unsigned int flags = 0, irq = desc->irq_data.irq;
struct irqaction *action = desc->action; struct irqaction *action = desc->action;
do { /* action might have become NULL since we dropped the lock */
while (action) {
irqreturn_t res; irqreturn_t res;
trace_irq_handler_entry(irq, action); trace_irq_handler_entry(irq, action);
...@@ -173,7 +174,7 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc) ...@@ -173,7 +174,7 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc)
retval |= res; retval |= res;
action = action->next; action = action->next;
} while (action); }
add_interrupt_randomness(irq, flags); add_interrupt_randomness(irq, flags);
......
...@@ -575,10 +575,15 @@ unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec) ...@@ -575,10 +575,15 @@ unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec)
unsigned int type = IRQ_TYPE_NONE; unsigned int type = IRQ_TYPE_NONE;
int virq; int virq;
if (fwspec->fwnode) if (fwspec->fwnode) {
domain = irq_find_matching_fwnode(fwspec->fwnode, DOMAIN_BUS_ANY); domain = irq_find_matching_fwnode(fwspec->fwnode,
else DOMAIN_BUS_WIRED);
if (!domain)
domain = irq_find_matching_fwnode(fwspec->fwnode,
DOMAIN_BUS_ANY);
} else {
domain = irq_default_domain; domain = irq_default_domain;
}
if (!domain) { if (!domain) {
pr_warn("no irq domain found for %s !\n", pr_warn("no irq domain found for %s !\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment