linux/Documentation/devicetree/bindings/dma
Thomas Gleixner cf7eb97911 ARM: common: edma: Fix xbar mapping
This is another great example of trainwreck engineering:

commit 2646a0e529 (ARM: edma: Add EDMA crossbar event mux support)
added support for using EDMA on peripherals which have no direct EDMA
event mapping.

The code compiles and does not explode in your face, but that's it.

1) Reading an u16 array from an u32 device tree array simply does not
   work. Even if the function is named "edma_of_read_u32_to_s16_array".

   It merily calls of_property_read_u16_array. So the resulting 16bit
   array will have every other entry = 0.

2) The DT entry for the xbar registers related to xbar has length 0x10
   instead of the real length: 0xfd0 - 0xf90 = 0x40.

   Not a real problem as it does not cross a page boundary, but
   wrong nevertheless.

3) But none of this matters as the mapping never happens:

   After reading nonsense edma_of_read_u32_to_s16_array() invalidates
   the first array entry pair, so nobody can ever notice the
   braindamage by immediate explosion.

Seems the QA criteria for this code was solely not to explode when
someone adds edma-xbar-event-map entries to the DT. Goal achieved,
congratulations!

Not really helpful if someone wants to use edma on a device which
requires a xbar mapping.

Fix the issues by:

- annotating the device tree entry with "/bits/ 16" as documented in
  the of_property_read_u16_array kernel doc

- make the size of the xbar register mapping correct

- invalidating the end of the array and not the start

This convoluted mess wants to be completely rewritten as there is no
point to keep the xbar_chan array memory and the iomapping of the xbar
regs around forever. Marking the xbar mapped channels as used should
be done right there.

But that's a different issue and this patch is small enough to make it
work and allows a simple backport for stable.

Cc: stable@vger.kernel.org # v3.12+
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
2014-04-29 19:33:49 +05:30
..
arm-pl330.txt ARM: dts: pl330: Add #dma-cells for generic dma binding support 2013-02-14 20:04:27 +05:30
atmel-dma.txt dma: atmel-dma: correct typo in the device tree bindings documentation 2013-10-20 18:47:43 +05:30
bcm2835-dma.txt dmaengine: Add support for BCM2835 2014-01-07 21:36:39 +05:30
dma.txt of: dma: fix typos in generic dma binding definition 2013-01-06 20:57:46 -08:00
fsl-edma.txt dma: Add Freescale eDMA engine driver support 2014-02-18 16:52:35 +05:30
fsl-imx-dma.txt doc: devicetree: bindings: Fix typo in bindings 2013-07-25 12:32:07 +02:00
fsl-imx-sdma.txt dma: sdma: Add imx25 compatible 2014-02-18 17:10:49 +05:30
fsl-mxs-dma.txt ARM: dts: add generic DMA device tree binding for mxs-dma 2013-04-04 21:22:43 +08:00
k3dma.txt dmaengine: Add hisilicon k3 DMA engine driver 2013-08-28 11:23:40 +05:30
mmp-dma.txt ARM: dt: mmp-dma: add binding file 2012-09-21 15:51:26 +08:00
moxa,moxart-dma.txt dmaengine: Add MOXA ART DMA engine driver 2014-01-20 12:32:46 +05:30
mv-xor.txt dma: mv_xor: add Device Tree binding 2012-11-20 15:59:00 +01:00
qcom_bam_dma.txt dmaengine: qcom_bam_dma: Add device tree binding 2014-03-29 18:52:28 +05:30
shdma.txt DMA: shdma: switch DT mode to use configuration data from a match table 2013-08-27 14:25:09 +05:30
sirfsoc-dma.txt dmaengine: sirf: enable generic dt binding for dma channels 2014-03-29 19:20:13 +05:30
snps-dma.txt dmaengine: dw_dmac: move to generic DMA binding 2013-02-28 09:53:21 +05:30
ste-coh901318.txt dma: coh901318: add devicetree support 2013-06-17 13:54:27 +02:00
ste-dma40.txt dma: ste_dma40: Expand DT binding to accept 'high-priority channel' flag 2013-11-26 21:01:58 +01:00
tegra20-apbdma.txt ARM: tegra: document use of standard DMA DT bindings 2013-12-11 16:42:23 -07:00
ti-edma.txt ARM: common: edma: Fix xbar mapping 2014-04-29 19:33:49 +05:30