Bug 245800 - x11-servers/xorg-server: after upgrading packages, X freezes upon startup
Summary: x11-servers/xorg-server: after upgrading packages, X freezes upon startup
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-x11 (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-21 20:07 UTC by c0141
Modified: 2020-04-24 13:21 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (x11)


Attachments
Xorg.0.log (20.94 KB, text/plain)
2020-04-22 12:32 UTC, c0141
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description c0141 2020-04-21 20:07:52 UTC
Hardware: Lenovo Thinkpad X230 (Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz)
          Lenovo Thinkpad T430 (Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz)
OS: FreeBSD 12.1p3 amd64.

First of all I am not sure whether the issue is actually the xorg-server or with one of the other packages I downgraded.

Issue. After upgrading pkg's with pkg upgrade X froze upon startup. When I say froze I mean X does not respond to any keyboard or mouse input - not even Ctrl+Alt+F1 which normally brings you back to the console.
I use startx (xinit).

The power button works and I can ssh into the laptop (so only X is frozen).

I had to downgrade several packages to make X work again.
I downgraded the following:

xorg-server-1.18.4_13,1.txz
xf86-video-intel-2.99.917.20181203.txz
libunwind-20170615.txz
libepoxy-1.5.2.txz
xkbcomp-1.4.2.txz
xkeyboard-config-2.27.txz
xf86-video-intel-2.99.917.20181203.txz
xf86-input-keyboard-1.9.0_3.txz
xf86-input-mouse-1.9.3_2.txz
gpu-firmware-kmod-g20191015
drm-fbsd12.0-kmod-4.16.g20191120

The last pkg's I downgraded were the input drivers and before those the firmware+kmod+video-intel. Just before I downgraded the input drivers I could use Ctrl+Alt+F1 to get back to the console. After downgrading the input drivers I got keyboard and mouse control back.

To make sure this was not some weird issue with pkg upgrade I installed a fresh version of FreeBSD-12.1p3 and latest packages. Same issue. I also tested without the xf86-video-intel driver installed. Same issue.


Please note it seems I am not always getting any emails from the FreeBSD bugzilla :(
I will try and check back for updates.
Comment 1 pete 2020-04-21 20:25:49 UTC
I might be helpful to attach the Xorg.0.log file from your system when they keyboard and mouse is unresponsive.  From the sounds of it though it is not clear you followed the instructions from the latest xorg-server-1.20.8 package, specifically relating to input devices:

"If your kernel is compiled with the EVDEV_SUPPORT option enabled
(default starting from FreeBSD 12.1) it is recommended to enable evdev mode in
pointer device drivers like ums(4) and psm(4). This will give improvements like
better tilt wheel support for mice and centralized gesture support via
xf86-input-synaptics or libinput drivers for touchpads.

This is also needed for PS/2 devices to be properly detected by Xorg when
moused service is disabled in /etc/rc.conf and kernel is compiled with
EVDEV_SUPPORT.

To enable evdev in such a device, run the following:

# sysctl kern.evdev.rcpt_mask=6

To make it persistent across reboots, add the following to /etc/sysctl.conf:

kern.evdev.rcpt_mask=6"

On my 12-STABLE system setting the appropriate sysctl knob ensures things work as expected.
Comment 2 c0141 2020-04-22 12:32:19 UTC
Created attachment 213683 [details]
Xorg.0.log

The evdev sysctl knob has been set.

# sysctl kern.evdev.rcpt_mask
kern.evdev.rcpt_mask: 6

I notice in the Xorg.0.log file that the input devices are ignored (???)

[   989.789] (II) config/udev: Adding input device System keyboard multiplexer (/dev/input/event0)
[   989.789] (**) System keyboard multiplexer: Applying InputClass "Evdev keyboard"
[   989.789] (II) No input driver specified, ignoring this device.
[   989.789] (II) This device may have been added with another device file.
[   989.789] (II) config/udev: Adding input device System mouse (/dev/input/event1)
[   989.789] (II) No input driver specified, ignoring this device.
[   989.789] (II) This device may have been added with another device file.
[   989.789] (II) config/udev: Adding input device AT keyboard (/dev/input/event2)
[   989.789] (**) AT keyboard: Applying InputClass "Evdev keyboard"
[   989.789] (II) No input driver specified, ignoring this device.
[   989.789] (II) This device may have been added with another device file.
[   989.789] (II) config/udev: Adding input device Generic PS/2 mouse (/dev/input/event3)
[   989.789] (II) No input driver specified, ignoring this device.
[   989.789] (II) This device may have been added with another device file.

Never seen this before. I tried using a xorg.conf file with keyboard+mouse defined:

Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option      "Device" "/dev/sysmouse"
        Option      "ZAxisMapping" "4 5 6 7"
EndSection

This does not help either.

NB. The Xorg.0.file is from a T410s which also has the problem.
Comment 3 Michael Gmelin freebsd_committer freebsd_triage 2020-04-22 12:41:07 UTC
(In reply to c0141 from comment #2)

Downgrading is not a sustainable option.

After upgrading, please move your xorg.conf out of the way.

Then try running

https://github.com/grembo/xorg-udev-setup-check

(direct fetch:
fetch https://raw.githubusercontent.com/grembo/xorg-udev-setup-check/master/xorg-udev-setup-check.sh
)

And follow its suggestions.

See https://github.com/grembo/xorg-udev-setup-check/blob/master/README.md for instruction.

If you get stuck, please collect evidence using

./xorg-udev-setup-check.sh -eskv

and share it with us.
Comment 4 c0141 2020-04-22 13:07:53 UTC
Thank you for the extremely quick reply. I was actually updating the issue with these comments when you beat me to it ;)

----
After reading the Xorg.0.log I did some searching online and found some linux posts on problems with input devices. Figured out there is a evdev driver which now needs to be installed instead of the keyboard and mouse drivers to make things work.

So minor problem which seems to be fixed.
----

Thank you very much for the script. It informed my about xf86-input-libinput and the trackpoint support.
Most important was the missing xf86-input-evdev package. 

I think it would be a good idea to mention the script in the pkg-message or perhaps add it to the pkg or in another dependent pkg.

If you keep it on github perhaps add --no-verify-peer to the fetch command. 

So everything works on my T410s. I will test on my other laptops and report back.
Comment 5 Michael Gmelin freebsd_committer freebsd_triage 2020-04-22 13:11:15 UTC
(In reply to c0141 from comment #4)

Good to hear you had success at least on one of the machines.

> If you keep it on github perhaps add --no-verify-peer to the fetch command. 

Having a cert bundle installed, e.g. by running:

  pkg install ca_root_nss

should fix that. Verifying the peer is a good idea when fetching a shell script of the net :)
Comment 6 Niclas Zeising freebsd_committer freebsd_triage 2020-04-22 18:39:46 UTC
There should be no need to downgrade ports, in fact, that will probably just exacerbate the problems.

I run X without problems on my X230 all the time.  You should not need much more than pkg install drm-kmod xorg and your favorite window manager, then load /boot/modules/i915kms.ko and start X.  No config of any kind should be needed, and you don't need xf86-video-intel or xf86-input-evdev, unless you have joysticks or gamepads or the like.

You have to ensure that you have evdev support in your kernel config (it's in generic), and if you're not running 12.1-release, but 12.1-stable, you need to recompile drm-fbsd12.0-kmod to match your specific kernel.

If you are building from ports, make sure that you clean away any local options or config you have, that might prevent you from installing important ports, such as xf86-input-libinput and other needed packages.
Comment 7 c0141 2020-04-22 18:50:08 UTC
I have tested the following Lenovo laptops:

X230 (Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz)
T430 (Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz)
T400 (Intel(R) Core(TM)2 Duo CPU P8600  @ 2.40GHz)
E520 (Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz)
X300 (Intel(R) Core(TM)2 Duo CPU L7100  @ 1.20GHz)

On all machines X work with the things mentioned in the xorg-udev-setup-check script - except for the X300 where the trackpoint only works partially. Middle click to copy/paste does not work on this one.
I also noted that libva does not seem to work on the X300. vainfo returns an error. libva works on all the other machines.

So all in all successful. I haven't tested my 32bit machines or the non-lenovo based.

If you want to close the issue go ahead. Otherwise wait max 2 weeks and I will see if I can test some more machines.

------------------------------------------------------------------------------
@Niclas Zeising

I do not seem to be able to use the keyboard or the mouse without the xf86-input -evdev. I am running stock FreeBSD 12.1p3.
Comment 8 Michael Gmelin freebsd_committer freebsd_triage 2020-04-22 19:03:39 UTC
(In reply to c0141 from comment #7)

Could you collect evidence on the X300 by running

./xorg-udev-setup-check.sh -desk

I would be curious to take a look at the results
(you can email the file directly to me to grembo@freebsd.org,
it shouldn't contain any private information, but you
can take a look at the file before)

In case you don't have sudo installed, there will
be an error message when looking at libinput devices -
in this case please also run/post the output of

  libinput list-devices

or run the script a second time as root.

Thanks
Comment 9 Michael Gmelin freebsd_committer freebsd_triage 2020-04-24 13:21:13 UTC
Reported as fixed for the time being. Thanks for the feedback!