From owner-cvs-src@FreeBSD.ORG Fri Jun 27 10:30:41 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D087A37B401; Fri, 27 Jun 2003 10:30:41 -0700 (PDT) Received: from magic.adaptec.com (magic-mail.adaptec.com [208.236.45.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE2F143F3F; Fri, 27 Jun 2003 10:30:40 -0700 (PDT) (envelope-from scottl@freebsd.org) Received: from redfish.adaptec.com (redfish.adaptec.com [162.62.50.11]) by magic.adaptec.com (8.11.6/8.11.6) with ESMTP id h5RHTo818797; Fri, 27 Jun 2003 10:29:50 -0700 Received: from freebsd.org (hollin.btc.adaptec.com [10.100.253.56]) by redfish.adaptec.com (8.8.8p2+Sun/8.8.8) with ESMTP id KAA18254; Fri, 27 Jun 2003 10:30:39 -0700 (PDT) Message-ID: <3EFC7E7C.4030000@freebsd.org> Date: Fri, 27 Jun 2003 11:27:24 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nate Lawson References: <20030627083158.E946C37B4A6@hub.freebsd.org> <20030627091203.B76929@root.org> In-Reply-To: <20030627091203.B76929@root.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/alpha/alpha busdma_machdep.csrc/sys/i386/i386 src/sys/powerpc/powerpc busdma_machdep.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2003 17:30:42 -0000 Nate Lawson wrote: > On Fri, 27 Jun 2003, Scott Long wrote: > >> Do the first and mostly mechanical step of adding mutex support to the >> bus_dma async callback scheme. Note that sparc64 does not seem to do >> async callbacks. Note that ia64 callbacks might not be MPSAFE at the >> moment. Note that powerpc doesn't seem to do async callbacks due to >> the implementation being incomplete. >> >> Reviewed by: mostly silence on arch@ >> >> Revision Changes Path >> 1.39 +5 -0 src/sys/alpha/alpha/busdma_machdep.c >> 1.47 +5 -0 src/sys/i386/i386/busdma_machdep.c >> 1.25 +5 -0 src/sys/ia64/ia64/busdma_machdep.c >> 1.16 +1 -0 src/sys/powerpc/powerpc/busdma_machdep.c >> >>@@ -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. There has been some late-breaking objection to this work, so we'll see where it heads. Scott