Skip to content

Commit c424a75

Browse files
Marc Zyngiergregkh
authored andcommitted
mfd: Don't use irq_create_mapping() to resolve a mapping
[ Upstream commit 9ff80e2de36d0554e3a6da18a171719fe8663c17 ] 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: Marc Zyngier <maz@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9dd22fb commit c424a75

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/mfd/ab8500-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500,
489489
if (line == AB8540_INT_GPIO43F || line == AB8540_INT_GPIO44F)
490490
line += 1;
491491

492-
handle_nested_irq(irq_create_mapping(ab8500->domain, line));
492+
handle_nested_irq(irq_find_mapping(ab8500->domain, line));
493493
}
494494

495495
return 0;

drivers/mfd/stmpe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ static irqreturn_t stmpe_irq(int irq, void *data)
10331033

10341034
if (variant->id_val == STMPE801_ID ||
10351035
variant->id_val == STMPE1600_ID) {
1036-
int base = irq_create_mapping(stmpe->domain, 0);
1036+
int base = irq_find_mapping(stmpe->domain, 0);
10371037

10381038
handle_nested_irq(base);
10391039
return IRQ_HANDLED;
@@ -1061,7 +1061,7 @@ static irqreturn_t stmpe_irq(int irq, void *data)
10611061
while (status) {
10621062
int bit = __ffs(status);
10631063
int line = bank * 8 + bit;
1064-
int nestedirq = irq_create_mapping(stmpe->domain, line);
1064+
int nestedirq = irq_find_mapping(stmpe->domain, line);
10651065

10661066
handle_nested_irq(nestedirq);
10671067
status &= ~(1 << bit);

drivers/mfd/tc3589x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static irqreturn_t tc3589x_irq(int irq, void *data)
187187

188188
while (status) {
189189
int bit = __ffs(status);
190-
int virq = irq_create_mapping(tc3589x->domain, bit);
190+
int virq = irq_find_mapping(tc3589x->domain, bit);
191191

192192
handle_nested_irq(virq);
193193
status &= ~(1 << bit);

drivers/mfd/wm8994-irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static irqreturn_t wm8994_edge_irq(int irq, void *data)
159159
struct wm8994 *wm8994 = data;
160160

161161
while (gpio_get_value_cansleep(wm8994->pdata.irq_gpio))
162-
handle_nested_irq(irq_create_mapping(wm8994->edge_irq, 0));
162+
handle_nested_irq(irq_find_mapping(wm8994->edge_irq, 0));
163163

164164
return IRQ_HANDLED;
165165
}

0 commit comments

Comments
 (0)