Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Oct 2010 08:55:10 -0700
From:      Matthew Fleming <mdf356@gmail.com>
To:        freebsd-current@freebsd.org, John Baldwin <jhb@freebsd.org>
Subject:   intr_event_destroy(9)
Message-ID:  <AANLkTimOG%2BsVxc3mQw3aYhCpsZznw6Cd53CA-YCgtCgd@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
It looks like a bug in intr_event_destroy(9): I'm trying to unload a
new driver being developed internally for NVRAM, and I get this
WITNESS warning and hang:


# kldunload rnv
Sleeping on "ithdty" with the following non-sleepable locks held:
exclusive sleep mutex intr event list (intr event list) r = 0
(0xffffffff806f9560) locked @
/data/sb/BR_BONNEVILLE_HW/src/sys/kern/kern_intr.c:404
KDB: stack backtrace:
[ffffffff801a544d] db_trace_self_wrapper+0x3d
[ffffffff802e7b26] witness_warn+0x2f6
[ffffffff802a1a43] _sleep+0xc3
[ffffffff8026dad5] intr_event_destroy+0xe5
[ffffff87b05ba805] rnv_pci_detach+0xc5
[ffffffff802c9414] device_detach+0xb4
[ffffffff802c974f] devclass_delete_driver+0xdf
[ffffffff802c991d] driver_module_handler+0x11d
[ffffffff802843a2] module_unload+0x42
[ffffffff80279f4b] linker_file_unload+0x19b
[ffffffff8027aa1b] kern_kldunload+0x10b
[ffffffff802a2609] isi_syscall+0x99
[ffffffff804dee3e] ia32_syscall+0x1ce
[ffffffff804a7e50] Xint0x80_syscall+0x60
--- syscall (444, FreeBSD ELF32, kldunloadf), rip = 0x280c1aff, rsp =
0xffffd44c, rbp = 0xffffdc98 ---

Looking at intr_event_destroy, I see this snippet from r157728:


#ifndef notyet
	if (ie->ie_thread != NULL) {
		ithread_destroy(ie->ie_thread);
		ie->ie_thread = NULL;
	}
#endif

There is an msleep(9) in ithread_destroy(9).  And everywhere else that
uses notyet has #ifdef, not #ifndef.  So... is this a typo?

Thanks,
matthew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimOG%2BsVxc3mQw3aYhCpsZznw6Cd53CA-YCgtCgd>