linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded
@ 2023-02-10 17:00 Danny Kaehn
  2023-02-23 16:08 ` Benjamin Tissoires
  0 siblings, 1 reply; 2+ messages in thread
From: Danny Kaehn @ 2023-02-10 17:00 UTC (permalink / raw)
  To: jikos, benjamin.tissoires; +Cc: linux-input, ethan.twardy

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>
---

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(+)

diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index 1e16b0fa310d..27cadadda7c9 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -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) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded
  2023-02-10 17:00 [PATCH] HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded Danny Kaehn
@ 2023-02-23 16:08 ` Benjamin Tissoires
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Tissoires @ 2023-02-23 16:08 UTC (permalink / raw)
  To: jikos, Danny Kaehn; +Cc: linux-input, ethan.twardy

On Fri, 10 Feb 2023 11:00:44 -0600, Danny Kaehn wrote:
> 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,
-- 
Benjamin Tissoires <benjamin.tissoires@redhat.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-23 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10 17:00 [PATCH] HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded Danny Kaehn
2023-02-23 16:08 ` Benjamin Tissoires

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).