Commit graph

494610 commits

Author SHA1 Message Date
Jürg Billeter ee4b876bbe dmaengine: rcar-dmac: Handle hardware descriptor allocation failure
If the atomic DMA coherent pool is too small, disable use of hardware
descriptor lists instead of crashing the system:

ERROR: 256 KiB atomic DMA coherent pool is too small!
Please increase it with coherent_pool= kernel parameter!

Unable to handle kernel NULL pointer dereference at virtual address 00000004
Internal error: Oops: a07 [#1] PREEMPT SMP ARM

PC is at rcar_dmac_chan_reinit+0x3c/0x160
LR is at _raw_spin_lock_irqsave+0x18/0x5c

[<802132c0>] (rcar_dmac_chan_reinit) from [<80214818>] (rcar_dmac_isr_error+0x84/0xa0)
[<80214818>] (rcar_dmac_isr_error) from [<80060484>] (handle_irq_event_percpu+0x50/0x150)
[<80060484>] (handle_irq_event_percpu) from [<800605c0>] (handle_irq_event+0x3c/0x5c)
[<800605c0>] (handle_irq_event) from [<8006350c>] (handle_fasteoi_irq+0xb8/0x198)
[<8006350c>] (handle_fasteoi_irq) from [<8005fdb0>] (generic_handle_irq+0x20/0x30)
[<8005fdb0>] (generic_handle_irq) from [<8000fcd0>] (handle_IRQ+0x50/0xc4)
[<8000fcd0>] (handle_IRQ) from [<800092cc>] (gic_handle_irq+0x28/0x5c)
[<800092cc>] (gic_handle_irq) from [<80012700>] (__irq_svc+0x40/0x70)

Kernel panic - not syncing: Fatal exception in interrupt

Signed-off-by: Jürg Billeter <j@bitron.ch>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2014-12-23 11:13:03 +02:00
Laurent Pinchart 1ed1315f9b dmaengine: rcar-dmac: Cache hardware descriptors memory
Unlike DMA transfers descriptors that are preallocated and cached,
memory used to store hardware descriptors is allocated and freed with
the DMA coherent allocation API for every transfer. Besides degrading
performances, this creates a CMA stress test that seems to cause issues.
Running dmatest with the noverify option produces

[   50.066539] alloc_contig_range test_pages_isolated(6b845, 6b846) failed
[   50.235180] alloc_contig_range test_pages_isolated(6b848, 6b84e) failed
[   52.964584] alloc_contig_range test_pages_isolated(6b847, 6b848) failed
[   54.127113] alloc_contig_range test_pages_isolated(6b843, 6b844) failed
[   56.270253] alloc_contig_range test_pages_isolated(6b84c, 6b850) failed

The root cause needs to be fixed, but in the meantime, as a workaround
and a performance improvement, cache hardware descriptors.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2014-12-23 11:13:03 +02:00
Laurent Pinchart ccadee9b1e dmaengine: rcar-dmac: Implement support for hardware descriptor lists
The DMAC supports hardware-based auto-configuration from descriptor
lists. This reduces the number of interrupts required for processing a
DMA transfer. Support that mode in the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2014-12-23 11:13:02 +02:00
Laurent Pinchart 87244fe5ab dmaengine: rcar-dmac: Add Renesas R-Car Gen2 DMA Controller (DMAC) driver
The DMAC is a general purpose multi-channel DMA controller that supports
both slave and memcpy transfers.

The driver currently supports the DMAC found in the r8a7790 and r8a7791
SoCs. Support for compatible DMA controllers (such as the audio DMAC)
will be added later.

Feature-wise, automatic hardware handling of descriptors chains isn't
supported yet. LPAE support is implemented.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2014-12-23 11:13:01 +02:00
Laurent Pinchart c4d7635280 dmaengine: rcar-dmac: Remove duplicate sentence from DT bindings
DT bindings are complex enough without expressing the same information
twice in a slightly different way. Remove the duplicate.

Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2014-12-23 10:52:49 +02:00
Laurent Pinchart 534a729866 dmaengine: Add 16 bytes, 32 bytes and 64 bytes bus widths
The widths are missing, add them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2014-12-23 10:52:48 +02:00
Rickard Strandqvist 9265eaed9c dmaengine: imx-dma.c: Remove unused function
Remove the function is_imx21_dma() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 21:04:16 +05:30
Vinod Koul fbde286783 dmaengine: nbpfaxi: update the driver comments
driver comment refers to DMA_PAUSE which needs to be updated to
.device_pause

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 20:28:04 +05:30
Vinod Koul b2be07d001 dmaengine: ep93xx: update the driver comments
driver comment refers to DMA_SLAVE_CONFIG which needs to be updated to
.device_config

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 20:27:25 +05:30
Vinod Koul 295d3e10e6 dmaengine: dw: update the driver comments
driver comment refers to DMA_SLAVE_CONFIG which needs to be updated to
.device_config

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 20:26:45 +05:30
Vinod Koul 3e1152a2f6 dmaengine: at_hdmac: update the driver comments
driver comment refers to DMA_SLAVE_CONFIG which needs to be updated to
.device_config

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 20:24:14 +05:30
Vinod Koul a7c439a458 dmaengine: tegra: fix incompatible pointer type warns
drivers/dma/tegra20-apb-dma.c:1428:37: warning: assignment from incompatible pointer type [enabled by default]
drivers/dma/ste_dma40.c: In function 'd40_terminate_all':

The function prototype expects return type 'int' whereas these where void

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:23 +05:30
Vinod Koul 35e639d1f7 dmaengine: ste_dma: fix incompatible pointer type warns
drivers/dma/ste_dma40.c:2627:3: warning: 'return' with a value, in function returning void [enabled by default]
drivers/dma/ste_dma40.c: In function 'd40_ops_init':
drivers/dma/ste_dma40.c:2869:28: warning: assignment from incompatible pointer type [enabled by default]

The function prototype expects return type 'int' whereas these where void

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:23 +05:30
Vinod Koul f67bcc4042 dmaengine: mxs-dma: fix unused variable warn
drivers/dma/mxs-dma.c: In function 'mxs_dma_terminate_all':
drivers/dma/mxs-dma.c:662:23: warning: unused variable 'mxs_chan'[-Wunused-variable]

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:23 +05:30
Vinod Koul a29c395636 dmaengine: mxs-dma: fix incompatible pointer type build warns
drivers/dma/mxs-dma.c: In function 'mxs_dma_probe':
drivers/dma/mxs-dma.c:848:35: warning: assignment from incompatible pointer type [enabled by default]
drivers/dma/mxs-dma.c:849:36: warning: assignment from incompatible pointer type [enabled by default]

The function prototype expects return type 'int' whereas these where void

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:23 +05:30
Vinod Koul 6269591b98 Documentation: dmaengine: clarify dma_slave_config expectations
dma_slave_config is expected to be set for slave operations Only, not for
memcpy ones

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:22 +05:30
Vinod Koul 6c04cd4f57 dmaengine: omap: fix the assignment to .device_config
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:22 +05:30
Vinod Koul e0cad7a00d dmaengine: mxs-dma: fix the arg to mxs_dma_reset_chan()
mxs_dma_reset_chan() expects struct dma_chan * as argument but we were
providing struct dma_chan, so fix this

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:22 +05:30
Maxime Ripard 1faab1f2e3 Documentation: dmaengine: Update the documentation
Now that we have splitted device_control and removed device_slave_caps in favor
of a few dma_device variables, update the documentation accordingly.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:22 +05:30
Maxime Ripard 2c44ad914c dmaengine: Remove device_control and device_slave_caps
Now that device_control has been split into several functions, and
device_slave_caps rendered useless, we can safely remove them.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:22 +05:30
Maxime Ripard ecc19d1786 dmaengine: Add a warning for drivers not using the generic slave caps retrieval
For the slave caps retrieval to be really useful, most drivers need to
implement it.

Hence, we need to be slightly more aggressive, and trigger a warning at
registration time for drivers that don't fill their caps infos in order to
encourage them to implement it.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:21 +05:30
Maxime Ripard 1cac81b438 dmaengine: sun6i: Declare slave capabilities for the generic code
Now that the generic slave caps code can make use of the device assigned
capabilities, instead of relying on a callback to be implemented.

Make use of this code.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:21 +05:30
Maxime Ripard 07ffa6ba7a dmaengine: sirf: Declare slave capabilities for the generic code
Now that the generic slave caps code can make use of the device assigned
capabilities, instead of relying on a callback to be implemented.

Make use of this code.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:21 +05:30
Maxime Ripard dcabe456b4 dmaengine: pl330: Declare slave capabilities for the generic code
Now that the generic slave caps code can make use of the device assigned
capabilities, instead of relying on a callback to be implemented.

Make use of this code.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:34:21 +05:30
Maxime Ripard 7d15b87dd8 dmaengine: omap: Declare slave capabilities for the generic code
Now that the generic slave caps code can make use of the device assigned
capabilities, instead of relying on a callback to be implemented.

Make use of this code.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:24 +05:30
Maxime Ripard 03526d3a67 dmaengine: nbpfaxi: Declare slave capabilities for the generic code
Now that the generic slave caps code can make use of the device assigned
capabilities, instead of relying on a callback to be implemented.

Make use of this code.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:23 +05:30
Maxime Ripard 9f59cd0519 dmaengine: edma: Declare slave capabilities for the generic code
Now that the generic slave caps code can make use of the device assigned
capabilities, instead of relying on a callback to be implemented.

Make use of this code.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:23 +05:30
Maxime Ripard f45c431148 dmaengine: fsl-edma: Declare slave capabilities for the generic code
Now that the generic slave caps code can make use of the device assigned
capabilities, instead of relying on a callback to be implemented.

Make use of this code.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:23 +05:30
Maxime Ripard b574368024 dmaengine: bcm2835: Declare slave capabilities for the generic code
Now that the generic slave caps code can make use of the device assigned
capabilities, instead of relying on a callback to be implemented.

Make use of this code.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:23 +05:30
Ludovic Desroches 8ac82f889c dmaengine: at_xdmac: Declare slave capabilities for the generic code
Now that the generic slave caps code can make use of the device assigned
capabilities, instead of relying on a callback to be implemented.

Make use of this code.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:23 +05:30
Maxime Ripard 7664cfe001 dmaengine: rapidio: tsi721: Rename device_control
Rename the device_control callback of the TXX9 DMA driver to terminate_all
since it's all it's really doing. That will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:22 +05:30
Maxime Ripard be16d8330a dmaengine: txx9: Rename device_control
Rename the device_control callback of the TXX9 DMA driver to terminate_all
since it's all it's really doing. That will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:22 +05:30
Maxime Ripard 2c55536ac3 dmaengine: td: Rename device_control
Rename the device_control callback of the Timberdal DMA driver to terminate_all
since it's all it's really doing. That will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:22 +05:30
Maxime Ripard c91781b44e dmaengine: pch-dma: Rename device_control
Rename the device_control callback of the Intel PCH DMA driver to terminate_all
since it's all it's really doing. That will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:22 +05:30
Maxime Ripard 581dc2ccb1 dmaengine: mv_xor: Remove device_control
The Marvell XOR engine doesn't allow any operations that use to be defined in
device_control, it shouldn't need to be defined. Since it's going to be
deprecated, remove it altogether.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:22 +05:30
Maxime Ripard ba7140462f dmaengine: xilinx: Split device_control
Split the device_control callback of the Xilinx VDMA driver to make use of the
newly introduced callbacks, that will eventually be used to retrieve slave
capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:21 +05:30
Maxime Ripard 662f1ac312 dmaengine: tegra20: Split device_control
Split the device_control callback of the NVidia Tegra20 APB DMA driver to make
use of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:21 +05:30
Maxime Ripard 6f5bad03e8 dmaengine: d40: Split device_control
Split the device_control callback of the ST-Ericsson DMA 40 driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:21 +05:30
Maxime Ripard 826b15a7a8 dmaengine: sun6i: Split device_control
Split the device_control callback of the Allwinner A31 DMA driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:33:21 +05:30
Maxime Ripard ed14a7c9fa dmaengine: sirf: Split device_control
Split the device_control callback of the SiRF Prima 2 DMA driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:32:16 +05:30
Maxime Ripard be60f94074 dmaengine: sh: Split device_control
Split the device_control callback of the Super-H DMA driver to make use of the
newly introduced callbacks, that will eventually be used to retrieve slave
capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:32:16 +05:30
Maxime Ripard 4a533218fc dmaengine: sa11x0: Split device_control
Split the device_control callback of the SA-11x0 DMA driver to make use of the
newly introduced callbacks, that will eventually be used to retrieve slave
capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:32:15 +05:30
Maxime Ripard 39ad460096 dmaengine: s3c24xx: Split device_control
Split the device_control callback of the Samsung S3C24xxx DMA driver to make
use of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:32:15 +05:30
Maxime Ripard 62ec8eb52d dmaengine: bam-dma: Split device_control
Split the device_control callback of the Qualcomm BAM DMA driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:32:15 +05:30
Maxime Ripard 740aa95703 dmaengine: pl330: Split device_control
Split the device_control callback of the AMBA PL330 DMA driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:32:15 +05:30
Maxime Ripard 78ea4fe7e7 dmaengine: omap: Split device_control
Split the device_control callback of the TI OMAP DMA driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:29:07 +05:30
Maxime Ripard e22aec0f00 dmaengine: nbpfaxi: Split device_control
Split the device_control callback of the NBPF AXI DMA driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:29:06 +05:30
Maxime Ripard 5c9d2e37ac dmaengine: mxs: Split device_control
Split the device_control callback of the Freescale MXS DMA driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:29:06 +05:30
Maxime Ripard 95335f1ff3 dmaengine: mpc512x: Split device_control
Split the device_control callback of the Freescale MPC512x DMA driver to make
use of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:29:04 +05:30
Maxime Ripard b7f7552bfa dmaengine: fsl-dma: Split device_control
Split the device_control callback of the Freescale Elo DMA driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

While we're at it, remove the useless prep_sg callback.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-12-22 12:29:03 +05:30