* [PATCH] hiddev: output reports are dropped when HIDIOCSREPORT is called in short succession
@ 2005-08-22 9:25 Stefan Nickl
2005-08-22 12:44 ` [linux-usb-devel] " Adam Kropelin
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Nickl @ 2005-08-22 9:25 UTC (permalink / raw)
To: vojtech; +Cc: linux-kernel, trivial, linux-usb-devel
[-- Attachment #1: Type: text/plain, Size: 881 bytes --]
Hi,
when trying to make the hiddev driver issue several Set_Report control
transfers to a custom device with 2.6.13-rc6, only the first transfer in
a row is carried out, while others immediately following it are silently
dropped.
This happens where hid_submit_report() (in hid-core.c) tests for
HID_CTRL_RUNNING, which seems to be still set because the first transfer
is not finished yet.
As a workaround, inserting a delay between the two calls to
ioctl(HIDIOCSREPORT) in userspace "solves" the problem.
The straightforward fix is to add a call to hid_wait_io() to the
implementation of HIDIOCSREPORT (in hiddev.c), just like for
HIDIOCGREPORT. Works fine for me.
Apparently, this issue has some history:
http://marc.theaimsgroup.com/?l=linux-usb-users&m=111100670105558&w=2
Signed-off-by: Stefan Nickl <Stefan.Nickl@kontron.com>
--
Stefan Nickl
Kontron Modular Computers
[-- Attachment #2: hiddev_HIDIOCSREPORT_wait_io.patch --]
[-- Type: text/x-patch, Size: 332 bytes --]
--- v2.6.13-rc6/drivers/usb/input/hiddev.c.orig 2005-08-22 10:56:55.000000000 +0200
+++ v2.6.13-rc6/drivers/usb/input/hiddev.c 2005-08-22 10:57:07.000000000 +0200
@@ -507,6 +507,7 @@ static int hiddev_ioctl(struct inode *in
return -EINVAL;
hid_submit_report(hid, report, USB_DIR_OUT);
+ hid_wait_io(hid);
return 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [linux-usb-devel] [PATCH] hiddev: output reports are dropped when HIDIOCSREPORT is called in short succession
2005-08-22 9:25 [PATCH] hiddev: output reports are dropped when HIDIOCSREPORT is called in short succession Stefan Nickl
@ 2005-08-22 12:44 ` Adam Kropelin
0 siblings, 0 replies; 2+ messages in thread
From: Adam Kropelin @ 2005-08-22 12:44 UTC (permalink / raw)
To: Stefan Nickl, vojtech; +Cc: linux-kernel, trivial, linux-usb-devel
Stefan Nickl wrote:
> Hi,
>
> when trying to make the hiddev driver issue several Set_Report control
> transfers to a custom device with 2.6.13-rc6, only the first transfer
> in a row is carried out, while others immediately following it are
> silently dropped.
>
> This happens where hid_submit_report() (in hid-core.c) tests for
> HID_CTRL_RUNNING, which seems to be still set because the first
> transfer is not finished yet.
>
> As a workaround, inserting a delay between the two calls to
> ioctl(HIDIOCSREPORT) in userspace "solves" the problem.
> The straightforward fix is to add a call to hid_wait_io() to the
> implementation of HIDIOCSREPORT (in hiddev.c), just like for
> HIDIOCGREPORT. Works fine for me.
Yup, I've seen the same issue on the apcupsd project. I added the
hid_wait_io() call to HIDIOCGREPORT a while back since it used to suffer
from the same problem. I'd have no objection to making HIDIOCSREPORT
synchronous as well.
--Adam
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-22 22:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-22 9:25 [PATCH] hiddev: output reports are dropped when HIDIOCSREPORT is called in short succession Stefan Nickl
2005-08-22 12:44 ` [linux-usb-devel] " Adam Kropelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome