irqdomain bug fixes for v3.10-rc4

This branch contains a set of straight forward bug fixes to the
 irqdomain code and to a couple of drivers that make use of it.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJRs51nAAoJEEFnBt12D9kBmnUP/RCgaTn5biRD0tC6OCGwvsZr
 YKypc71cZtbO3CTk1Sw2jgDUoW+2FWwtbwKWCmrHIaulRuxoeMHLbpc6fEGFRAjG
 ENnSEuSJkYV2T5ZoYjM5mAjotHUcszxZ9uOz7ovCUY72GO/+tfJ97NT9+CCpPfWV
 Wa/i08/91UPbWP1ASfMLXVzqO9uqEYvrrvY2PSqJ/g0BkzbybAg38u6IycZkGW4u
 /mjglx5fYRhcQgl7o1FDaw97AGjbykt2mgP7EK3R24BxvEy4gmn4IzGo9duOf7Y2
 b1tEfro/keRoibuKehPWdKTvpda80DUJjrsOwmNveZHTWlSB8GZXqCEmOmTHngrV
 gNX6MUVZClUvKiQCDo3ibyZUmIuUnnlRee6WqQzr2VsMiwct449Gg81zwXX+Yn7O
 5KOnlyicJur3f4HqQSKEA2CXU6RRCmk2iqCFMqtutxy20cmm3LoW7OM7rFF7tzix
 g6czKZiX+yKwoP2E2EQ2mYM8cirKeEyPhs4EUnKJJOVVZqOCtHkrKnkbSoithsS3
 we6Isj8KM8NQ3fgeFsbcxV+ezK3moIzD0fYr3Q6x25VZLYrYH7XpUix0nlGYxCOK
 vlEpCaMes/IG/+SKElf8fPoxs0qlOYPvYZBrLjUGCG/VB01bNsj0mjKYm1va+f6v
 n3zQbGS7X+TiiHQ+EFL0
 =wZCk
 -----END PGP SIGNATURE-----

Merge tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux

Pull irqdomain bug fixes from Grant Likely:
 "This branch contains a set of straight forward bug fixes to the
  irqdomain code and to a couple of drivers that make use of it."

* tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux:
  irqchip: Return -EPERM for reserved IRQs
  irqdomain: document the simple domain first_irq
  kernel/irq/irqdomain.c: before use 'irq_data', need check it whether valid.
  irqdomain: export irq_domain_add_simple
This commit is contained in:
Linus Torvalds 2013-06-08 15:50:42 -07:00
commit c3e58a7945
3 changed files with 9 additions and 4 deletions

View File

@ -119,7 +119,7 @@ static int fpga_irqdomain_map(struct irq_domain *d, unsigned int irq,
/* Skip invalid IRQs, only register handlers for the real ones */ /* Skip invalid IRQs, only register handlers for the real ones */
if (!(f->valid & BIT(hwirq))) if (!(f->valid & BIT(hwirq)))
return -ENOTSUPP; return -EPERM;
irq_set_chip_data(irq, f); irq_set_chip_data(irq, f);
irq_set_chip_and_handler(irq, &f->chip, irq_set_chip_and_handler(irq, &f->chip,
handle_level_irq); handle_level_irq);

View File

@ -197,7 +197,7 @@ static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq,
/* Skip invalid IRQs, only register handlers for the real ones */ /* Skip invalid IRQs, only register handlers for the real ones */
if (!(v->valid_sources & (1 << hwirq))) if (!(v->valid_sources & (1 << hwirq)))
return -ENOTSUPP; return -EPERM;
irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq); irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq);
irq_set_chip_data(irq, v->base); irq_set_chip_data(irq, v->base);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);

View File

@ -143,7 +143,10 @@ static unsigned int irq_domain_legacy_revmap(struct irq_domain *domain,
* irq_domain_add_simple() - Allocate and register a simple irq_domain. * irq_domain_add_simple() - Allocate and register a simple irq_domain.
* @of_node: pointer to interrupt controller's device tree node. * @of_node: pointer to interrupt controller's device tree node.
* @size: total number of irqs in mapping * @size: total number of irqs in mapping
* @first_irq: first number of irq block assigned to the domain * @first_irq: first number of irq block assigned to the domain,
* pass zero to assign irqs on-the-fly. This will result in a
* linear IRQ domain so it is important to use irq_create_mapping()
* for each used IRQ, especially when SPARSE_IRQ is enabled.
* @ops: map/unmap domain callbacks * @ops: map/unmap domain callbacks
* @host_data: Controller private data pointer * @host_data: Controller private data pointer
* *
@ -191,6 +194,7 @@ struct irq_domain *irq_domain_add_simple(struct device_node *of_node,
/* A linear domain is the default */ /* A linear domain is the default */
return irq_domain_add_linear(of_node, size, ops, host_data); return irq_domain_add_linear(of_node, size, ops, host_data);
} }
EXPORT_SYMBOL_GPL(irq_domain_add_simple);
/** /**
* irq_domain_add_legacy() - Allocate and register a legacy revmap irq_domain. * irq_domain_add_legacy() - Allocate and register a legacy revmap irq_domain.
@ -397,11 +401,12 @@ static void irq_domain_disassociate_many(struct irq_domain *domain,
while (count--) { while (count--) {
int irq = irq_base + count; int irq = irq_base + count;
struct irq_data *irq_data = irq_get_irq_data(irq); struct irq_data *irq_data = irq_get_irq_data(irq);
irq_hw_number_t hwirq = irq_data->hwirq; irq_hw_number_t hwirq;
if (WARN_ON(!irq_data || irq_data->domain != domain)) if (WARN_ON(!irq_data || irq_data->domain != domain))
continue; continue;
hwirq = irq_data->hwirq;
irq_set_status_flags(irq, IRQ_NOREQUEST); irq_set_status_flags(irq, IRQ_NOREQUEST);
/* remove chip and handler */ /* remove chip and handler */