Skip to contentSkip to conversation

HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded

PATCH Applied Danny Kaehn 2 participants 2 messages Feb 10, 2023 – Feb 23, 2023 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded

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.

---

Note -- this patch was first submitted with the patchset:
"DeviceTree Support for USB-HID Devices and CP2112"

It is now submitted separately upon request, as it is not coupled to the other patches in that series.

 drivers/hid/hid-cp2112.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hid/hid-cp2112.c +1 -0
index 1e16b0fa310d..27cadadda7c9 100644
@@ -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) {
Signature · 1 line
2.25.1
#1 lore raw
Quoted 6 lines · Danny Kaehn

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.

Applied to hid/hid.git (for-6.3/upstream-fixes), thanks!

[1/1] HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded

      https://git.kernel.org/hid/hid/c/37f5b858a665

Cheers,

Signature · 1 line
Benjamin Tissoires <[email protected]>