Date: Fri, 27 Jun 2003 23:31:17 -0600 From: Scott Long <scottl@freebsd.org> To: "Justin T. Gibbs" <gibbs@scsiguy.com> Cc: Nate Lawson <nate@root.org> Subject: Re: cvs commit: src/sys/alpha/alpha busdma_machdep.csrc/sys/i386/i386 src/sys/powerpc/powerpc busdma_machdep.c Message-ID: <3EFD2825.6080700@freebsd.org> In-Reply-To: <2573680000.1056777699@aslan.scsiguy.com> References: <20030627083158.E946C37B4A6@hub.freebsd.org> <20030627091203.B76929@root.org> <3EFC7E7C.4030000@freebsd.org> <2573680000.1056777699@aslan.scsiguy.com>
index | next in thread | previous in thread | raw e-mail
Justin T. Gibbs wrote:
>>>>@@ -931,8 +932,12 @@
>>>> while ((map = STAILQ_FIRST(&bounce_map_callbacklist)) != NULL) {
>>>> STAILQ_REMOVE_HEAD(&bounce_map_callbacklist, links);
>>>> mtx_unlock(&bounce_lock);
>>>>+ if (map->callback_mtx != NULL)
>>>>+ mtx_lock(map->callback_mtx);
>>>> bus_dmamap_load(map->dmat, map, map->buf, map->buflen,
>>>> map->callback, map->callback_arg, /*flags*/0);
>>>>+ if (map->callback_mtx != NULL)
>>>>+ mtx_unlock(map->callback_mtx);
>>>> mtx_lock(&bounce_lock);
>>>> }
>>>> mtx_unlock(&bounce_lock);
>>>
>>>
>>>Good to see you working on this area. Why would callback_mtx be null? If
>>>it is null, is it safe to call the function without the lock held?
>>>
>>>-Nate
>>>
>>
>>Yes, calling with a NULL mutex would be allowed and would behave as
>>expected.
>
>
> Does this code run without giant? If not, shouldn't it be dropping giant
> upon calling what should be an MP safe client? If so, doesn't it need
> to pick up giant in for the non-MP safe clients?
>
> --
> Justin
>
>
Ah, good point. For all but ia64, some attempt has been made to make
the swi be MPSAFE. I'll look into it.
Scott
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EFD2825.6080700>
