Commit 9ff80e2d authored by Marc Zyngier's avatar Marc Zyngier Committed by Lee Jones

mfd: Don't use irq_create_mapping() to resolve a mapping

Although irq_create_mapping() is able to deal with duplicate
mappings, it really isn't supposed to be a substitute for
irq_find_mapping(), and can result in allocations that take place
in atomic context if the mapping didn't exist.

Fix the handful of MFD drivers that use irq_create_mapping() in
interrupt context by using irq_find_mapping() instead.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent ab09511f
...@@ -485,7 +485,7 @@ static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500, ...@@ -485,7 +485,7 @@ static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500,
if (line == AB8540_INT_GPIO43F || line == AB8540_INT_GPIO44F) if (line == AB8540_INT_GPIO43F || line == AB8540_INT_GPIO44F)
line += 1; line += 1;
handle_nested_irq(irq_create_mapping(ab8500->domain, line)); handle_nested_irq(irq_find_mapping(ab8500->domain, line));
} }
return 0; return 0;
......
...@@ -1095,7 +1095,7 @@ static irqreturn_t stmpe_irq(int irq, void *data) ...@@ -1095,7 +1095,7 @@ static irqreturn_t stmpe_irq(int irq, void *data)
if (variant->id_val == STMPE801_ID || if (variant->id_val == STMPE801_ID ||
variant->id_val == STMPE1600_ID) { variant->id_val == STMPE1600_ID) {
int base = irq_create_mapping(stmpe->domain, 0); int base = irq_find_mapping(stmpe->domain, 0);
handle_nested_irq(base); handle_nested_irq(base);
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -1123,7 +1123,7 @@ static irqreturn_t stmpe_irq(int irq, void *data) ...@@ -1123,7 +1123,7 @@ static irqreturn_t stmpe_irq(int irq, void *data)
while (status) { while (status) {
int bit = __ffs(status); int bit = __ffs(status);
int line = bank * 8 + bit; int line = bank * 8 + bit;
int nestedirq = irq_create_mapping(stmpe->domain, line); int nestedirq = irq_find_mapping(stmpe->domain, line);
handle_nested_irq(nestedirq); handle_nested_irq(nestedirq);
status &= ~(1 << bit); status &= ~(1 << bit);
......
...@@ -187,7 +187,7 @@ static irqreturn_t tc3589x_irq(int irq, void *data) ...@@ -187,7 +187,7 @@ static irqreturn_t tc3589x_irq(int irq, void *data)
while (status) { while (status) {
int bit = __ffs(status); int bit = __ffs(status);
int virq = irq_create_mapping(tc3589x->domain, bit); int virq = irq_find_mapping(tc3589x->domain, bit);
handle_nested_irq(virq); handle_nested_irq(virq);
status &= ~(1 << bit); status &= ~(1 << bit);
......
...@@ -154,7 +154,7 @@ static irqreturn_t wm8994_edge_irq(int irq, void *data) ...@@ -154,7 +154,7 @@ static irqreturn_t wm8994_edge_irq(int irq, void *data)
struct wm8994 *wm8994 = data; struct wm8994 *wm8994 = data;
while (gpio_get_value_cansleep(wm8994->pdata.irq_gpio)) while (gpio_get_value_cansleep(wm8994->pdata.irq_gpio))
handle_nested_irq(irq_create_mapping(wm8994->edge_irq, 0)); handle_nested_irq(irq_find_mapping(wm8994->edge_irq, 0));
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
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