Re: [PATCH] Add locking to twe(4) so it no longer uses Giant

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Thu, 09 Aug 2012 09:16:20 -0400
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
_at__at_ -342,9 +342,12 _at__at_
     /*
      * 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
Received on Thu Aug 09 2012 - 11:16:20 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:29 UTC