diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-09-13 17:29:09 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-09-25 14:38:24 -0400 |
commit | c942cee46bba761ce97ee6d4fc71892e064e8628 (patch) | |
tree | d6a5563a5ef3ea751e772cc1ff0f7bce5e3b9abd /kernel/irq/manage.c | |
parent | 239306fee8a59beb728faf8f42b13b2250b24841 (diff) |
genirq: Separate activation and startup
Activation of an interrupt and startup are currently a combo
functionlity. That works so far, but upcoming changes require a strict
separation because the activation can fail in future.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Juergen Gross <jgross@suse.com>
Tested-by: Yu Chen <yu.c.chen@intel.com>
Acked-by: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Alok Kataria <akataria@vmware.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Rui Zhang <rui.zhang@intel.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Len Brown <lenb@kernel.org>
Link: https://lkml.kernel.org/r/20170913213152.754334077@linutronix.de
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r-- | kernel/irq/manage.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 0e8b48315f3c..e667912d0e9c 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -519,7 +519,7 @@ void __enable_irq(struct irq_desc *desc) | |||
519 | * time. If it was already started up, then irq_startup() | 519 | * time. If it was already started up, then irq_startup() |
520 | * will invoke irq_enable() under the hood. | 520 | * will invoke irq_enable() under the hood. |
521 | */ | 521 | */ |
522 | irq_startup(desc, IRQ_RESEND, IRQ_START_COND); | 522 | irq_startup(desc, IRQ_RESEND, IRQ_START_FORCE); |
523 | break; | 523 | break; |
524 | } | 524 | } |
525 | default: | 525 | default: |
@@ -1325,6 +1325,21 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) | |||
1325 | goto out_unlock; | 1325 | goto out_unlock; |
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | /* | ||
1329 | * Activate the interrupt. That activation must happen | ||
1330 | * independently of IRQ_NOAUTOEN. request_irq() can fail | ||
1331 | * and the callers are supposed to handle | ||
1332 | * that. enable_irq() of an interrupt requested with | ||
1333 | * IRQ_NOAUTOEN is not supposed to fail. The activation | ||
1334 | * keeps it in shutdown mode, it merily associates | ||
1335 | * resources if necessary and if that's not possible it | ||
1336 | * fails. Interrupts which are in managed shutdown mode | ||
1337 | * will simply ignore that activation request. | ||
1338 | */ | ||
1339 | ret = irq_activate(desc); | ||
1340 | if (ret) | ||
1341 | goto out_unlock; | ||
1342 | |||
1328 | desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \ | 1343 | desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \ |
1329 | IRQS_ONESHOT | IRQS_WAITING); | 1344 | IRQS_ONESHOT | IRQS_WAITING); |
1330 | irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS); | 1345 | irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS); |