Skip to content

Commit 4c4e6ea

Browse files
ISCAS-VulabBartosz Golaszewski
authored andcommitted
gpio: ljca: Fix duplicated IRQ mapping
The generic_handle_domain_irq() function resolves the hardware IRQ internally. The driver performed a duplicative mapping by calling irq_find_mapping() first, which could lead to an RCU stall. Delete the redundant irq_find_mapping() call and pass the hardware IRQ directly to generic_handle_domain_irq(). Fixes: c5a4b6f ("gpio: Add support for Intel LJCA USB GPIO driver") Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Link: https://lore.kernel.org/r/20251023070231.1305-1-vulab@iscas.ac.cn [Bartosz: remove unused variable] Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 5f4bfd0 commit 4c4e6ea

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

drivers/gpio/gpio-ljca.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -286,22 +286,14 @@ static void ljca_gpio_event_cb(void *context, u8 cmd, const void *evt_data,
286286
{
287287
const struct ljca_gpio_packet *packet = evt_data;
288288
struct ljca_gpio_dev *ljca_gpio = context;
289-
int i, irq;
289+
int i;
290290

291291
if (cmd != LJCA_GPIO_INT_EVENT)
292292
return;
293293

294294
for (i = 0; i < packet->num; i++) {
295-
irq = irq_find_mapping(ljca_gpio->gc.irq.domain,
296-
packet->item[i].index);
297-
if (!irq) {
298-
dev_err(ljca_gpio->gc.parent,
299-
"gpio_id %u does not mapped to IRQ yet\n",
300-
packet->item[i].index);
301-
return;
302-
}
303-
304-
generic_handle_domain_irq(ljca_gpio->gc.irq.domain, irq);
295+
generic_handle_domain_irq(ljca_gpio->gc.irq.domain,
296+
packet->item[i].index);
305297
set_bit(packet->item[i].index, ljca_gpio->reenable_irqs);
306298
}
307299

0 commit comments

Comments
 (0)