[Top] [All Lists]

DMA_NONCOHERENT and dma_map_single

Subject: DMA_NONCOHERENT and dma_map_single
From: Dimitri Torfs <>
Date: Sun, 18 Jan 2004 20:50:06 +0100
Original-recipient: rfc822;
User-agent: Mutt/1.4.1i

  dma_map_single() is supposed to be called on a buffer that exactly
  starts and ends on a cacheline boundary, otherwise "bad things"
  (e.g. overwrite of data that was written by device, ...) (especially
  on dma non-coherent systems) may happen. 

  So what should be done when dma_map_single is not called
  with a sane (ptr, size) argument ?

    - is the driver (caller) considered buggy and should we return a 0
      return-value ?
    - is the driver (caller) considered buggy but we do the mapping
      anyway, hoping that the driver has not/will not touched/touch
      the boundary cachelines ?
    - should we take appropriate actions to make sure the
      cache-effects do not come into play (e.g. by using some kind of
      bounce buffer) ?


Dimitri Torfs       |  NSCE |  The Corporate Village
tel: +32 2 7008541  |  Da Vincilaan 7 - D1 
fax: +32 2 7008622  |  B-1935 Zaventem - Belgium

<Prev in Thread] Current Thread [Next in Thread>