From: Stefan Nickl Date: Mon, 5 Sep 2005 06:57:46 +0000 (-0500) Subject: Input: HIDDEV - make HIDIOCSREPORT wait IO completion X-Git-Tag: v2.6.14-rc1~128^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=010988e888a0abbe7118635c1b33d049caae6b29;p=pandora-kernel.git Input: HIDDEV - make HIDIOCSREPORT wait IO completion 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 Signed-off-by: Andrew Morton Signed-off-by: Vojtech Pavlik Signed-off-by: Dmitry Torokhov --- Reading git-diff-tree failed