Skip to content

Commit dc3115e

Browse files
kaehndBenjamin Tissoires
authored andcommitted
hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip
Previously cp2112_gpio_irq_shutdown() always cancelled the gpio_poll_worker, even if other IRQs were still active, and did not set the gpio_poll flag to false. This resulted in any call to _shutdown() resulting in interrupts no longer functioning on the chip until a _remove() occurred (a.e. the cp2112 is unplugged or system rebooted). Only cancel polling if all IRQs are disabled/masked, and correctly set the gpio_poll flag, allowing polling to restart when an interrupt is next enabled. Signed-off-by: Danny Kaehn <[email protected]> Fixes: 13de9cc ("HID: cp2112: add IRQ chip handling") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent e3c2d2d commit dc3115e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/hid/hid-cp2112.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,11 @@ static void cp2112_gpio_irq_shutdown(struct irq_data *d)
11661166
struct cp2112_device *dev = gpiochip_get_data(gc);
11671167

11681168
cp2112_gpio_irq_mask(d);
1169-
cancel_delayed_work_sync(&dev->gpio_poll_worker);
1169+
1170+
if (!dev->irq_mask) {
1171+
dev->gpio_poll = false;
1172+
cancel_delayed_work_sync(&dev->gpio_poll_worker);
1173+
}
11701174
}
11711175

11721176
static int cp2112_gpio_irq_type(struct irq_data *d, unsigned int type)

0 commit comments

Comments
 (0)