Bug 250193

Summary: Kernel panic loading DRM kmods
Product: Ports & Packages Reporter: Jason W. Bacon <jwb>
Component: Individual Port(s)Assignee: freebsd-x11 (Nobody) <x11>
Status: New ---    
Severity: Affects Some People CC: hans, x11, zeising
Priority: --- Keywords: i915, panic, regression
Version: LatestFlags: linimon: maintainer-feedback? (x11)
Hardware: amd64   
OS: Any   

Description Jason W. Bacon freebsd_committer 2020-10-08 02:01:55 UTC
On my ThinkPad X201 (i915kms, i5 integrated) and ThinkPad x120e (radeonkms, Wrestler Radeon HD 6310), loading the ports drm modules via kld_list in rc.conf causes a panic during boot.

Legacy modules in /boot/kernel works fine.

This is a regression in 12.2-RC1.  Using kld_list worked fine on both machines with 12.1-RELEASE.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2020-10-08 02:14:09 UTC
Can you show us the kld_list lines you have in each instance of /etc/rc.conf please?
Comment 2 Niclas Zeising freebsd_committer 2020-10-08 07:54:56 UTC
What happens if you build the modules locally?
Comment 3 Jason W. Bacon freebsd_committer 2020-10-08 14:12:36 UTC
kld_list="fuse /boot/modules/i915kms.ko"
kld_list="fuse /boot/modules/radeonkms.ko"
Comment 4 Jason W. Bacon freebsd_committer 2020-10-08 15:30:12 UTC
(In reply to Niclas Zeising from comment #2)

Interesting...

Both work fine with kmods built from source.  Do we have a KBI compatibility issue from 12.1 to 12.2?  If not, why don't the binary packages work on 12.2-RC1?
Comment 5 Hans Ottevanger 2020-10-17 09:11:58 UTC
(In reply to Jason W. Bacon from comment #4)

I can confirm that this also happens on my Core-2 Quad system, with a Radeon HD-6450 based graphics card.

When using the drm-fbsd12.0-kmod-4.16.g20200221 package on 12.1-RELEASE-p10 everything works as usual. After upgrading to 12.2-RC3 the system panics immediately on loading radeonkms.ko. I still get a stacktrace, but it is followed by a hard hangup, so no core dump is made.

It does not matter whether I put

kld_list="/boot/modules/radeonkms.ko"

in /etc/rc.conf or run

kldload /boot/modules/radeonkms.ko

directly from the shell.

When I build drm-fbsd12.0-kmod-4.16.g20200221 locally from ports, the problem does not occur and the systems functions normally.

I wonder what an end user gets to see when installing 12.2-RELEASE once it is available and then attempts to use the package.
Comment 6 Jason W. Bacon freebsd_committer 2020-10-17 18:40:33 UTC
I think I ruled out a discrepancy in "pkg" vs "make install" behavior by generating and installing my own package:

cd /usr/ports/graphics/drm-kmod
make pacakge0-recursive
pkg remove drm-kmod
pkg autoremove
pkg install /usr/ports/packages/all/drm-kmod*
auto-xdm-toggle off
reboot
kldload /boot/modules/i915kms.ko

Works fine with my package and I have no tweaks in my build env.

So it seems likely that the 12.1 package is incompatible with 12.2 and we're going to have a problem until bulk builds switch over to 12.2 unless this is corrected.  That would mean 3 months that 12.2 users can't install drm-kmod via pkg or freebsd-update.