Skip to content

Commit c3e58a7

Browse files
committed
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
2 parents 50b4b9c + d94ea3f commit c3e58a7

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

drivers/irqchip/irq-versatile-fpga.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static int fpga_irqdomain_map(struct irq_domain *d, unsigned int irq,
119119

120120
/* Skip invalid IRQs, only register handlers for the real ones */
121121
if (!(f->valid & BIT(hwirq)))
122-
return -ENOTSUPP;
122+
return -EPERM;
123123
irq_set_chip_data(irq, f);
124124
irq_set_chip_and_handler(irq, &f->chip,
125125
handle_level_irq);

drivers/irqchip/irq-vic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq,
197197

198198
/* Skip invalid IRQs, only register handlers for the real ones */
199199
if (!(v->valid_sources & (1 << hwirq)))
200-
return -ENOTSUPP;
200+
return -EPERM;
201201
irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq);
202202
irq_set_chip_data(irq, v->base);
203203
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);

kernel/irq/irqdomain.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,10 @@ static unsigned int irq_domain_legacy_revmap(struct irq_domain *domain,
143143
* irq_domain_add_simple() - Allocate and register a simple irq_domain.
144144
* @of_node: pointer to interrupt controller's device tree node.
145145
* @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.
147150
* @ops: map/unmap domain callbacks
148151
* @host_data: Controller private data pointer
149152
*
@@ -191,6 +194,7 @@ struct irq_domain *irq_domain_add_simple(struct device_node *of_node,
191194
/* A linear domain is the default */
192195
return irq_domain_add_linear(of_node, size, ops, host_data);
193196
}
197+
EXPORT_SYMBOL_GPL(irq_domain_add_simple);
194198

195199
/**
196200
* 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,
397401
while (count--) {
398402
int irq = irq_base + count;
399403
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;
401405

402406
if (WARN_ON(!irq_data || irq_data->domain != domain))
403407
continue;
404408

409+
hwirq = irq_data->hwirq;
405410
irq_set_status_flags(irq, IRQ_NOREQUEST);
406411

407412
/* remove chip and handler */

0 commit comments

Comments
 (0)