From owner-freebsd-current@FreeBSD.ORG Thu Aug 9 13:16:20 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5C9E1065672 for ; Thu, 9 Aug 2012 13:16:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9778A8FC19 for ; Thu, 9 Aug 2012 13:16:20 +0000 (UTC) Received: from John-Baldwins-MacBook-Air.local (d-69-161-105-82.cpe.metrocast.net [69.161.105.82]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id ED5E5B94B; Thu, 9 Aug 2012 09:16:19 -0400 (EDT) Message-ID: <5023B824.40405@FreeBSD.org> Date: Thu, 09 Aug 2012 09:16:20 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Mike Tancsa 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> In-Reply-To: <5023AB9D.5070608@sentex.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 09 Aug 2012 09:16:20 -0400 (EDT) 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 13:16:20 -0000 On 8/9/12 8:22 AM, Mike Tancsa wrote: > On 8/8/2012 2:39 PM, Mike Tancsa wrote: >> On 8/8/2012 7:27 AM, John Baldwin wrote: >>>> Looks like it breaks 3dm2 and the tw_cli. With the patch, I am not able >>>> to see the 8006 controller I added. >>> >>> Ugh, ok. A few questions: >>> >>> 1) Does the driver see any attached drives/volumes? >> >> Yes >> >>> >>> 2) If it does, does basic I/O to the drives work? >> >> yes Ok, so that's good. I didn't break anything fundamental with driver commands. >>> 3) Can you add some debugging printfs to twe_ioctl() to see what, if anything, >>> fails in that routine when tw_cli makes a request? >> >> Yes, for sure. Let me know what you would like me to add. > > 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). 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 -- John Baldwin