Commit 708d174b authored by Thomas Gleixner's avatar Thomas Gleixner

genirq: Split out irq_startup() code

Split out the inner workings of irq_startup() so it can be reused to handle
managed interrupts gracefully.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Link: http://lkml.kernel.org/r/20170619235447.033235144@linutronix.de
parent 54fdf6a0
...@@ -195,6 +195,23 @@ static void irq_state_set_started(struct irq_desc *desc) ...@@ -195,6 +195,23 @@ static void irq_state_set_started(struct irq_desc *desc)
irqd_set(&desc->irq_data, IRQD_IRQ_STARTED); irqd_set(&desc->irq_data, IRQD_IRQ_STARTED);
} }
static int __irq_startup(struct irq_desc *desc)
{
struct irq_data *d = irq_desc_get_irq_data(desc);
int ret = 0;
irq_domain_activate_irq(d);
if (d->chip->irq_startup) {
ret = d->chip->irq_startup(d);
irq_state_clr_disabled(desc);
irq_state_clr_masked(desc);
} else {
irq_enable(desc);
}
irq_state_set_started(desc);
return ret;
}
int irq_startup(struct irq_desc *desc, bool resend) int irq_startup(struct irq_desc *desc, bool resend)
{ {
int ret = 0; int ret = 0;
...@@ -204,19 +221,9 @@ int irq_startup(struct irq_desc *desc, bool resend) ...@@ -204,19 +221,9 @@ int irq_startup(struct irq_desc *desc, bool resend)
if (irqd_is_started(&desc->irq_data)) { if (irqd_is_started(&desc->irq_data)) {
irq_enable(desc); irq_enable(desc);
} else { } else {
irq_domain_activate_irq(&desc->irq_data); ret = __irq_startup(desc);
if (desc->irq_data.chip->irq_startup) {
ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
irq_state_clr_disabled(desc);
irq_state_clr_masked(desc);
} else {
irq_enable(desc);
}
irq_state_set_started(desc);
/* Set default affinity mask once everything is setup */
irq_setup_affinity(desc); irq_setup_affinity(desc);
} }
if (resend) if (resend)
check_irq_resend(desc); check_irq_resend(desc);
......
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