Merge branch 'irq/for-gpio' into irq/core
Merge the request/release callbacks which are in a separate branch for consumption by the gpio folks. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
此提交包含在:
@@ -10,6 +10,7 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/topology.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/slab.h>
|
||||
|
@@ -832,8 +832,7 @@ static irqreturn_t irq_thread_fn(struct irq_desc *desc,
|
||||
|
||||
static void wake_threads_waitq(struct irq_desc *desc)
|
||||
{
|
||||
if (atomic_dec_and_test(&desc->threads_active) &&
|
||||
waitqueue_active(&desc->wait_for_threads))
|
||||
if (atomic_dec_and_test(&desc->threads_active))
|
||||
wake_up(&desc->wait_for_threads);
|
||||
}
|
||||
|
||||
@@ -954,6 +953,23 @@ static void irq_setup_forced_threading(struct irqaction *new)
|
||||
}
|
||||
}
|
||||
|
||||
static int irq_request_resources(struct irq_desc *desc)
|
||||
{
|
||||
struct irq_data *d = &desc->irq_data;
|
||||
struct irq_chip *c = d->chip;
|
||||
|
||||
return c->irq_request_resources ? c->irq_request_resources(d) : 0;
|
||||
}
|
||||
|
||||
static void irq_release_resources(struct irq_desc *desc)
|
||||
{
|
||||
struct irq_data *d = &desc->irq_data;
|
||||
struct irq_chip *c = d->chip;
|
||||
|
||||
if (c->irq_release_resources)
|
||||
c->irq_release_resources(d);
|
||||
}
|
||||
|
||||
/*
|
||||
* Internal function to register an irqaction - typically used to
|
||||
* allocate special interrupts that are part of the architecture.
|
||||
@@ -1149,6 +1165,13 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
|
||||
}
|
||||
|
||||
if (!shared) {
|
||||
ret = irq_request_resources(desc);
|
||||
if (ret) {
|
||||
pr_err("Failed to request resources for %s (irq %d) on irqchip %s\n",
|
||||
new->name, irq, desc->irq_data.chip->name);
|
||||
goto out_mask;
|
||||
}
|
||||
|
||||
init_waitqueue_head(&desc->wait_for_threads);
|
||||
|
||||
/* Setup the type (level, edge polarity) if configured: */
|
||||
@@ -1319,8 +1342,10 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id)
|
||||
*action_ptr = action->next;
|
||||
|
||||
/* If this was the last handler, shut down the IRQ line: */
|
||||
if (!desc->action)
|
||||
if (!desc->action) {
|
||||
irq_shutdown(desc);
|
||||
irq_release_resources(desc);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* make sure affinity_hint is cleaned up */
|
||||
|
新增問題並參考
封鎖使用者