diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-08 18:50:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-08 18:50:42 -0400 |
commit | c3e58a7945c8f1e4ec09ef93832a3839c5a70be2 (patch) | |
tree | 2aeb7cc115fed9cf41be6b8f732a3a5917a1c87e | |
parent | 50b4b9c3e84a6ef2ba02e6e41ec221b0c84abf56 (diff) | |
parent | d94ea3f6d21e8b4398285516cc307c81d7374ec9 (diff) |
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
-rw-r--r-- | drivers/irqchip/irq-versatile-fpga.c | 2 | ||||
-rw-r--r-- | drivers/irqchip/irq-vic.c | 2 | ||||
-rw-r--r-- | kernel/irq/irqdomain.c | 9 |
3 files changed, 9 insertions, 4 deletions
diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c index 065b7a31a478..47a52ab580d8 100644 --- a/drivers/irqchip/irq-versatile-fpga.c +++ b/drivers/irqchip/irq-versatile-fpga.c | |||
@@ -119,7 +119,7 @@ static int fpga_irqdomain_map(struct irq_domain *d, unsigned int irq, | |||
119 | 119 | ||
120 | /* Skip invalid IRQs, only register handlers for the real ones */ | 120 | /* Skip invalid IRQs, only register handlers for the real ones */ |
121 | if (!(f->valid & BIT(hwirq))) | 121 | if (!(f->valid & BIT(hwirq))) |
122 | return -ENOTSUPP; | 122 | return -EPERM; |
123 | irq_set_chip_data(irq, f); | 123 | irq_set_chip_data(irq, f); |
124 | irq_set_chip_and_handler(irq, &f->chip, | 124 | irq_set_chip_and_handler(irq, &f->chip, |
125 | handle_level_irq); | 125 | handle_level_irq); |
diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c index 884d11c7355f..2bbb00404cf5 100644 --- a/drivers/irqchip/irq-vic.c +++ b/drivers/irqchip/irq-vic.c | |||
@@ -197,7 +197,7 @@ static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq, | |||
197 | 197 | ||
198 | /* Skip invalid IRQs, only register handlers for the real ones */ | 198 | /* Skip invalid IRQs, only register handlers for the real ones */ |
199 | if (!(v->valid_sources & (1 << hwirq))) | 199 | if (!(v->valid_sources & (1 << hwirq))) |
200 | return -ENOTSUPP; | 200 | return -EPERM; |
201 | irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq); | 201 | irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq); |
202 | irq_set_chip_data(irq, v->base); | 202 | irq_set_chip_data(irq, v->base); |
203 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 203 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); |
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 5a83dde8ca0c..54a4d5223238 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c | |||
@@ -143,7 +143,10 @@ static unsigned int irq_domain_legacy_revmap(struct irq_domain *domain, | |||
143 | * irq_domain_add_simple() - Allocate and register a simple irq_domain. | 143 | * irq_domain_add_simple() - Allocate and register a simple irq_domain. |
144 | * @of_node: pointer to interrupt controller's device tree node. | 144 | * @of_node: pointer to interrupt controller's device tree node. |
145 | * @size: total number of irqs in mapping | 145 | * @size: total number of irqs in mapping |
146 | * @first_irq: first number of irq block assigned to the domain | 146 | * @first_irq: first number of irq block assigned to the domain, |
147 | * pass zero to assign irqs on-the-fly. This will result in a | ||
148 | * linear IRQ domain so it is important to use irq_create_mapping() | ||
149 | * for each used IRQ, especially when SPARSE_IRQ is enabled. | ||
147 | * @ops: map/unmap domain callbacks | 150 | * @ops: map/unmap domain callbacks |
148 | * @host_data: Controller private data pointer | 151 | * @host_data: Controller private data pointer |
149 | * | 152 | * |
@@ -191,6 +194,7 @@ struct irq_domain *irq_domain_add_simple(struct device_node *of_node, | |||
191 | /* A linear domain is the default */ | 194 | /* A linear domain is the default */ |
192 | return irq_domain_add_linear(of_node, size, ops, host_data); | 195 | return irq_domain_add_linear(of_node, size, ops, host_data); |
193 | } | 196 | } |
197 | EXPORT_SYMBOL_GPL(irq_domain_add_simple); | ||
194 | 198 | ||
195 | /** | 199 | /** |
196 | * irq_domain_add_legacy() - Allocate and register a legacy revmap irq_domain. | 200 | * 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, | |||
397 | while (count--) { | 401 | while (count--) { |
398 | int irq = irq_base + count; | 402 | int irq = irq_base + count; |
399 | struct irq_data *irq_data = irq_get_irq_data(irq); | 403 | struct irq_data *irq_data = irq_get_irq_data(irq); |
400 | irq_hw_number_t hwirq = irq_data->hwirq; | 404 | irq_hw_number_t hwirq; |
401 | 405 | ||
402 | if (WARN_ON(!irq_data || irq_data->domain != domain)) | 406 | if (WARN_ON(!irq_data || irq_data->domain != domain)) |
403 | continue; | 407 | continue; |
404 | 408 | ||
409 | hwirq = irq_data->hwirq; | ||
405 | irq_set_status_flags(irq, IRQ_NOREQUEST); | 410 | irq_set_status_flags(irq, IRQ_NOREQUEST); |
406 | 411 | ||
407 | /* remove chip and handler */ | 412 | /* remove chip and handler */ |