From owner-freebsd-current@FreeBSD.ORG Tue Oct 26 15:55:11 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7C9E106564A; Tue, 26 Oct 2010 15:55:11 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2F48FC1E; Tue, 26 Oct 2010 15:55:11 +0000 (UTC) Received: by yxl31 with SMTP id 31so3088339yxl.13 for ; Tue, 26 Oct 2010 08:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=tZCOOsa40oZVwpBUpFjcRlfTLGPGMHpo50NATmxAldg=; b=geZYwLOaClAdXRNGUtrigfNxp2pNH/i6CAO9Jv16Z+6doz16vE6pQZrYHV5Z9b3a/P u4ciUzQpSNvp8crk0S3PCnAowImwZ0+rMPjkSJCvc6rqygXhQP7E1M0dC3bkOwKLPP0i 2H+57Z8m7yJJEXJxFjKpwI+noy8dI+B+1z8rs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=CuuWkob93sWwSn6o3dDg7W8KGiOY1iYUS5JJ/D/4HgfMtPHkAd+/kO43yUCGBxB+z/ Hr4BpZYsrNwtxlgms0eHfU6/NMdc2uWB/CMNN+i0+pb/SRYybFxCCdPjGrmRirxZ2vd6 O8oj8ke7Qi9AP6mrn7kylcJ4TTUqPwrEvrCEs= MIME-Version: 1.0 Received: by 10.42.182.15 with SMTP id ca15mr6712651icb.31.1288108510329; Tue, 26 Oct 2010 08:55:10 -0700 (PDT) Received: by 10.231.159.198 with HTTP; Tue, 26 Oct 2010 08:55:10 -0700 (PDT) Date: Tue, 26 Oct 2010 08:55:10 -0700 Message-ID: From: Matthew Fleming To: freebsd-current@freebsd.org, John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: intr_event_destroy(9) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 15:55:12 -0000 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