From owner-freebsd-questions@FreeBSD.ORG Mon Jul 14 16:02:57 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45A0F1065681 for ; Mon, 14 Jul 2008 16:02:57 +0000 (UTC) (envelope-from yonyossef.lists@gmail.com) Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.191]) by mx1.freebsd.org (Postfix) with ESMTP id 0EF3C8FC21 for ; Mon, 14 Jul 2008 16:02:56 +0000 (UTC) (envelope-from yonyossef.lists@gmail.com) Received: by rn-out-0910.google.com with SMTP id j71so1605960rne.12 for ; Mon, 14 Jul 2008 09:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=xySBA3C12XPucnLHCtEJZdfg46AEAe0bDsYxW+RBvsQ=; b=B3DD4RGCUPUpNM+wRS16Aza2NOK5ba52t/0yG+0AxhQg61jjGTXc90Euzuicg9Mqw/ DKuhyVzP2K/EgBeSBmIciOnIzx82KvOUY/xnW3p6+iFBOerVQoe1xRoWZt2gF5GGnbNE wqNM1/zu32BkjHHjjXGtd09B2/ISCOCWMz5f4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=dQowwV5v7LNdkfjngh+44rwGIbvcdjmc1gIpJ6IN/tDSNLfFnDEnpSFgw83ASFL9rj EYS8i8V4I+OMBcaFaqA+aDGk/WKn67q1exKPgOLIoRi8PfTAYbsbpxvW72AEXaXta1g0 ZFop+Bqz8u8H0xb2I8yJ9cGuTv1b6Joz4zRhE= Received: by 10.150.12.3 with SMTP id 3mr20568583ybl.15.1216051376351; Mon, 14 Jul 2008 09:02:56 -0700 (PDT) Received: by 10.151.84.2 with HTTP; Mon, 14 Jul 2008 09:02:56 -0700 (PDT) Message-ID: <20def4870807140902y4e5aad69r649d577fb5f5ad84@mail.gmail.com> Date: Mon, 14 Jul 2008 19:02:56 +0300 From: "Yony Yossef" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: options WITNESS and locks X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2008 16:02:57 -0000 Hi all. I'm trying to debug a "spinlock held too long" error. Therefore I thought compiling my kernel with "options WITNESS" would be a good idea. Using the WITNESS kernel I cannot load my driver with any MTX_SPIN mutex. I had to change it all to MTX_DEF since every MTX_SPIN got me this error: panic: lock (network driver) spin mutex does not match earlier (sleep mutex) lock So I changed it all to MTX_DEF, just to see if things will work. Now I can load my driver, but calling ifconfig shows a new crash: mtnic0: Activating port:1 mtnic0: Ethernet address: 00:00:00:00:08:88 mtnic0: Activating port:2 mtnic1: Ethernet address: 00:00:00:00:08:89 lock order reversal: (sleepable after non-sleepable) 1st 0xffffffff81379010 MTNIC state semaphore (MTNIC state semaphore) @ mtnic_netdev.c:1855 2nd 0xffffffff809eee00 ACPI root bus (ACPI root bus) @ /usr/src/sys/dev/acpica/acpi.c:1022 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2a witness_checkorder() at witness_checkorder+0x559 _sx_xlock() at _sx_xlock+0x32 acpi_alloc_resource() at acpi_alloc_resource+0x9a pci_alloc_resource() at pci_alloc_resource+0x81 resource_list_alloc() at resource_list_alloc+0x17a pci_alloc_resource() at pci_alloc_resource+0x81 bus_alloc_resource() at bus_alloc_resource+0x89 mtnic_start_port() at mtnic_start_port+0x4f1 mtnic_open() at mtnic_open+0xb2 ether_ioctl() at ether_ioctl+0xb5 mtnic_ioctl() at mtnic_ioctl+0x3e in_ifinit() at in_ifinit+0x8d in_control() at in_control+0xc66 ifioctl() at ifioctl+0xea kern_ioctl() at kern_ioctl+0xa3 ioctl() at ioctl+0xf9 syscall() at syscall+0x1b5 Xfast_syscall() at Xfast_syscall+0xab --- syscall (54, FreeBSD ELF64, ioctl), rip = 0x800824cfc, rsp = 0x7fffffffe3b8, rbp = 0x7fffffffee10 --- KDB: enter: witness_checkorder [thread pid 1051 tid 100069 ] Stopped at kdb_enter+0x31: leave db> Can anybody please tell me what is going on here? -Yony