cvs commit: src/sys/i386/i386 busdma_machdep.c

Jake Burkholder jake at locore.ca
Mon Apr 14 00:32:28 PDT 2003


Apparently, On Sun, Apr 13, 2003 at 09:19:42PM -0700,
	Hidetoshi Shimokawa said words to the effect of;

> simokawa    2003/04/13 21:19:42 PDT
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/i386/i386        busdma_machdep.c 
>   Log:
>   * Use _bus_dmamap_load_buffer() and respect maxsegsz in bus_dmamap_load().
>   Ignoring maxsegsz may lead to fatal data corruption for some devices.
>   ex. SBP-2/FireWire

Hmm.  _bus_dmamap_load_buffer doesn't handle delayed loads due to lack
of resources like bus_dmamap_load does (did).  I think you will need to
respect BUS_DMA_WAITOK/BUS_DMA_NOWAIT in the flags argument to
_bus_dmamap_load_buffer, and pass BUS_DMA_WAITOK in bus_dmamap_load and
BUS_DMA_NOWAIT in other cases.  If _bus_dmamap_load_buffer runs out of
resources it should return EINPROGRESS and queue the request if
BUS_DMA_WAITOK is specified, or return ENOMEM if BUS_DMA_NOWAIT is specified.

Disk drivers which use bounce buffers do not expect ENOMEM to be returned
from bus_dmamap_load, they expect EINPROGRESS to be returned and the callback
to be called later when enough resources are available, which will no longer
happen.

Jake


More information about the cvs-src mailing list