Bug 262972 - graphics/drm-fbsd13.0-kmod module radeonkms either sometimes freezes system (amd64) or reproducible makes X unkillable (i386)
Summary: graphics/drm-fbsd13.0-kmod module radeonkms either sometimes freezes system (...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-x11 (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-01 07:24 UTC by nkoch
Modified: 2022-04-14 08:43 UTC (History)
2 users (show)

See Also:


Attachments
dmesg output, loaded klds, and X-server log (55.93 KB, text/plain)
2022-04-01 07:24 UTC, nkoch
no flags Details
X-Server-Log i386 (14.34 KB, text/plain)
2022-04-04 14:52 UTC, nkoch
no flags Details
i386: output from "truss X" (211.53 KB, text/plain)
2022-04-04 15:24 UTC, nkoch
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description nkoch 2022-04-01 07:24:28 UTC
Created attachment 232854 [details]
dmesg output, loaded klds, and X-server log

I am testing an embedded board with AMD G-T56N processor and Radeon HD 6300 graphics under FreeBSD13.0/amd64.

Sometimes the system freezes when loading radeonkms.ko. It makes no
difference if I have kld_list="radeonkms" in rc.conf or the kernel module is loaded when starting the X-server.

I tested drm-fbsd13-0-kmod form packages (5.4.144.g20220128) and the latest version from ports  (5.4.144.g20220223).

I only made a short test FreeBSD13.0/i386. Here, when I start the X-server it seems to hang in a syscall as it is unkillable.

The same hardware works without problems with radeonkms.ko under FreeBSD12.1/i386.

Should I try modifying one of the many related sysctls?
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2022-04-02 10:22:49 UTC
> Hardware: amd64 Any 

(In reply to nkoch from comment #0)

> … I only made a short test FreeBSD13.0/i386. Here, when I start the 
> X-server it seems to hang in a syscall as it is unkillable. …

To clarify: do you get the same set of symptoms with i386 as with amd64?
Comment 2 nkoch 2022-04-04 06:40:05 UTC
Short test FreeBSD13/i386:
 Driver loads, X-Server hangs unkillable.

Long test FreeBSD/amd64:
 Driver loads and _sometimes_ blanks screen and freezes system.
 If driver loads successfully, X-Server runs without problems.

I can do some more tests with i386 to see if driver also freezes sometimes.
Comment 3 nkoch 2022-04-04 14:52:34 UTC
Created attachment 232934 [details]
X-Server-Log i386
Comment 4 nkoch 2022-04-04 14:54:55 UTC
I re-tested i386:
When X starts, it auto loads the required kernel modules and then hangs. Screen is not black, but switched to high resolution with text cursor.
X cannot be killed, but FreeBSD itself runs. I can login via ssh. I cannot switch to a different vty.
Comment 5 nkoch 2022-04-04 15:24:02 UTC
Created attachment 232935 [details]
i386: output from "truss X"
Comment 6 nkoch 2022-04-05 12:33:07 UTC
ps output of unkillable X server shows:

 STAT MWCHAN
 D<   vmpba
Comment 7 nkoch 2022-04-05 12:49:13 UTC
Output of procstat -af:

  PID COMM                FD T V FLAGS    REF  OFFSET PRO NAME
 1074 Xorg              text v r r-------   -       - -   /usr/local/bin/Xorg
 1074 Xorg               cwd v d r-------   -       - -   /root
 1074 Xorg              root v d r-------   -       - -   /
 1074 Xorg                 0 v x rw------   3    2512 -   -
 1074 Xorg                 1 v x rw------   3    2512 -   -
 1074 Xorg                 2 v x rw------   3    2512 -   -
 1074 Xorg                 3 v r -w------   1   14640 -   /var/log/Xorg.0.log
 1074 Xorg                 4 s - rw------   1       0 UDS 0 0 /tmp/.X11-unix/X0
 1074 Xorg                 5 v r r-------   1   25699 -   /usr/local/lib/xorg/protocol.txt
 1074 Xorg                 6 p - rw------   1       0 -   -
 1074 Xorg                 7 p - rw------   1       0 -   -
 1074 Xorg                 8 s - rw------   1       0 UD? /var/run/devd.seqpacket.pipe
 1074 Xorg                 9 v c rw------   1       0 -   /dev/pci
 1074 Xorg                10 v c rw------   1       0 -   /dev/mem
 1074 Xorg                11 v c rw---n--   1       0 -   /dev/ttyv5
 1074 Xorg                12 v c rw------   1       0 -   /dev/io
 1074 Xorg                13 v c rw------   4       0 -   /dev/drm/0
 1074 Xorg                14 v c rw------   4       0 -   /dev/drm/0
 1074 Xorg                15 v c rw------   4       0 -   /dev/drm/0
Comment 8 nkoch 2022-04-05 14:11:42 UTC
/usr/src/sys/vm/vm_page.c:896:
 if (_vm_page_busy_sleep(obj, m, m->pindex, "vmpba", allocflags,