Skip to content

Commit b6352e2

Browse files
Marc Zyngiergregkh
authored andcommitted
mfd: Don't use irq_create_mapping() to resolve a mapping
[ Upstream commit 9ff80e2 ] 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 aa63866 commit b6352e2

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
@@ -493,7 +493,7 @@ static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500,
493493
if (line == AB8540_INT_GPIO43F || line == AB8540_INT_GPIO44F)
494494
line += 1;
495495

496-
handle_nested_irq(irq_create_mapping(ab8500->domain, line));
496+
handle_nested_irq(irq_find_mapping(ab8500->domain, line));
497497
}
498498

499499
return 0;

‎drivers/mfd/stmpe.c‎

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

10921092
if (variant->id_val == STMPE801_ID ||
10931093
variant->id_val == STMPE1600_ID) {
1094-
int base = irq_create_mapping(stmpe->domain, 0);
1094+
int base = irq_find_mapping(stmpe->domain, 0);
10951095

10961096
handle_nested_irq(base);
10971097
return IRQ_HANDLED;
@@ -1119,7 +1119,7 @@ static irqreturn_t stmpe_irq(int irq, void *data)
11191119
while (status) {
11201120
int bit = __ffs(status);
11211121
int line = bank * 8 + bit;
1122-
int nestedirq = irq_create_mapping(stmpe->domain, line);
1122+
int nestedirq = irq_find_mapping(stmpe->domain, line);
11231123

11241124
handle_nested_irq(nestedirq);
11251125
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
@@ -154,7 +154,7 @@ static irqreturn_t wm8994_edge_irq(int irq, void *data)
154154
struct wm8994 *wm8994 = data;
155155

156156
while (gpio_get_value_cansleep(wm8994->pdata.irq_gpio))
157-
handle_nested_irq(irq_create_mapping(wm8994->edge_irq, 0));
157+
handle_nested_irq(irq_find_mapping(wm8994->edge_irq, 0));
158158

159159
return IRQ_HANDLED;
160160
}

0 commit comments

Comments
 (0)