diff options
author | Dave Jiang <dave.jiang@intel.com> | 2012-04-04 16:10:46 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2012-04-05 15:27:12 -0700 |
commit | a2bd1140a264b561e38d99e656cd843c2d840e86 (patch) | |
tree | 9c9f19dde5c0213a52de0e77c16059062cc6c8a1 /drivers/dma | |
parent | f26df1a1a9452573af7b6cea9a4723593e838568 (diff) | |
download | linux-a2bd1140a264b561e38d99e656cd843c2d840e86.tar.gz linux-a2bd1140a264b561e38d99e656cd843c2d840e86.tar.bz2 linux-a2bd1140a264b561e38d99e656cd843c2d840e86.zip |
netdma: adding alignment check for NETDMA ops
This is the fallout from adding memcpy alignment workaround for certain
IOATDMA hardware. NetDMA will only use DMA engine that can handle byte align
ops.
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/dmaengine.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index a6c6051ec858..0f1ca74fe0bb 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -332,6 +332,20 @@ struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type) } EXPORT_SYMBOL(dma_find_channel); +/* + * net_dma_find_channel - find a channel for net_dma + * net_dma has alignment requirements + */ +struct dma_chan *net_dma_find_channel(void) +{ + struct dma_chan *chan = dma_find_channel(DMA_MEMCPY); + if (chan && !is_dma_copy_aligned(chan->device, 1, 1, 1)) + return NULL; + + return chan; +} +EXPORT_SYMBOL(net_dma_find_channel); + /** * dma_issue_pending_all - flush all pending operations across all channels */ |