Date: Mon, 14 Apr 2003 03:33:29 -0400 From: Jake Burkholder <jake@locore.ca> To: Hidetoshi Shimokawa <simokawa@FreeBSD.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/i386/i386 busdma_machdep.c Message-ID: <20030414073329.GC97094@locore.ca> In-Reply-To: <200304140419.h3E4Jgwi070671@repoman.freebsd.org>
index | next in thread | previous in thread | raw e-mail
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. Jakehome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030414073329.GC97094>
