Subject: Re: bus_dmamap_sync not enough ?
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 02/11/2003 17:35:28
On Wed, Feb 12, 2003 at 08:44:51AM +0900, Izumi Tsutsui wrote:

 > Off topic, but I guess fxp(4) is the only driver that does
 > BUS_DMASYNC_PREREAD again after the driver finds out DMA didn't complete.
 > All (?) other drivers rely on BUS_DMAMAP_COHERENT..
 > (fxp(4) allocates RXDESCs on mbuf so it cannot use BUS_DMAMAP_COHERENT.)

I think it's fair to classify the drivers which do not issue another
dmamap_sync to be buggy ... I think it boils down to "someone noticed
the bug on an ARM platform, and the fxp driver got fixed".  The reason
it's fair to classify the others as buggy is that the bus_dma(9) manual
page states that a driver should not rely on BUS_DMA_COHERENT for correct
operation, that is is merely a hint to the back-end.

In any case, the wm(4) driver also does not rely on BUS_DMA_COHERENT in
order to function properly; see dev/pci/if_wm.c:1610.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>