aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisael Lopez Cruz2015-05-25 22:38:58 -0500
committerMisael Lopez Cruz2015-08-06 16:22:59 -0500
commitedd64fc2917317eae73b80c9b2fef85e91694764 (patch)
treea04ed129018312ab6d17a1ed82d22b5f146acdb0
parent72c47d30355b7ff2e857fcda112eebc771e76d6d (diff)
downloadkernel-audio-topic/ti-linux-4.1.y-edma.tar.gz
kernel-audio-topic/ti-linux-4.1.y-edma.tar.xz
kernel-audio-topic/ti-linux-4.1.y-edma.zip
ARM: edma: Mark xbar related channels as usedtopic/ti-linux-4.1.y-edma
eDMA channels not being used in the platform are assumed to be without event association. The ones detected as 'used' are those from DT nodes whose "dmas" property have a direct reference to the eDMA controller node. However, when a DMA crossbar is present the "dmas" property actually points to the crossbar node, not to the DMA controller. The DMA crossbar related channels can be identified in the controller's translation function and marked as 'used' in the platform. Due to the current direct mapping between DMA requests and eDMA channels, it's possible that the DMA channel corresponding to the crossbar-translated DMA request might have been already taken by another client. The conflict might occur if such client uses memcpy transfer type. Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
-rw-r--r--arch/arm/common/edma.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index ef3b10356e25..739e0f10470b 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -1585,6 +1585,18 @@ static struct of_dma_filter_info edma_filter_info = {
1585 .filter_fn = edma_filter_fn, 1585 .filter_fn = edma_filter_fn,
1586}; 1586};
1587 1587
1588struct dma_chan *edma_of_xlate(struct of_phandle_args *dma_spec,
1589 struct of_dma *ofdma)
1590{
1591 struct dma_chan *chan = of_dma_simple_xlate(dma_spec, ofdma);
1592
1593 if (chan)
1594 clear_bit(EDMA_CHAN_SLOT(dma_spec->args[0]),
1595 edma_cc[0]->edma_unused);
1596
1597 return chan;
1598}
1599
1588static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev, 1600static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev,
1589 struct device_node *node) 1601 struct device_node *node)
1590{ 1602{
@@ -1601,7 +1613,7 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev,
1601 1613
1602 dma_cap_set(DMA_SLAVE, edma_filter_info.dma_cap); 1614 dma_cap_set(DMA_SLAVE, edma_filter_info.dma_cap);
1603 dma_cap_set(DMA_CYCLIC, edma_filter_info.dma_cap); 1615 dma_cap_set(DMA_CYCLIC, edma_filter_info.dma_cap);
1604 of_dma_controller_register(dev->of_node, of_dma_simple_xlate, 1616 of_dma_controller_register(dev->of_node, edma_of_xlate,
1605 &edma_filter_info); 1617 &edma_filter_info);
1606 1618
1607 return info; 1619 return info;