Re: dmapool (was: Re: Linux 2.6.3-rc2)

From: David Brownell
Date: Fri Feb 13 2004 - 15:27:47 EST


+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



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/