[PATCH 24/26] HIDDEV - make HIDIOCSREPORT wait IO completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: [PATCH] Input: HIDDEV - make HIDIOCSREPORT wait IO completion
From: Stefan Nickl <[email protected]>
Date: 1125903466 -0500

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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Vojtech Pavlik <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>

---

 drivers/usb/input/hiddev.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

010988e888a0abbe7118635c1b33d049caae6b29
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
--- a/drivers/usb/input/hiddev.c
+++ b/drivers/usb/input/hiddev.c
@@ -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;
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux