From owner-freebsd-arch@FreeBSD.ORG Fri Jun 27 12:33:26 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B06037B401 for ; Fri, 27 Jun 2003 12:33:26 -0700 (PDT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47B9743FBF for ; Fri, 27 Jun 2003 12:33:25 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.9/8.12.9) with ESMTP id h5RJXJwV028448 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 27 Jun 2003 15:33:19 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id h5RJXEN00619; Fri, 27 Jun 2003 15:33:14 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16124.39930.142492.356163@grasshopper.cs.duke.edu> Date: Fri, 27 Jun 2003 15:33:14 -0400 (EDT) To: Scott Long In-Reply-To: <3EF3C12F.9060303@btc.adaptec.com> References: <3EF3C12F.9060303@btc.adaptec.com> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid cc: freebsd-arch@freebsd.org Subject: Re: API change for bus_dma X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2003 19:33:26 -0000 Scott Long writes: > All, > > As I work towards locking down storage drivers, I'm also preening their > use of busdma. A common theme among them is a misuse of > bus_dmamap_load() and the associated callback mechanism. For most, the Why not just add a way to avoid deferring the callback entirely? I'm talking about something like Solaris' ability to pass DDI_DMA_DONTWAIT as the callback function to ddi_dma_buf_bind_handle(). My desire is to know immediately whether the DMA mapping failed. If it failed, that's OK with me. Since my driver locks users memory and maps it for DMA for a potentially unbounded amount of time, I want to know about a failure right away, not pile up requests that will never be satisfied. Can I get the behaviour I'm after by adding BUS_DMA_NOWAIT to the flags I pass to bus_dmamap_load()? Drew