Even though the IO for devices with "always poll" quirk is already running,
we still need to set HID_OPENED bit in usbhid->iofl so the interrupt
handler does not ignore the data coming from the device.
Reported-by: Olof Johansson <redacted>
Tested-by: Olof Johansson <redacted>
Fixes: e399396a6b0 ("HID: usbhid: remove custom locking from usbhid_open...")
Signed-off-by: Dmitry Torokhov <redacted>
---
drivers/hid/usbhid/hid-core.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
@@ -680,18 +680,21 @@ static int usbhid_open(struct hid_device *hid)structusbhid_device*usbhid=hid->driver_data;intres;+set_bit(HID_OPENED,&usbhid->iofl);+if(hid->quirks&HID_QUIRK_ALWAYS_POLL)return0;res=usb_autopm_get_interface(usbhid->intf);/* the device must be awake to reliably request remote wakeup */-if(res<0)+if(res<0){+clear_bit(HID_OPENED,&usbhid->iofl);return-EIO;+}usbhid->intf->needs_remote_wakeup=1;set_bit(HID_RESUME_RUNNING,&usbhid->iofl);-set_bit(HID_OPENED,&usbhid->iofl);set_bit(HID_IN_POLLING,&usbhid->iofl);res=hid_start_in(hid);
From: Benjamin Tissoires <hidden> Date: 2017-07-21 09:26:23
On Jul 12 2017 or thereabouts, Dmitry Torokhov wrote:
Even though the IO for devices with "always poll" quirk is already running,
we still need to set HID_OPENED bit in usbhid->iofl so the interrupt
handler does not ignore the data coming from the device.
Reported-by: Olof Johansson <redacted>
Tested-by: Olof Johansson <redacted>
Fixes: e399396a6b0 ("HID: usbhid: remove custom locking from usbhid_open...")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
slightly reviewed and
Acked-by: Benjamin Tissoires <redacted>
Cheers,
Benjamin
@@ -680,18 +680,21 @@ static int usbhid_open(struct hid_device *hid)structusbhid_device*usbhid=hid->driver_data;intres;+set_bit(HID_OPENED,&usbhid->iofl);+if(hid->quirks&HID_QUIRK_ALWAYS_POLL)return0;res=usb_autopm_get_interface(usbhid->intf);/* the device must be awake to reliably request remote wakeup */-if(res<0)+if(res<0){+clear_bit(HID_OPENED,&usbhid->iofl);return-EIO;+}usbhid->intf->needs_remote_wakeup=1;set_bit(HID_RESUME_RUNNING,&usbhid->iofl);-set_bit(HID_OPENED,&usbhid->iofl);set_bit(HID_IN_POLLING,&usbhid->iofl);res=hid_start_in(hid);
Even though the IO for devices with "always poll" quirk is already running,
we still need to set HID_OPENED bit in usbhid->iofl so the interrupt
handler does not ignore the data coming from the device.
Reported-by: Olof Johansson <redacted>
Tested-by: Olof Johansson <redacted>
Fixes: e399396a6b0 ("HID: usbhid: remove custom locking from usbhid_open...")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Ah, pitty I've missed this one for the yesterday pull request, sorry for
that. Applied now to for-4.13/upstream-fixes and will be sending upstream
next week.
Thanks,
--
Jiri Kosina
SUSE Labs