[PATCH] do not feed keyboard device path in X devd backend
Alex Kozlov
spam at rm-rf.kiev.ua
Thu Feb 13 16:28:25 UTC 2014
On Thu, Feb 13, 2014 at 04:00:09PM +0000, Robert Millan wrote:
> On 09/02/2014 10:26, Alex Kozlov wrote:
> > On Sat, Feb 08, 2014 at 02:00:06PM +0000, Robert Millan wrote:
> >> On 08/02/2014 13:54, Alex Kozlov wrote:
> >>>> Here's a patch that implements the same behaviour with devd. I've verified
> >>>> that attaching/detaching a second keyboard no longer causes this ill effect.
> >>> Can you please check if devd patch from xorg-dev work for you?
> >>> http://trillian.chruetertee.ch/ports/browser/trunk/x11-servers/xorg-server/files/extra-devd
> >>
> >> My patches are precisely against this file (devd.c). The pristine code doesn't work, but
> >> with the collection of fixes I just sent everything is working fine here (been using that
> >> for one week or so).
> > Can you please provide Xorg.x.log before and after applying this patch?
> Here.
>
> Note that both versions are patched (the double-free fixes are a must). Their only difference
> is that "devd+full" includes this patch, and "devd+half" doesn't.
>
> The logs correspond each to the following sequence of events:
>
> - USB keyboard and mouse are connected.
> - X starts.
> - USB keyboard is detached.
> - USB keyboard is attached.
> - X stops.
>
> In this sequence, with "devd+half" keyboard didn't work at all (at any point) because of the
> failed open() attempts, whereas with "devd+full" it worked every time (as long as it was attached,
> of course).
>
> I'm also attaching a diff obtained with a bit of sed magic to discard the irrelevant timestamp
> differences. This should make them easier to compare.
I think you're using old / mismerged devd patch.
> [ 1001.996] (WW) Hotplugging requested but the server was compiled without a config backend. No input devices were configured, the server will start without any input devices.
This line should be like:
[ 11.681] (II) The server relies on devd to provide the list of input devices.
If no devices become available, reconfigure devd or disable AutoAddDevices.
> [ 1002.547] (EE) Keyboard: cannot open "/dev/ukbd0"
> [ 1002.547] (EE) PreInit returned 8 for "Keyboard"
> [ 1002.547] (II) UnloadModule: "kbd"
This should be worked around by the next code:
269 + if (attrs.flags & ATTR_KEYBOARD) {
270 + /*
271 + * Don't pass device option if keyboard is attached to console (open fails),
272 + * thus activating special logic in xf86-input-keyboard.
273 + */
274 + fd = open(path, O_RDONLY | O_NONBLOCK | O_EXCL);
275 + if (fd > 0) {
276 + close(fd);
277 + options = input_option_new(options, "device", path);
278 + }
279 + } else {
280 + options = input_option_new(options, "device", path);
281 + }
> [ 1002.547] (II) config/devd: Adding input device Keyboard (/dev/atkbd0)
> [ 1002.547] (**) Keyboard: Applying InputClass "kbd catchall"
> [ 1002.547] (II) Using input driver 'kbd' for 'Keyboard'
> [ 1002.547] (**) Keyboard: always reports core events
> [ 1002.547] (**) Keyboard: always reports core events
> [ 1002.547] (**) Option "Protocol" "standard"
> [ 1002.547] (**) Option "Device" "/dev/atkbd0"
> [ 1002.547] (EE) Keyboard: cannot open "/dev/atkbd0"
> [ 1002.547] (EE) PreInit returned 8 for "Keyboard"
> [ 1002.547] (II) UnloadModule: "kbd"
Btw, why both your keyboards are attached to console?
--
Alex
More information about the freebsd-x11
mailing list