From owner-freebsd-current@FreeBSD.ORG Thu Aug 9 14:31:13 2012 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A405106564A; Thu, 9 Aug 2012 14:31:13 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1-6.sentex.ca [IPv6:2607:f3e0:0:1::12]) by mx1.freebsd.org (Postfix) with ESMTP id 09B358FC0C; Thu, 9 Aug 2012 14:31:12 +0000 (UTC) Received: from [192.168.43.26] (pyroxene.sentex.ca [199.212.134.18]) by smarthost1.sentex.ca (8.14.5/8.14.5) with ESMTP id q79EVCA3055740; Thu, 9 Aug 2012 10:31:12 -0400 (EDT) (envelope-from mike@sentex.net) Message-ID: <5023C9A6.9070502@sentex.net> Date: Thu, 09 Aug 2012 10:31:02 -0400 From: Mike Tancsa Organization: Sentex Communications User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: John Baldwin References: <201208031418.57941.jhb@freebsd.org> <201208031726.03652.jhb@freebsd.org> <502121F5.4020705@sentex.net> <201208080727.45595.jhb@freebsd.org> <5022B252.30606@sentex.net> <5023AB9D.5070608@sentex.net> <5023B824.40405@FreeBSD.org> In-Reply-To: <5023B824.40405@FreeBSD.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.72 on 64.7.153.18 Cc: Garrett Cooper , current@FreeBSD.org Subject: Re: [PATCH] Add locking to twe(4) so it no longer uses Giant 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: Thu, 09 Aug 2012 14:31:13 -0000 On 8/9/2012 9:16 AM, John Baldwin wrote: >> One more data point, /dev/twe0 does not exist with the patch and I think >> thats why the utils fail outright. > > Oh, hmm. That's odd. Do you get any error messages on the console > when twe0 attaches? Also, you have INVARIANTS enabled, yes? > (make_dev() panics when it fails if INVARIANTS is enabled). I have INVARIANTS in the kernel, sorry, do I need to do something to make it active ? 0{offsite2}# sysctl -a | grep -i invar kern.features.invariant_support: 1 options INVARIANT_SUPPORT options INVARIANTS kern.timecounter.invariant_tsc: 1 TSC: P-state invariant, performance statistics TSC: P-state invariant, performance statistics TSC: P-state invariant, performance statistics TSC: P-state invariant, performance statistics 0{offsite2}# Nothing odd in dmesg ZFS filesystem version 5 ZFS storage pool version 28 Timecounters tick every 1.000 msec twed0 on twe0 twed0: 953878MB (1953542144 sectors) usbus0: 480Mbps High Speed USB v2.0 usbus1: 480Mbps High Speed USB v2.0 pci6: on pcib6 twe0: <3ware Storage Controller. Driver version 1.50.01.002> port 0x2000-0x200f mem 0xe2810000-0xe281000f,0xe2000000-0xe 27fffff at device 0.0 on pci6 twe0: 2 ports, Firmware FE8S 1.05.00.068, BIOS BE7X 1.08.00.048 isab0: at device 31.0 on pci0 Patch below is causing a panic now on boot. Just going to add debugging to the serial console to see what it is.... and 0{offsite2}# kldload twe twe0: <3ware Storage Controller. Driver version 1.50.01.002> port 0x2000-0x200f mem 0xe2810000-0xe281000f,0xe2000000-0xe27fffff at device 0.0 on pci6 twe0: [GIANT-LOCKED] Fatal trap 12: page fault while in kernel mode cpuid = 4; apic id = 04 fault virtual address = 0x3 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff81813eb3 stack pointer = 0x28:0xffffff84529d33f0 frame pointer = 0x28:0xffffff84529d3430 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 1324 (kldload) [ thread pid 1324 tid 100146 ] Stopped at twe_setup+0x153: movzbl 0x3(%rdx),%eax db> > > Maybe try something like this (relative to the patched driver): > > --- //depot/user/jhb/cleanup/sys/dev/twe/twe_freebsd.c 2012-08-03 > 18:10:04.000000000 0000 > +++ /Users/jhb/work/p4/cleanup/sys/dev/twe/twe_freebsd.c 2012-08-03 > 18:10:04.000000000 0000 > @@ -342,9 +342,12 @@ > /* > * Create the control device. > */ > + device_printf(sc->twe_dev, "Calling make_dev()\n"); > sc->twe_dev_t = make_dev(&twe_cdevsw, device_get_unit(sc->twe_dev), > UID_ROOT, GID_OPERATOR, > S_IRUSR | S_IWUSR, "twe%d", device_get_unit(sc->twe_dev)); > sc->twe_dev_t->si_drv1 = sc; > + device_printf(sc->twe_dev, "make_dev() returned %p (%s)\n", > sc->twe_dev_t, > + sc->twe_dev_t->si_name); > /* > * Schedule ourselves to bring the controller up once interrupts > are available. > * This isn't strictly necessary, since we disable interrupts while > probing the > > -- ------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet services since 1994 www.sentex.net Cambridge, Ontario Canada http://www.tancsa.com/