FreeBSDDesktop / DEPRECATED-freebsd-base-graphics

Fork of FreeBSD's base repository to work on graphics-stack-related projects
Other
49 stars 13 forks source link

Panic When Loading i915kms.ko via drm-next pkg #173

Closed nomadlogic closed 6 years ago

nomadlogic commented 6 years ago

I am able to preproduce a panic when manually loading the i915kms module on my kabylake system. Steps to reproduce:

1) boot into multiuser on FreeBSD 12.0-CURRENT #2 c3586a05c4c(master)-dirty: Tue Aug 29 22:43:41 PDT 2017 with no drm related modules loaded 2) manually load drm.ko from /boot/modules/drm.ko 3) manually load i915kms.ko from /boot/modules/i915kms.ko 4) panic

A gist of the crash is here: https://gist.github.com/nomadlogic/74fb057f81a8c976e2f038184d99e3fc

I can easily reproduce this and don't mind testing patches or running commands in gdb after the panic.

freebsd-nils-level1 commented 6 years ago

I get panics as well, i3-6100U - Skylake SoC. Using "drm-next-kmod-g20170829" from the ports. Here's the backtrace portion:

Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address   = 0x20
fault code              = supervisor read data, page not present
instruction pointer     = 0x20:0xffffffff8280ddba
stack pointer           = 0x28:0xfffffe0117fcf7e0
frame pointer           = 0x28:0xfffffe0117fcf840
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 0 (linuxkpi_short_wq_2)
trap number             = 12
panic: page fault
cpuid = 0
time = 1504630325
KDB: stack backtrace:
#0 0xffffffff80abecf7 at kdb_backtrace+0x67
#1 0xffffffff80a7b0bc at vpanic+0x19c
#2 0xffffffff80a7af13 at panic+0x43
#3 0xffffffff80efc18d at trap_fatal+0x34d
#4 0xffffffff80efc1e9 at trap_pfault+0x49
#5 0xffffffff80efba39 at trap+0x2a9
#6 0xffffffff80edf0d1 at calltrap+0x8
#7 0xffffffff8291cc44 at intel_fbdev_initial_config+0x14
#8 0xffffffff82870957 at async_run_entry_fn+0x27
#9 0xffffffff828641a0 at linux_work_fn+0xe0
#10 0xffffffff80ad0667 at taskqueue_run_locked+0x147
#11 0xffffffff80ad1848 at taskqueue_thread_loop+0xb8
#12 0xffffffff80a3e4b5 at fork_exit+0x85
#13 0xffffffff80edf6be at fork_trampoline+0xe
Uptime: 6s
Dumping 314 out of 3929 MB:..6%..11%..21%..31%..41%..51%..62%..72%..82%..92%

If that report doesn't fit here because it's FreeBSD ports based, please let me know - then I open a new bug report at FreeBSD's bugzilla...

valpackett commented 6 years ago

My Haswell ThinkPad also blackscreens with drm-next-kmod from ports (but still works on drm-next kernel).

woodsb02 commented 6 years ago

My Broadwell NEC Lavie HZ750 laptop also kernel panics with drm-next-kmod from ports. FreeBSD 12-current r323124 with packages:

# kldload /boot/modules/drm.ko
<6>[drm] Initialized
# kldload /boot/modules/i915kms.ko
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
<6>[drm] Memory usable by graphics device = 4096M
<6>[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
<6>[drm] Driver supports precise vblank timestamp query.
<6>[drm] Connector eDP-1: get mode from tunables:
<6>[drm]   - kern.vt.fb.modes.eDP-1
<6>[drm]   - kern.vt.fb.default_mode
<6>[drm] Connector HDMI-A-1: get mode from tunables:
<6>[drm]   - kern.vt.fb.modes.HDMI-A-1
<6>[drm]   - kern.vt.fb.default_mode
<6>[drm] Initialized i915 1.6.0 20160919 for drmn on minor 0

Failed trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address  = 0x0
fault code        = supervisor read instruction, page not present
instruction pointer  = 0x20:0x0
stack pointer      = 0x28:0xfffffe023629a8d8
frame pointer       = 0x28:0xfffffe023629a940
code segment     = base 0x0, limit 0xfffff, type 0x1b
                           = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags     = interrupt enabled, resume, IDPL = 0
current process    = 0 (linuxkpi_short_wq_1)
[ thread pid 0 tid 100777 ]
Stopped at        0
db> bt
Tracing pid 0 tid 100777 td 0xfffff8008f4a8560
??() at 0
drm_fb_helper_initial_config() at drm_fb_helper_initial_config+0xad/frame 0xfffffe023629a940
intel_fbdev_intial_config() at intel_fbdev_initial_config+0x14/frame 0xfffffe023629a960
async_run_entry_fn() at async_run_entry_fn+0x27/frame 0xfffffe023629a980
linux_work_fn() at linux_work_fn+0xe0/frame 0xfffffe023629a9e0
taskqueue_run_locked() at taskqueue_run_locked+0x147/frame 0xfffffe023629aa40
taskqueue_thread_loop() at taskqueue_thread_loop+0xb8/frame 0xfffffe023629aa70
fork_exit() at fork_exit+0x85/frame 0xfffffe023629aab0
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe023629aab0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
db> 
noptrix commented 6 years ago

Just wanted to confirm: same here on my thinkpad t450s (broadwell, hd 5500)

nomadlogic commented 6 years ago

OK i think this issue may be squashed now. I've pulled the latest ports tree and build drm-next-kmod locally on my kabylake system and the module loads now. I've also done some testing and stability looks good (webGL demos work fine) and glxinfo reports full hardware acceleration. here is the port version i've installed:

drm-next-kmod-g20170918

I am not seeing drm-next-kmod on the pkg repo's, so perhaps it is still building? I'll test once that's available upstream tho.

If anyone else is seeing this try pulling the latest ports tree and building locally, hopefully things are in a better state now for wider use.

freebsd-nils-level1 commented 6 years ago

confirmed, with "12.0-CURRENT r323904M" and "drm-next-kmod-g20170918", module loads successfully and runs well so far... thumbsup

nomadlogic commented 6 years ago

I am going to close this issue now. I haven't installed the package from upstream since it's not available, but i suspect we should be all set now. my laptop has been stable during suspend/resume over night as well as attaching external HDMI displays - so this is great!

trombonehero commented 6 years ago

Works for me too, although now libinput doesn't want to work any more... does the drm-next branch have any non-DRM changes?

Jon

On 22 Sep 2017, at 7:05, nbe-renzel-net wrote:

confirmed, with "12.0-CURRENT r323904M" and "drm-next-kmod-g20170918", module loads successfully and runs well so far... thumbsup

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/FreeBSDDesktop/freebsd-base-graphics/issues/173#issuecomment-331400088

-- jonathan.anderson@ieee.org

valpackett commented 6 years ago

@trombonehero maybe it has the EVDEV_SUPPORT kernel option? I always enabled it manually anyway. My kernel config:

include GENERIC-NODEBUG
ident   DESKTOP
device      evdev
options     EVDEV_SUPPORT
options     VIMAGE