Re: Regression: drm: Lobotomize set_busid nonsense for !pci drivers (a325725633c2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/30/16 18:38, Hans de Goede wrote:
> Hi,
> 
> On 30-09-16 17:33, Laszlo Ersek wrote:
>> On 09/30/16 16:59, Hans de Goede wrote:
>>> Hi,
>>>
>>> On 30-09-16 16:51, Laszlo Ersek wrote:
>>>> On 09/30/16 12:35, Hans de Goede wrote:
>>>>
>>>>> Attached are 2 patches against the xserver which should fix this,
>>>>> please give them a try.
>>>>
>>>> Sorry about the delay.
>>>>
>>>> The patches don't seem to fix the issue for me. Please see the Xorg log
>>>> attached.
>>>>
>>>> I tested the patches as follows. Given that my bisection had been done
>>>> in a Fedora 24 guest, using
>>>>
>>>>   xorg-x11-server-1.18.4-4.fc24
>>>>   http://koji.fedoraproject.org/koji/buildinfo?buildID=794494
>>>>
>>>> I now rebuilt the guest kernel exactly at the failing commit (a325725
>>>> "drm: Lobotomize set_busid nonsense for !pci drivers"), and first
>>>> reproduced the issue with the above X server.
>>>>
>>>> Then, I ported your patches to "xorg-server-1.18.4" (using the upstream
>>>> xserver tree), and rebuilt the Fedora package with the backport. For
>>>> the
>>>> backport, I had to cherry-pick the following two patches from master
>>>> first:
>>>>
>>>> 1 ca8d88e50310 xfree86: recognize primary BUS_PCI device in
>>>>                xf86IsPrimaryPlatform()
>>>> 2 ea91db4b8331 config: fix GPUDevice fail when AutoAddGPU off + BusID
>>>>
>>>> This way your patches applied cleanly. (Cherry pick #1 above is
>>>> actually
>>>> necessary for semantics, while cherry pick #2 is needed for a clean
>>>> context only, and has no impact for this test.)
>>>>
>>>> That is, in total, I added the following four patches to the Fedora 24
>>>> package:
>>>>
>>>> 1 xfree86: recognize primary BUS_PCI device in xf86IsPrimaryPlatform()
>>>> 2 config: fix GPUDevice fail when AutoAddGPU off + BusID
>>>> 3 xfree86: Make adding unclaimed devices as GPU devices a separate step
>>>> 4 xfree86: Try harder to find atleast 1 non GPU Screen
>>>>
>>>> You can find the scratch build that I used for testing here:
>>>>
>>>>   xorg-x11-server-1.18.4-4.hans_bz1366842_2.fc24
>>>>   http://koji.fedoraproject.org/koji/taskinfo?taskID=15875087
>>>>
>>>> Another reason I used F24's X server as basis, rather than upstream
>>>> HEAD, is that Fedora 24 is pretty young, and it's already on kernel
>>>> 4.7.4, and I believe it will soon move to kernel 4.8, without
>>>> (necessarily) rebasing its X server package to upstream. IOW the kernel
>>>> upgrade to 4.8 will break X in Fedora 24 too, and then I expect the
>>>> Fedora X maintainers would have to cherry pick those two patches as
>>>> dependencies just the same.
>>>>
>>>> To summarize, the patches don't seem to help. I shall nonetheless thank
>>>> you for spending your Friday on this!
>>>
>>> Hmm, do you have a xorg.conf file lying around somewhere, the message
>>> about the xserver not being able to find an entry for screen 0 does
>>> not make sense ...
>>
>> Good catch, I actually had two files under "/etc/X11/xorg.conf.d/":
>>
>> * "00-keyboard.conf", from package "systemd-229-13.fc24.x86_64", with
>> contents
>>
>> ------------
>> # Read and parsed by systemd-localed. It's probably wise not to edit
>> this file
>> # manually too freely.
>> Section "InputClass"
>>         Identifier "system-keyboard"
>>         MatchIsKeyboard "on"
>>         Option "XkbLayout" "us"
>> EndSection
>> ------------
>>
>> * "01-resolution.conf", which I had created, in order to set the
>> preferred display resolution:
>>
>> ------------
>> Section "Screen"
>>   Identifier "Default Screen"
>>   Device     "Default Device"
>>   Monitor    "Default Monitor"
>> EndSection
>>
>> Section "Device"
>>   Identifier "Default Device"
>>   Driver     "modesetting"
>> EndSection
>>
>> Section "Monitor"
>>   Identifier "Default Monitor"
>>   Option     "PreferredMode"   "640x480"
>> # Option     "PreferredMode"   "1440x900"
>> EndSection
>> ------------
>>
>> I removed these files now, and repeated the test. Again, the X server
>> wouldn't start, but I think the log file looks a bit different now.
>> Attached.
> 
> Ah, ok so it seems that my initial analysis is wrong, the problem
> is not a re-occuring of the device getting identified as a GPU screen,
> libdrm sorta depends on bus-ids and the lack of one is causing the
> server to misbehave. I guess that even with a xorg.conf things
> will fail with the troublesome kernel version (might be worth
> trying).
> 
> Emil's analysis seems to be spot on. This does not seem easily
> fixable in userspace / does seem like a real regression as it
> even breaks things when specifying the device through xorg.conf
> (I or so I believe) which is something which uses to work ...

In order to check this hypothesis, I did the following:
- I downgraded my xorg-x11-server installation to the most recent
official F24 packages, that is, "1.18.4-4.fc24",
- I kept the kernel that I built exactly at the regressive commit
(a325725633c2)
- I modified "01-resolution.conf" (see it above in the context) like this:

----
Section "Device"
  Identifier "Default Device"
  Driver     "modesetting"
  BusID      "PCI:00:02:0" <------------ new option added
EndSection
----

where BusID matches the B/D/F of the virtio-vga device from "lspci".

This setup (modulo the kernel of course) was known to work, but now the
X server actually segfaults (apparently in the
xf86PlatformDeviceCheckBusID() function). Please find the logfile attached.

(NB: this is unrelated to upstream commit de9ce6757c2e -- which the
pristine FC24 build lacks -- because I don't set AutoAddGPU to "off" --
it is left at its default "on" value.)

Therefore, you are right. :)

Thanks
Laszlo

> I made the mistake of thinking the kernel change was re-triggering
> the old problem Laszlo fixed, but that does not seem to be the
> case.
> 
> Regards,
> 
> Hans

[     9.978] 
X.Org X Server 1.18.4
Release Date: 2016-07-19
[     9.978] X Protocol Version 11, Revision 0
[     9.978] Build Operating System:  4.6.4-301.fc24.x86_64 
[     9.978] Current Operating System: Linux ovmf-fedora 4.7.0-rc2+ #7 SMP Fri Sep 30 12:05:35 CEST 2016 x86_64
[     9.978] Kernel command line: BOOT_IMAGE=/vmlinuz-4.7.0-rc2+ root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root rhgb quiet video=640x480 no_console_suspend console=tty console=ttyS0,115200 ignore_loglevel LANG=en_US.UTF-8
[     9.978] Build Date: 25 August 2016  05:27:31PM
[     9.978] Build ID: xorg-x11-server 1.18.4-4.fc24 
[     9.978] Current version of pixman: 0.34.0
[     9.978] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[     9.978] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[     9.978] (==) Log file: "/var/log/Xorg.0.log", Time: Fri Sep 30 19:19:13 2016
[     9.978] (==) Using config directory: "/etc/X11/xorg.conf.d"
[     9.978] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[     9.979] (==) No Layout section.  Using the first Screen section.
[     9.979] (**) |-->Screen "Default Screen" (0)
[     9.979] (**) |   |-->Monitor "Default Monitor"
[     9.979] (**) |   |-->Device "Default Device"
[     9.979] (==) Automatically adding devices
[     9.979] (==) Automatically enabling devices
[     9.979] (==) Automatically adding GPU devices
[     9.979] (==) Max clients allowed: 256, resource mask: 0x1fffff
[     9.979] (==) FontPath set to:
	catalogue:/etc/X11/fontpath.d,
	built-ins
[     9.979] (==) ModulePath set to "/usr/lib64/xorg/modules"
[     9.979] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[     9.979] (II) Loader magic: 0x824dc0
[     9.979] (II) Module ABI versions:
[     9.979] 	X.Org ANSI C Emulation: 0.4
[     9.979] 	X.Org Video Driver: 20.0
[     9.979] 	X.Org XInput driver : 22.1
[     9.979] 	X.Org Server Extension : 9.0
[     9.980] (++) using VT number 1

[     9.980] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[     9.981] (II) xfree86: Adding drm device (/dev/dri/card0)
[     9.986] (--) PCI:*(0:0:2:0) 1af4:1050:1af4:1100 rev 1, Mem @ 0xc0000000/8388608, 0x800000000/16384, 0xc0804000/4096, BIOS @ 0x????????/131072
[     9.986] (II) LoadModule: "glx"
[     9.986] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[     9.988] (II) Module glx: vendor="X.Org Foundation"
[     9.988] 	compiled for 1.18.4, module version = 1.0.0
[     9.988] 	ABI class: X.Org Server Extension, version 9.0
[     9.988] (==) AIGLX enabled
[     9.989] (II) LoadModule: "modesetting"
[     9.989] (II) Loading /usr/lib64/xorg/modules/drivers/modesetting_drv.so
[     9.989] (II) Module modesetting: vendor="X.Org Foundation"
[     9.989] 	compiled for 1.18.4, module version = 1.18.4
[     9.989] 	Module class: X.Org Video Driver
[     9.989] 	ABI class: X.Org Video Driver, version 20.0
[     9.989] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[     9.989] (EE) 
[     9.989] (EE) Backtrace:
[     9.989] (EE) 0: /usr/libexec/Xorg (OsLookupColor+0x139) [0x59f679]
[     9.990] (EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7ffa90b2176f]
[     9.990] (EE) 2: /usr/libexec/Xorg (xf86PlatformDeviceCheckBusID+0xa7) [0x49cb87]
[     9.990] (EE) 3: /usr/libexec/Xorg (xf86PlatformMatchDriver+0x4dd) [0x49754d]
[     9.991] (EE) 4: /usr/libexec/Xorg (xf86CallDriverProbe+0xb0) [0x46e530]
[     9.991] (EE) 5: /usr/libexec/Xorg (xf86BusConfig+0x46) [0x46eea6]
[     9.991] (EE) 6: /usr/libexec/Xorg (InitOutput+0x97a) [0x47d52a]
[     9.991] (EE) 7: /usr/libexec/Xorg (remove_fs_handlers+0x266) [0x43ac66]
[     9.992] (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf1) [0x7ffa90b0d731]
[     9.992] (EE) 9: /usr/libexec/Xorg (_start+0x29) [0x424d59]
[     9.992] (EE) 10: ? (?+0x29) [0x29]
[     9.993] (EE) 
[     9.993] (EE) Segmentation fault at address 0x0
[     9.993] (EE) 
Fatal server error:
[     9.993] (EE) Caught signal 11 (Segmentation fault). Server aborting
[     9.993] (EE) 
[     9.993] (EE) 
Please consult the Fedora Project support 
	 at http://wiki.x.org
 for help. 
[     9.993] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[     9.993] (EE) 
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux