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

kernel panic when loading i915kms on Skylake and rev 6463da5 #54

Closed nomadlogic closed 7 years ago

nomadlogic commented 7 years ago

just upgraded my system to this: FreeBSD boomers 12.0-CURRENT FreeBSD 12.0-CURRENT #0 6463da5(master): Mon Jul 18 20:38:17 PDT 2016 root@boomers:/usr/obj/usr/home/pwright/git /freebsd-base-graphics/sys/GENERIC amd64

I am getting a kernel panic when i boot this system, specifically when the i915kms kernel module is being loaded. here is the bt:

FreeBSD boomers 12.0-CURRENT FreeBSD 12.0-CURRENT #0 6463da5(master): Mon Jul 18 20:38:17 PDT 2016     root@boomers:/usr/obj/usr/home/pwright/git/freebsd-base-graphics/sys/GENERIC  amd64

panic: bogus refcnt 0 on lle 0xfffff8012ff45a00

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...

Unread portion of the kernel message buffer:
panic: bogus refcnt 0 on lle 0xfffff8012ff45a00
cpuid = 1
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe022fed6370
vpanic() at vpanic+0x182/frame 0xfffffe022fed63f0
kassert_panic() at kassert_panic+0x126/frame 0xfffffe022fed6460
llentry_free() at llentry_free+0x136/frame 0xfffffe022fed6490
in_lltable_free_entry() at in_lltable_free_entry+0xb0/frame 0xfffffe022fed64c0
htable_prefix_free() at htable_prefix_free+0xce/frame 0xfffffe022fed6520
lltable_prefix_free() at lltable_prefix_free+0x5d/frame 0xfffffe022fed6560
in_scrubprefix() at in_scrubprefix+0x290/frame 0xfffffe022fed6600
in_difaddr_ioctl() at in_difaddr_ioctl+0x285/frame 0xfffffe022fed6650
in_control() at in_control+0x96/frame 0xfffffe022fed66d0
ifioctl() at ifioctl+0xda1/frame 0xfffffe022fed6760
kern_ioctl() at kern_ioctl+0x246/frame 0xfffffe022fed67c0
sys_ioctl() at sys_ioctl+0x171/frame 0xfffffe022fed68a0
amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe022fed69b0
Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe022fed69b0
--- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x800fd2e5a, rsp = 0x7fffffffe358, rbp = 0x7fffffffe3a0 ---
KDB: enter: panic
<snip>
Loaded symbols for /boot/kernel/ums.ko
#0  doadump (textdump=0) at pcpu.h:221
221     pcpu.h: No such file or directory.
        in pcpu.h
(kgdb) #0  doadump (textdump=0) at pcpu.h:221
#1  0xffffffff80391fdb in db_dump (dummy=<value optimized out>, dummy2=false, 
    dummy3=0, dummy4=0x0)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/ddb/db_command.c:533
#2  0xffffffff80391dd9 in db_command (cmd_table=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/ddb/db_command.c:440
#3  0xffffffff80391b34 in db_command_loop ()
    at /usr/home/pwright/git/freebsd-base-graphics/sys/ddb/db_command.c:493
#4  0xffffffff80394a6b in db_trap (type=<value optimized out>, 
    code=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/ddb/db_main.c:251
#5  0xffffffff80a89d43 in kdb_trap (type=<value optimized out>, 
    code=<value optimized out>, tf=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/subr_kdb.c:654
#6  0xffffffff80eb9a4d in trap (frame=0xfffffe022fed62a0)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/amd64/amd64/trap.c:556
#7  0xffffffff80e9a191 in calltrap ()
    at /usr/home/pwright/git/freebsd-base-graphics/sys/amd64/amd64/exception.S:236
#8  0xffffffff80a893eb in kdb_enter (why=0xffffffff813e339e "panic", 
    msg=0x80 <Address 0x80 out of bounds>) at cpufunc.h:63
#9  0xffffffff80a49eff in vpanic (fmt=<value optimized out>, 
    ap=0xfffffe022fed6430)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/kern_shutdown.c:752
#10 0xffffffff80a49d56 in kassert_panic (fmt=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/kern_shutdown.c:649
#11 0xffffffff80b3c126 in llentry_free (lle=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/net/if_llatbl.c:432
#12 0xffffffff80ba5300 in in_lltable_free_entry (llt=0xfffff80004585b00, 
    lle=0xfffff8012ff45a00)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/netinet/in.c:1144
#13 0xffffffff80b3c9fe in htable_prefix_free (llt=<value optimized out>, 
    addr=<value optimized out>, mask=<value optimized out>, 
    flags=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/net/if_llatbl.c:673
#14 0xffffffff80b3c6cd in lltable_prefix_free (af=<value optimized out>, 
    addr=<value optimized out>, mask=<value optimized out>, 
    flags=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/net/if_llatbl.c:599
#15 0xffffffff80ba43c0 in in_scrubprefix (target=<value optimized out>, 
    flags=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/netinet/in.c:757
#16 0xffffffff80ba3df5 in in_difaddr_ioctl (data=<value optimized out>, 
    ifp=<value optimized out>, td=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/netinet/in.c:608
#17 0xffffffff80ba2fc6 in in_control (so=<value optimized out>, 
    cmd=2149607705, data=0xfffffe022fed67f0 "em0", ifp=0xfffff80004d2a000, 
    td=0xfffff800406b9500)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/netinet/in.c:248
#18 0xffffffff80b33f81 in ifioctl (so=<value optimized out>, 
    cmd=<value optimized out>, data=<value optimized out>, 
    td=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/net/if.c:2840
#19 0xffffffff80aadfd6 in kern_ioctl (td=<value optimized out>, 
    fd=<value optimized out>, com=<value optimized out>, 
    data=<value optimized out>) at file.h:327
#20 0xffffffff80aadd21 in sys_ioctl (td=<value optimized out>, 
    uap=0xfffffe022fed6940)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/sys_generic.c:746
#21 0xffffffff80ebab2b in amd64_syscall (td=0xfffff800406b9500, traced=0)
    at subr_syscall.c:135
#22 0xffffffff80e9a47b in Xfast_syscall ()
    at /usr/home/pwright/git/freebsd-base-graphics/sys/amd64/amd64/exception.S:396
#23 0x0000000800fd2e5a in ?? ()
Previous frame inner to this frame (corrupt stack?)
Current language:  auto; currently minimal
(kgdb) 
nomadlogic commented 7 years ago

ok, after rebuilding locally it looks like i'm on the correct kernel revision. i am able to reproduce this panic by loading the i915kms.ko:

FreeBSD boomers 12.0-CURRENT FreeBSD 12.0-CURRENT #1 e342f05(drm-next-4.6): Wed Jul 20 21:32:19 PDT 2016 root@boomers:/usr/obj/usr/home/pwright/git/freebsd-base-graphics/sys/GENERIC amd64

here is a back trace:

<6>[drm] failed to retrieve link info, disabling eDP
panic: pfs_destroy(): node is NULL
cpuid = 4
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe023035c480
vpanic() at vpanic+0x182/frame 0xfffffe023035c500
kassert_panic() at kassert_panic+0x126/frame 0xfffffe023035c570
pfs_destroy() at pfs_destroy+0x1d6/frame 0xfffffe023035c5a0
sysfs_remove_dir() at sysfs_remove_dir+0x2a/frame 0xfffffe023035c5d0
kobject_del() at kobject_del+0x25/frame 0xfffffe023035c5f0
linux_kobject_release() at linux_kobject_release+0x49/frame 0xfffffe023035c630
kref_put() at kref_put+0x2c/frame 0xfffffe023035c660
kobject_put() at kobject_put+0x2e/frame 0xfffffe023035c680
put_device() at put_device+0x27/frame 0xfffffe023035c6a0
device_unregister() at device_unregister+0x84/frame 0xfffffe023035c6d0
i2c_del_adapter() at i2c_del_adapter+0x85/frame 0xfffffe023035c700
intel_dp_aux_fini() at intel_dp_aux_fini+0x19/frame 0xfffffe023035c720
intel_dp_init_connector() at intel_dp_init_connector+0xd2b/frame 0xfffffe023035c980
intel_ddi_init_dp_connector() at intel_ddi_init_dp_connector+0x63/frame 0xfffffe023035c9b0
intel_ddi_init() at intel_ddi_init+0x48a/frame 0xfffffe023035ca90
intel_setup_outputs() at intel_setup_outputs+0x1ae/frame 0xfffffe023035cdd0
intel_modeset_init() at intel_modeset_init+0x742/frame 0xfffffe023035cf80
i915_load_modeset_init() at i915_load_modeset_init+0x114/frame 0xfffffe023035d010
i915_driver_load() at i915_driver_load+0x75b/frame 0xfffffe023035d170
drm_dev_register() at drm_dev_register+0x78/frame 0xfffffe023035d1a0
drm_get_pci_dev() at drm_get_pci_dev+0x1d9/frame 0xfffffe023035d220
i915_pci_probe() at i915_pci_probe+0x9e/frame 0xfffffe023035d260
linux_pci_attach() at linux_pci_attach+0x4a0/frame 0xfffffe023035d340
device_attach() at device_attach+0x420/frame 0xfffffe023035d3a0
bus_generic_driver_added() at bus_generic_driver_added+0x96/frame 0xfffffe023035d3c0
devclass_driver_added() at devclass_driver_added+0x7d/frame 0xfffffe023035d400
devclass_add_driver() at devclass_add_driver+0x181/frame 0xfffffe023035d440
pci_register_driver() at pci_register_driver+0x133/frame 0xfffffe023035d4a0
i915_init() at i915_init+0xd5/frame 0xfffffe023035d4c0
_module_run() at _module_run+0xdb/frame 0xfffffe023035d510
linker_load_module() at linker_load_module+0xc88/frame 0xfffffe023035d830
kern_kldload() at kern_kldload+0xa7/frame 0xfffffe023035d870
sys_kldload() at sys_kldload+0x5b/frame 0xfffffe023035d8a0
amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe023035d9b0
Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe023035d9b0
--- syscall (304, FreeBSD ELF64, sys_kldload), rip = 0x80086d38a, rsp = 0x7fffffffe678, rbp = 0x7fffffffeb90 ---
KDB: enter: panic

and some more info here:


(kgdb) bt
#0  doadump (textdump=0) at pcpu.h:221
#1  0xffffffff8039111b in db_dump (dummy=<value optimized out>, dummy2=false, dummy3=0, dummy4=0x0)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/ddb/db_command.c:533
#2  0xffffffff80390f19 in db_command (cmd_table=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/ddb/db_command.c:440
#3  0xffffffff80390c74 in db_command_loop () at /usr/home/pwright/git/freebsd-base-graphics/sys/ddb/db_command.c:493
#4  0xffffffff80393bab in db_trap (type=<value optimized out>, code=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/ddb/db_main.c:251
#5  0xffffffff80a8ac63 in kdb_trap (type=<value optimized out>, code=<value optimized out>, tf=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/subr_kdb.c:654
#6  0xffffffff80ebba4d in trap (frame=0xfffffe023035c3b0)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/amd64/amd64/trap.c:556
#7  0xffffffff80e9c0c1 in calltrap () at /usr/home/pwright/git/freebsd-base-graphics/sys/amd64/amd64/exception.S:236
#8  0xffffffff80a8a30b in kdb_enter (why=0xffffffff8138ff76 "panic", msg=0x80 <Address 0x80 out of bounds>) at cpufunc.h:63
#9  0xffffffff80a4a0cf in vpanic (fmt=<value optimized out>, ap=0xfffffe023035c540)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/kern_shutdown.c:760
#10 0xffffffff80a49f26 in kassert_panic (fmt=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/kern_shutdown.c:649
#11 0xffffffff8098de26 in pfs_destroy (pn=0x0) at /usr/home/pwright/git/freebsd-base-graphics/sys/fs/pseudofs/pseudofs.c:291
#12 0xffffffff82ec393a in sysfs_remove_dir (kobj=0xfffff801601c91d0)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/linuxkpi/../../compat/linsysfs/linsysfs_extern.c:338
#13 0xffffffff82ea5ce5 in kobject_del (kobj=0xfffff801601c91d0) at kobject.h:208
#14 0xffffffff82ea5c69 in linux_kobject_release (kref=0xfffff801601c91e0)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_compat.c:356
#15 0xffffffff82eb095c in kref_put (kref=0xfffff801601c91e0, rel=0xffffffff82ea5c20 <linux_kobject_release>) at kref.h:66
#16 0xffffffff82eb091e in kobject_put (kobj=0xfffff801601c91d0) at kobject.h:148
#17 0xffffffff82eb08e7 in put_device (dev=0xfffff801601c9198) at device.h:297
#18 0xffffffff82eaf244 in device_unregister (dev=0xfffff801601c9198) at device.h:486
#19 0xffffffff82eaf165 in i2c_del_adapter (adap=0xfffff801601c9150)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_i2c.c:494
#20 0xffffffff82d13b89 in intel_dp_aux_fini (intel_dp=0xfffff801601c90d8)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/i915/i915kms/../../../../dev/drm2/i915/intel_dp.c:1188
#21 0xffffffff82d124ab in intel_dp_init_connector (intel_dig_port=0xfffff801601c9000, intel_connector=0xfffff801601c6000)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/i915/i915kms/../../../../dev/drm2/i915/intel_dp.c:5971
#22 0xffffffff82cbd2d3 in intel_ddi_init_dp_connector (intel_dig_port=0xfffff801601c9000)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/i915/i915kms/../../../../dev/drm2/i915/intel_ddi.c:3245
#23 0xffffffff82cbcbba in intel_ddi_init (dev=0xfffff80160190000, port=PORT_A)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/i915/i915kms/../../../../dev/drm2/i915/intel_ddi.c:3359
#24 0xffffffff82cd451e in intel_setup_outputs (dev=0xfffff80160190000)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/i915/i915kms/../../../../dev/drm2/i915/intel_display.c:14485
#25 0xffffffff82cd2762 in intel_modeset_init (dev=0xfffff80160190000)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/i915/i915kms/../../../../dev/drm2/i915/intel_display.c:15424
#26 0xffffffff82c3ed64 in i915_load_modeset_init (dev=0xfffff80160190000)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/i915/i915kms/../../../../dev/drm2/i915/i915_dma.c:410
#27 0xffffffff82c3d3bb in i915_driver_load (dev=0xfffff80160190000, flags=18446744071610063040)
---Type <return> to continue, or q <return> to quit---
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/i915/i915kms/../../../../dev/drm2/i915/i915_dma.c:1136
#28 0xffffffff82e3b288 in drm_dev_register (dev=0xfffff80160190000, flags=18446744071610063040)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/drm2/../../../dev/drm2/drm_drv.c:770
#29 0xffffffff82e56c89 in drm_get_pci_dev (pdev=0xfffff80008a1d800, ent=0xffffffff82dc4910, driver=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/drm2/../../../dev/drm2/drm_pci.c:323
#30 0xffffffff82c46dbe in i915_pci_probe (pdev=0xfffff80008a1d800, ent=0xffffffff82dc4910)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/i915/i915kms/../../../../dev/drm2/i915/i915_drv.c:1008
#31 0xffffffff82eb6ec0 in linux_pci_attach (dev=0xfffff80004953b00)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_pci.c:227
#32 0xffffffff80a7e890 in device_attach (dev=0xfffff80004953b00) at device_if.h:180
#33 0xffffffff80a7ff76 in bus_generic_driver_added (dev=<value optimized out>, driver=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/subr_bus.c:2858
#34 0xffffffff80a7c25d in devclass_driver_added (dc=<value optimized out>, driver=<value optimized out>) at bus_if.h:204
#35 0xffffffff80a7c181 in devclass_add_driver (dc=<value optimized out>, driver=<value optimized out>, 
    pass=<value optimized out>, dcp=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/subr_bus.c:1172
#36 0xffffffff82eb5463 in pci_register_driver (pdrv=0xffffffff82dfabe0)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_pci.c:350
#37 0xffffffff82c46cd5 in i915_init ()
    at /usr/home/pwright/git/freebsd-base-graphics/sys/modules/drm2/i915/i915kms/../../../../dev/drm2/i915/i915_drv.c:1799
#38 0xffffffff82c46b7b in _module_run (arg=0xffffffff82c46c00) at module.h:80
#39 0xffffffff80a1d468 in linker_load_module (kldname=<value optimized out>, modname=0xfffff800087f9800 "i915kms", 
    parent=<value optimized out>, verinfo=<value optimized out>, lfpp=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/kern_linker.c:234
#40 0xffffffff80a1eac7 in kern_kldload (td=<value optimized out>, file=<value optimized out>, fileid=0xfffffe023035d884)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/kern_linker.c:1041
#41 0xffffffff80a1eb8b in sys_kldload (td=0xfffff8000c088000, uap=<value optimized out>)
    at /usr/home/pwright/git/freebsd-base-graphics/sys/kern/kern_linker.c:1067
#42 0xffffffff80ebcb2b in amd64_syscall (td=0xfffff8000c088000, traced=0) at subr_syscall.c:135
#43 0xffffffff80e9c3ab in Xfast_syscall () at /usr/home/pwright/git/freebsd-base-graphics/sys/amd64/amd64/exception.S:396
#44 0x000000080086d38a in ?? ()
mattmacy commented 7 years ago

Try updating to https://github.com/FreeBSDDesktop/freebsd-base-graphics/commit/535f0c128f22d6b05651a97c99175aae82ffa61d

nomadlogic commented 7 years ago

that did it, able to load i915kms now - testing X but will close this issue. thanks!