Thread (5 messages) flat view 5 messages, 3 authors, 2011-10-08

Re: Race with Bluetooth hid drivers?

From: Bastien Nocera <hadess@hadess.net>
Date: 2011-09-20 18:11:45

On Tue, 2011-09-20 at 11:00 +0200, David Herrmann wrote:
Hi Bastien

On Tue, Sep 20, 2011 at 3:35 AM, Bastien Nocera [off-list ref] wrote:
quoted
Heya,

I'm pretty certain that's already been discussed, but can't seem to find
the thread in question, or whether somebody sent patches for the issue.

The problem I see is that the input device is advertised really early in
its creation, and seems to be missing information when udev (and layers
above it in the stack) probes it.
<snip>
The hid-wacom.c driver should probably use the input_mapped() callback
instead of setting the input flags in wacom_probe(). input_mapped() is
called for every descriptor field so there must at least be one valid
field to make it work. I don't have the device so I can't test it, but
try something like this:

From 2f91a998b1bca4b654903e41394fae19dfed1a3c Mon Sep 17 00:00:00 2001
From: David Herrmann <redacted>
Date: Tue, 20 Sep 2011 10:54:06 +0200
Subject: [PATCH] HID: wacom: Set input bits before registration

We shouldn't change the event flags of input devices after they get registered.
Otherwise, udev will not get notified of these flags and cannot setup the
devices properly.
This fixes the probing to set the input event flags on the input_mapped callback
instead of the probe function.

Reported-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: David Herrmann <redacted>
Works beautifully.
Tested-by: Bastien Nocera <hadess@hadess.net>

Jiri, Dmitry, feel free to add a
Signed-off-by: Bastien Nocera <hadess@hadess.net>
if you think this is the right fix for the problem.

/Bastien, can't even fix his own driver
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help