From owner-cvs-src@FreeBSD.ORG Fri Jun 27 22:21: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 5C4B137B401; Fri, 27 Jun 2003 22:21:41 -0700 (PDT) Received: from aslan.scsiguy.com (mail.scsiguy.com [63.229.232.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58A8244022; Fri, 27 Jun 2003 22:21:40 -0700 (PDT) (envelope-from gibbs@scsiguy.com) Received: from aslan.scsiguy.com (aslan.scsiguy.com [63.229.232.106]) by aslan.scsiguy.com (8.12.9/8.12.8) with ESMTP id h5S5LdEU041357; Fri, 27 Jun 2003 23:21:39 -0600 (MDT) (envelope-from gibbs@scsiguy.com) Date: Fri, 27 Jun 2003 23:21:39 -0600 From: "Justin T. Gibbs" To: Scott Long , Nate Lawson Message-ID: <2573680000.1056777699@aslan.scsiguy.com> In-Reply-To: <3EFC7E7C.4030000@freebsd.org> References: <20030627083158.E946C37B4A6@hub.freebsd.org> <20030627091203.B76929@root.org> <3EFC7E7C.4030000@freebsd.org> X-Mailer: Mulberry/3.0.3 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline 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.c src/sys/i386/i386 busdma_machdep.c src/sys/ia64/ia64 busdma_machdep.c 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: Sat, 28 Jun 2003 05:21:41 -0000 >>> @@ -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