linux/arch/arm/common
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
..
bL_switcher_dummy_if.c ARM: bL_switcher: add a simple /dev user interface for debugging purposes 2013-08-05 00:13:00 -04:00
bL_switcher.c ARM: 7874/2: bL_switcher: Remove cpu_hotplug_driver_{lock,unlock}() 2013-11-07 00:14:14 +00:00
dmabounce.c ARM: dma-mapping: add support for dma_get_sgtable() 2012-07-30 12:25:47 +02:00
edma.c ARM: common: edma: Fix xbar mapping 2014-04-29 19:33:49 +05:30
firmware.c ARM: Add interface for registering and calling firmware-specific operations 2013-04-09 01:52:06 +09:00
icst.c
it8152.c arm/PCI: Use dev_is_pci() to identify PCI devices 2013-12-11 16:53:18 -07:00
Kconfig ARM: davinci: move private EDMA API to arm/common 2013-06-18 10:52:03 +05:30
locomo.c arm: Fold irq_set_chip/irq_set_handler 2011-03-29 14:47:58 +02:00
Makefile ARM: 7962/2: Make all mcpm functions notrace 2014-02-18 19:39:33 +00:00
mcpm_entry.c ARM: 7921/1: mcpm: remove redundant dsb instructions prior to sev 2013-12-29 12:32:44 +00:00
mcpm_head.S Merge branch 'baserock/bjdooks/312-rc4/be/core-v3' of git://git.baserock.org/delta/linux into devel-stable 2013-10-30 22:20:26 +00:00
mcpm_platsmp.c ARM: 7848/1: mcpm: Implement cpu_kill() to synchronise on powerdown 2013-10-29 11:07:15 +00:00
sa1111.c ARM: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
scoop.c ARM: 8006/1: Remove redundant code 2014-03-19 20:19:01 +00:00
sharpsl_param.c ARM: 7845/1: sharpsl_param.c: fix invalid memory access for pxa devices 2013-10-03 10:39:43 +01:00
timer-sp.c ARM: SP804: make Integrator/CP timer pick clock from DT 2014-02-13 11:20:36 +01:00
vlock.h ARM: mcpm: Add baremetal voting mutexes 2013-04-24 10:37:01 -04:00
vlock.S ARM: mcpm: use -st dsb option prior to sev instructions 2013-08-12 12:25:45 +01:00