Skip to content

Commit

Permalink
HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Danny Kaehn authored and Benjamin Tissoires committed Feb 23, 2023
1 parent 22ef7d7 commit 37f5b85
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/hid/hid-cp2112.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 37f5b85

Please sign in to comment.