Date: Thu, 3 May 2007 11:07:16 -0700 From: "David Christensen" <davidch@broadcom.com> To: freebsd-current@freebsd.org Subject: How to Fix Kernel Panic When Lock Held During Page Fault for Command-Line Loaded bce Module? Message-ID: <09BFF2FA5EAB4A45B6655E151BBDD90303D507DF@NT-IRVA-0750.brcm.ad.broadcom.com>
next in thread | raw e-mail | index | archive | help
I'm building the "bce" driver as a module and loading/unloading it from the command-line to do some work on the driver. A recent change to the driver on -CURRENT (v1.25) has introduced the=20 following kernel panic: ------------------------------------------------------------------ =3D=3D=3D[root] /usr/src/sys/modules/bce # make load /sbin/kldload -v /usr/src/sys/modules/bce/if_bce.ko bce0: <Broadcom NetXtreme II BCM5708 1000Base-T (B1), v0.9.6> mem 0xdc000000-0xddffffff irq 16 at device 0.0 on pci2 bce0: ASIC ID 0x57081010; Revision (B1); PCI-X 64-bit 133MHz bce0: Ethernet address: 00:10:18:15:f3:e0 bce0: [ITHREAD] Kernel page fault with the following non-sleepable locks held: exclusive sleep mutex bce0 (network driver) r =3D 0 (0xffffffff8133e068) locked @ /usr/src/sys/modules/bce/../../dev/bce/if_bce.c:774 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2a kdb_backtrace() at kdb_backtrace+0x37 witness_warn() at witness_warn+0x2c1 trap() at trap+0x13f calltrap() at calltrap+0x8 --- trap 0xc, rip =3D 0xffffffffb07a79c3, rsp =3D 0xffffffffb079d840, = rbp =3D 0xffffffffb079d860 --- bce_ifmedia_upd_locked() at bce_ifmedia_upd_locked+0x23 bce_mgmt_init_locked() at bce_mgmt_init_locked+0x99 bce_attach() at bce_attach+0x90f device_attach() at device_attach+0x5a device_probe_and_attach() at device_probe_and_attach+0xfe pci_driver_added() at pci_driver_added+0xf3 devclass_add_driver() at devclass_add_driver+0xfb driver_module_handler() at driver_module_handler+0x8e module_register_init() at module_register_init+0x99 linker_file_sysinit() at linker_file_sysinit+0xaf linker_load_file() at linker_load_file+0x134 linker_load_module() at linker_load_module+0x110 kern_kldload() at kern_kldload+0xb9 kldload() at kldload+0x68 syscall() at syscall+0x307 Xfast_syscall() at Xfast_syscall+0xab --- syscall (304, FreeBSD ELF64, kldload), rip =3D 0x80068d24c, rsp =3D 0x7fffffffeb78, rbp =3D 0x7fffffffebf0 --- Fatal trap 12: page fault while in kernel mode cpuid =3D 0; apic id =3D 00 fault virtual address =3D 0x38 fault code =3D supervisor read data, page not present instruction pointer =3D 0x8:0xffffffffb07a79c3 stack pointer =3D 0x10:0xffffffffb079d840 frame pointer =3D 0x10:0xffffffffb079d860 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 672 (kldload) [thread pid 672 tid 100071 ] Stopped at bce_ifmedia_upd_locked+0x23: cmpl $0,0x38(%rax) ------------------------------------------------------------------ The important lines being: Kernel page fault with the following non-sleepable locks held: exclusive sleep mutex bce0 (network driver) r =3D 0 (0xffffffff8133e068) locked @ /usr/src/sys/modules/bce/../../dev/bce/if_bce.c:774 Why does this problem only occur when loading a module from the=20 command-line and what's the right way to fix it? David Christensen
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?09BFF2FA5EAB4A45B6655E151BBDD90303D507DF>