HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded
authorDanny Kaehn <kaehndan@gmail.com>
Fri, 10 Feb 2023 17:00:44 +0000 (11:00 -0600)
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>
Thu, 23 Feb 2023 15:45:38 +0000 (16:45 +0100)
The CP2112 generates interrupts from a polling routine on a thread,
and can only support threaded interrupts. This patch configures the
gpiochip irq chip with this flag, disallowing consumers to request
a hard IRQ from this driver, which resulted in a segfault previously.

Signed-off-by: Danny Kaehn <kaehndan@gmail.com>
Link: https://lore.kernel.org/r/20230210170044.11835-1-kaehndan@gmail.com
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
drivers/hid/hid-cp2112.c

index 1e16b0f..27cadad 100644 (file)
@@ -1354,6 +1354,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
        girq->parents = NULL;
        girq->default_type = IRQ_TYPE_NONE;
        girq->handler = handle_simple_irq;
+       girq->threaded = true;
 
        ret = gpiochip_add_data(&dev->gc, dev);
        if (ret < 0) {