[PATCH] do not feed keyboard device path in X devd backend

Robert Millan rmh at freebsd.org
Thu Feb 13 16:00:21 UTC 2014


On 09/02/2014 10:26, Alex Kozlov wrote:
> On Sat, Feb 08, 2014 at 02:00:06PM +0000, Robert Millan wrote:
>>
>> Hi Alex,
>>
>> 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.

-- 
Robert Millan
-------------- next part --------------
--- /dev/fd/63	2014-02-13 17:27:29.000000000 +0100
+++ /dev/fd/62	2014-02-13 17:27:29.000000000 +0100
@@ -4,15 +4,15 @@
 X Protocol Version 11, Revision 0
 Build Operating System: GNU/kFreeBSD 9.0-2-amd64 x86_64 Debian
 Current Operating System: GNU/kFreeBSD tv 10.0-1-amd64 #0 Sat, 08 Feb 2014 15:14:00 +0100 x86_64
-Build Date: 13 February 2014  04:38:01PM
-xorg-server 2:1.15.0-2+devd+half (http://www.debian.org/support) 
+Build Date: 13 February 2014  04:19:12PM
+xorg-server 2:1.15.0-2+devd+full (http://www.debian.org/support) 
 Current version of pixman: 0.32.4
 	Before reporting problems, check http://wiki.x.org
 	to make sure that you have the latest version.
 Markers: (--) probed, (**) from config file, (==) default setting,
 	(++) from command line, (!!) notice, (II) informational,
 	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
-(==) Log file: "/var/log/Xorg.0.log", Time: Thu Feb 13 17:44:11 2014
+(==) Log file: "/var/log/Xorg.0.log", Time: Thu Feb 13 17:32:55 2014
 (==) Using system config directory "/usr/share/X11/xorg.conf.d"
 (==) No Layout section.  Using the first Screen section.
 (==) No screen section available. Using defaults.
@@ -2671,32 +2671,24 @@
 (EE) AIGLX: reverting to software rendering
 (II) AIGLX: Loaded and initialized swrast
 (II) GLX: Initialized DRISWRAST GL provider for screen 0
-(II) config/devd: Adding input device Keyboard (/dev/ukbd0)
-(**) Keyboard: Applying InputClass "kbd catchall"
+(II) config/devd: Adding AT Keyboard
+(**) AT Keyboard: Applying InputClass "kbd catchall"
 (II) LoadModule: "kbd"
 (II) Loading /usr/lib/xorg/modules/input/kbd_drv.so
 (II) Module kbd: vendor="X.Org Foundation"
 	compiled for 1.15.0, module version = 1.8.0
 	Module class: X.Org XInput Driver
 	ABI class: X.Org XInput driver, version 20.0
-(II) Using input driver 'kbd' for 'Keyboard'
-(**) Keyboard: always reports core events
-(**) Keyboard: always reports core events
+(II) Using input driver 'kbd' for 'AT Keyboard'
+(**) AT Keyboard: always reports core events
+(**) AT Keyboard: always reports core events
 (**) Option "Protocol" "standard"
-(**) Option "Device" "/dev/ukbd0"
-(EE) Keyboard: cannot open "/dev/ukbd0"
-(EE) PreInit returned 8 for "Keyboard"
-(II) UnloadModule: "kbd"
-(II) config/devd: Adding input device Keyboard (/dev/atkbd0)
-(**) Keyboard: Applying InputClass "kbd catchall"
-(II) Using input driver 'kbd' for 'Keyboard'
-(**) Keyboard: always reports core events
-(**) Keyboard: always reports core events
-(**) Option "Protocol" "standard"
-(**) Option "Device" "/dev/atkbd0"
-(EE) Keyboard: cannot open "/dev/atkbd0"
-(EE) PreInit returned 8 for "Keyboard"
-(II) UnloadModule: "kbd"
+(WW) Option "Device" requires a string value
+(**) Option "XkbRules" "base"
+(**) Option "XkbModel" "pc105"
+(**) Option "XkbLayout" "us"
+(**) Option "config_info" "devd:AT Keyboard"
+(II) XINPUT: Adding extended input device "AT Keyboard" (type: KEYBOARD, id 6)
 (II) config/devd: Adding input device 0x04b3 product 0x310d (/dev/ums0)
 (**) 0x04b3 product 0x310d: Applying InputClass "mouse catchall"
 (II) LoadModule: "mouse"
@@ -2714,7 +2706,7 @@
 (**) 0x04b3 product 0x310d: ZAxisMapping: buttons 4 and 5
 (**) 0x04b3 product 0x310d: Buttons: 9
 (**) Option "config_info" "devd:ums0"
-(II) XINPUT: Adding extended input device "0x04b3 product 0x310d" (type: MOUSE, id 6)
+(II) XINPUT: Adding extended input device "0x04b3 product 0x310d" (type: MOUSE, id 7)
 (**) 0x04b3 product 0x310d: (accel) keeping acceleration scheme 1
 (**) 0x04b3 product 0x310d: (accel) acceleration profile 0
 (**) 0x04b3 product 0x310d: (accel) acceleration factor: 2.000
@@ -2722,17 +2714,6 @@
 (II) 0x04b3 product 0x310d: SetupAuto: hw.iftype is 5, hw.model is 0
 (II) 0x04b3 product 0x310d: SetupAuto: protocol is SysMouse
 (WW) fcntl(9, F_SETOWN): Inappropriate ioctl for device
-(II) VESA(0): Setting up VESA Mode 0x166 (1280x1024)
-(WW) fcntl(9, F_SETOWN): Inappropriate ioctl for device
-(II) config/devd: Adding input device Keyboard (/dev/ukbd0)
-(**) Keyboard: Applying InputClass "kbd catchall"
-(II) Using input driver 'kbd' for 'Keyboard'
-(**) Keyboard: always reports core events
-(**) Keyboard: always reports core events
-(**) Option "Protocol" "standard"
-(**) Option "Device" "/dev/ukbd0"
-(EE) Keyboard: cannot open "/dev/ukbd0"
-(EE) PreInit returned 8 for "Keyboard"
-(II) UnloadModule: "kbd"
 (II) UnloadModule: "mouse"
+(II) UnloadModule: "kbd"
 (EE) Server terminated successfully (0). Closing log file.


More information about the freebsd-x11 mailing list