API change for bus_dma

Andrew Gallatin gallatin at cs.duke.edu
Fri Jun 27 12:33:26 PDT 2003


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






More information about the freebsd-arch mailing list