]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
HID: cp2112: prevent sleeping function called from invalid context
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Mon, 12 Aug 2019 16:04:44 +0000 (18:04 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 26 Sep 2019 04:34:52 +0000 (00:34 -0400)
commit1ac0415c15bbdd34f475e7a540ade755e9ccd426
tree93f709a0bcbfc2ba08505a68ae64f51c22b58cc9
parent0c0e2385420be60179195d229c691f5c32464033
HID: cp2112: prevent sleeping function called from invalid context

BugLink: https://bugs.launchpad.net/bugs/1843463
[ Upstream commit 2d05dba2b25ecb0f8fc3a0b4eb2232da6454a47b ]

When calling request_threaded_irq() with a CP2112, the function
cp2112_gpio_irq_startup() is called in a IRQ context.

Therefore we can not sleep, and we can not call
cp2112_gpio_direction_input() there.

Move the call to cp2112_gpio_direction_input() earlier to have a working
driver.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hid/hid-cp2112.c