X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/ce1b0c871ed20dc27e9f58912daec93d24878031..240961d891ae8b4a0c3af6c3e2f7d1797216bee8:/target/linux/ixp4xx/patches-2.6.36/050-disable_dmabounce.patch diff --git a/target/linux/ixp4xx/patches-2.6.36/050-disable_dmabounce.patch b/target/linux/ixp4xx/patches-2.6.36/050-disable_dmabounce.patch index 4652a4fc6..bdbec619e 100644 --- a/target/linux/ixp4xx/patches-2.6.36/050-disable_dmabounce.patch +++ b/target/linux/ixp4xx/patches-2.6.36/050-disable_dmabounce.patch @@ -119,3 +119,36 @@ #define ISA_DMA_THRESHOLD (SZ_64M - 1) #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M) +--- a/arch/arm/common/dmabounce.c ++++ b/arch/arm/common/dmabounce.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -248,7 +249,13 @@ static inline dma_addr_t map_single(stru + needs_bounce = (dma_addr | (dma_addr + size - 1)) & ~mask; + } + +- if (device_info && (needs_bounce || dma_needs_bounce(dev, dma_addr, size))) { ++#ifdef CONFIG_DMABOUNCE ++int dma_needs_bounce_2(struct device *dev, dma_addr_t dma_addr, size_t size) ++{ ++ return (dev->bus == &pci_bus_type ) && ((dma_addr + size) > SZ_64M); ++} ++ ++ if (device_info && (needs_bounce || dma_needs_bounce_2(dev, dma_addr, size))) { + struct safe_buffer *buf; + + buf = alloc_safe_buffer(device_info, ptr, size, dir); +@@ -282,6 +289,7 @@ static inline dma_addr_t map_single(stru + + return dma_addr; + } ++#endif + + static inline void unmap_single(struct device *dev, dma_addr_t dma_addr, + size_t size, enum dma_data_direction dir)