Hi On Fri, Dec 12, 2014 at 6:25 PM, Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote: > On Fri, Dec 12, 2014 at 9:21 AM, David Herrmann <dh.herrmann@xxxxxxxxx> wrote: >> Hi >> >> On Fri, Dec 12, 2014 at 6:18 PM, Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote: >>> On Dec 12, 2014 3:05 AM, "David Herrmann" <dh.herrmann@xxxxxxxxx> wrote: >>>> >>>> So far, the solution is to use hid_device_io_start() and >>>> hid_device_io_stop() in ->probe(). It's a hack to allow I/O during >>>> ->probe(). Maybe your idea is the way to go, but unless someone >>>> implements it, we're stuck with the current code. >>> >>> That should work. >>> >>> For normal HID drivers (those that don't start IO from probe), what >>> happens if userspace starts IO before probe returns? Does the driver >>> code prevent that somehow? >> >> It's only the async hid intr channel that is affected by this. >> User-space cannot trigger any outgoing I/O on the intr channel. Only >> the synchronous ctrl channel via SET_REPORT can be triggered, but due >> to the synchronous nature we always allow I/O on it. >> > > I understand exactly one HID device, and that's U2F. In U2F, > userspace will (directly or indirectly) use SET_REPORT, and the device > responds immediately (ish) using the async intr channel. How does user-space issue SET_REPORT? Via hidraw? hidraw shouldn't be used for anything but debugging right now. The normal hid drivers are managed through hid-input.c, which registers the input devices and syncs it up with its ->probe() function. Most of the hid-xyz.c drivers are just quirks for hid-input.c. If you now invent your own layer on top, you usually don't want hid-input.c. Instead, you register your own user-space API (for instance via cdev_add(), or misc-devices). In those cases, you register your devices from within ->probe() so it is up to you to enable I/O before doing this. I have no idea what user-space API you intend to use. Unfortunately, I don't even know what kind of API U2F actually provides, so I cannot even point you into the right direction. Sorry. (btw., Documentation/hid/hid-transport.txt is an overview of how HID transport layers work) Thanks David -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html