Skip to contentSkip to conversation

dmapool (was: Re: Linux 2.6.3-rc2)

DISCUSSION David Brownell 1 participant 1 message Feb 13, 2004

lore
Share & tools
lore
#0 lore raw

Review

Quoted 6 lines
(quoted diff) +6 -0
+static inline int
+dma_supported(struct device *dev, u64 mask)
+{
+	BUG();
+	return 0;
+}

dma_supported() in particular shouldn't BUG(); this should work:

   if (use_dma && dma_supported(dev, ~(u32)0)) {
       ... set up for DMA ...
   } else {
       ... just use PIO instead ...
   }

Likewise the other routines that have clearly defined fault paths should probably just use those instead of BUG(). Examples of this type would be dma_alloc_coherent(), dma_map_sg() and maybe also dma_get_cache_alignment().

Of course the API still lacks clean fault reporting for the single shot mapping calls -- like maybe an arch-settable

  #define DMA_ADDR_INVALID (~(dma_addr_t)0)

return value -- but that'd be a different patch.

- Dave