GitHub/moto-9609/android_kernel_motorola_exynos9610.git
8 years agoMerge branch 'topic/pl330' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:49:03 +0000 (09:19 +0530)]
Merge branch 'topic/pl330' into for-linus

8 years agoMerge branch 'topic/omap' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:48:55 +0000 (09:18 +0530)]
Merge branch 'topic/omap' into for-linus

8 years agoMerge branch 'topic/no_irq' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:48:29 +0000 (09:18 +0530)]
Merge branch 'topic/no_irq' into for-linus

8 years agoMerge branch 'topic/mv_xor' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:48:20 +0000 (09:18 +0530)]
Merge branch 'topic/mv_xor' into for-linus

8 years agoMerge branch 'topic/k3' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:48:14 +0000 (09:18 +0530)]
Merge branch 'topic/k3' into for-linus

8 years agoMerge branch 'topic/iommu' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:48:06 +0000 (09:18 +0530)]
Merge branch 'topic/iommu' into for-linus

8 years agoMerge branch 'topic/ioatdma' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:48:01 +0000 (09:18 +0530)]
Merge branch 'topic/ioatdma' into for-linus

8 years agoMerge branch 'topic/imx' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:47:52 +0000 (09:17 +0530)]
Merge branch 'topic/imx' into for-linus

8 years agoMerge branch 'topic/hsu' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:47:44 +0000 (09:17 +0530)]
Merge branch 'topic/hsu' into for-linus

8 years agoMerge branch 'topic/err_reporting' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:47:33 +0000 (09:17 +0530)]
Merge branch 'topic/err_reporting' into for-linus

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Conflicts:
drivers/dma/cppi41.c

8 years agoMerge branch 'topic/dmatest' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:46:32 +0000 (09:16 +0530)]
Merge branch 'topic/dmatest' into for-linus

8 years agoMerge branch 'topic/cppi' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:46:23 +0000 (09:16 +0530)]
Merge branch 'topic/cppi' into for-linus

8 years agoMerge branch 'topic/core' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:46:13 +0000 (09:16 +0530)]
Merge branch 'topic/core' into for-linus

8 years agoMerge branch 'topic/compile_test' into for-linus
Vinod Koul [Mon, 3 Oct 2016 03:46:03 +0000 (09:16 +0530)]
Merge branch 'topic/compile_test' into for-linus

8 years agodmaengine: virt-dma: move function declarations
Baoyou Xie [Sat, 24 Sep 2016 04:37:05 +0000 (12:37 +0800)]
dmaengine: virt-dma: move function declarations

We get 2 warnings when building kernel with W=1:
drivers/dma/virt-dma.c:22:14: warning: no previous prototype for 'vchan_tx_submit' [-Wmissing-prototypes]
drivers/dma/virt-dma.c:52:5: warning: no previous prototype for 'vchan_tx_desc_free' [-Wmissing-prototypes]

In fact, these two functions are incorrectly declared in a function.

So this patch moves function declarations out of this function.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: omap-dma: Enable burst and data pack for SG
Misael Lopez Cruz [Fri, 16 Sep 2016 10:53:15 +0000 (13:53 +0300)]
dmaengine: omap-dma: Enable burst and data pack for SG

Enable the burst and data pack modes for the scatter-gather
in order to improve the throughput of the data transfers.

The improvement has been verified with MMC HS200 mode in
the DRA72 EVM using the iozone tool to compare the read
throughput (in kB/s) with and without burst/pack for
different reclens (in kB).

                              With
    reclen    Baseline   sDMA burst/pack
    ------    --------   ---------------
       64       46568         50820
      128       57564         63413
      256       65634         74937
      512       72427         83483
     1024       74563         84504
     2048       76265         86079
     4096       78045         87335
     8192       78989         88154
    16384       81265         91034

Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoDT: dmaengine: rcar-dmac: document R8A7743/5 support
Sergei Shtylyov [Wed, 28 Sep 2016 22:25:48 +0000 (01:25 +0300)]
DT: dmaengine: rcar-dmac: document R8A7743/5 support

Renesas  RZ/G SoC also have the R-Car gen2/3 compatible DMA controllers.
Document RZ/G1[ME] (also known as R8A774[35]) SoC bindings.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: fsldma: Unmap region obtained by of_iomap
Arvind Yadav [Wed, 28 Sep 2016 10:45:11 +0000 (16:15 +0530)]
dmaengine: fsldma: Unmap region obtained by of_iomap

Free memory mapping, if probe is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Acked-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: jz4780: fix resource leaks on error exit return
Colin Ian King [Thu, 29 Sep 2016 17:45:05 +0000 (18:45 +0100)]
dmaengine: jz4780: fix resource leaks on error exit return

In two cases when jz4780_dma_setup_hwdesc fails, there is a memory
leak on the allocated desc and associated DMA pools on the error
exit return path.  Fix this by free'ing the resources before
returning.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodma-debug: fix ia64 build, use PHYS_PFN
Niklas Söderlund [Thu, 29 Sep 2016 19:59:15 +0000 (21:59 +0200)]
dma-debug: fix ia64 build, use PHYS_PFN

kbuild test robot reports:

   lib/dma-debug.c: In function 'debug_dma_map_resource':
>> lib/dma-debug.c:1541:16: error: implicit declaration of function '__phys_to_pfn' [-Werror=implicit-function-declaration]
     entry->pfn  = __phys_to_pfn(addr);
                   ^~~~~~~~~~~~~

ia64 does not provide __phys_to_pfn(), use the PHYS_PFN() alias.

Fixes: 0e74b34dfc3318bf ("dma-debug: add support for resource mappings")
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: coh901318: fix integer overflow when shifting more than 32 places
Colin Ian King [Thu, 29 Sep 2016 18:14:38 +0000 (19:14 +0100)]
dmaengine: coh901318: fix integer overflow when shifting more than 32 places

Currently U300_DMA_CHANNELS is set to 40, meaning that the shift of 1 can
be more than 32 places, which leads to a 32 bit integer overflow. Fix this
by using 1ULL instead of 1 before shifting it.  Also add braces on the
for-loop to keep with coding style conventions.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: edma: avoid uninitialized variable use
Arnd Bergmann [Fri, 30 Sep 2016 16:19:01 +0000 (18:19 +0200)]
dmaengine: edma: avoid uninitialized variable use

If edma_read_slot() gets an invalid argument, it does not set a result,
as found by "gcc -Wmaybe-uninitialized"

drivers/dma/edma.c: In function 'dma_ccerr_handler':
drivers/dma/edma.c:1499:21: error: 'p.a_b_cnt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/dma/edma.c:1499:21: error: 'p.ccnt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  if (p.a_b_cnt == 0 && p.ccnt == 0) {

If we change the function to return an error in this case, we can handle
the failure more gracefully and treat this the same way as a null slot
that we already catch.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodma-mapping: fix m32r build warning
Niklas Söderlund [Thu, 29 Sep 2016 10:02:40 +0000 (12:02 +0200)]
dma-mapping: fix m32r build warning

kbuild test robot reports:

   In file included from include/linux/skbuff.h:34:0,
                    from include/linux/icmpv6.h:4,
                    from include/linux/ipv6.h:75,
                    from include/net/ipv6.h:16,
                    from include/linux/sunrpc/clnt.h:27,
                    from include/linux/nfs_fs.h:30,
                    from fs/lockd/clntlock.c:13:
   include/linux/dma-mapping.h: In function 'dma_map_resource':
>> include/linux/dma-mapping.h:274:16: warning: unused variable 'pfn' [-Wunused-variable]
     unsigned long pfn = __phys_to_pfn(phys_addr);
                   ^~~

The pfn value is only used once in the call to pfn_valid(), remove the
variable and calculate the pfn when it's needed. Note that the kbuild
report is old and PHYS_PFN() is now used instead of __phys_to_pfn() to
calculate the pfn.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodma-mapping: fix ia64 build, use PHYS_PFN
Niklas Söderlund [Thu, 29 Sep 2016 10:02:39 +0000 (12:02 +0200)]
dma-mapping: fix ia64 build, use PHYS_PFN

kbuild test robot reports:

   In file included from include/linux/skbuff.h:34:0,
                    from include/linux/tcp.h:21,
                    from drivers/net/ethernet/amd/xgbe/xgbe-drv.c:119:
   include/linux/dma-mapping.h: In function 'dma_map_resource':
>> include/linux/dma-mapping.h:274:22: error: implicit declaration of function '__phys_to_pfn' [-Werror=implicit-function-declaration]
     unsigned long pfn = __phys_to_pfn(phys_addr);
                         ^~~~~~~~~~~~~

ia64 does not provide __phys_to_pfn(), use the PHYS_PFN() alias.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: ti-dma-crossbar: enable COMPILE_TEST
Peter Ujfalusi [Wed, 21 Sep 2016 12:41:35 +0000 (15:41 +0300)]
dmaengine: ti-dma-crossbar: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.
When compile testing eDMA or omap-dma, select also the ti-dma-crossbar so
it is also covered by the compile testing.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: omap-dma: enable COMPILE_TEST
Peter Ujfalusi [Wed, 21 Sep 2016 12:41:34 +0000 (15:41 +0300)]
dmaengine: omap-dma: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: edma: enable COMPILE_TEST
Peter Ujfalusi [Wed, 21 Sep 2016 12:41:33 +0000 (15:41 +0300)]
dmaengine: edma: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: ti-dma-crossbar: Fix of_device_id data parameter usage
Peter Ujfalusi [Wed, 21 Sep 2016 12:41:32 +0000 (15:41 +0300)]
dmaengine: ti-dma-crossbar: Fix of_device_id data parameter usage

Use pointers to static constant variables for crossbar type and for DMA
offset configuration.

Fixes compiler warnings on 64bit architectures:

drivers/dma/ti-dma-crossbar.c: In function ‘ti_dra7_xbar_probe’:
drivers/dma/ti-dma-crossbar.c:398:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  xbar->dma_offset = (u32)match->data;
                     ^
drivers/dma/ti-dma-crossbar.c: In function ‘ti_dma_xbar_probe’:
drivers/dma/ti-dma-crossbar.c:431:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  switch ((u32)match->data) {
          ^

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: ti-dma-crossbar: Correct type for of_find_property() third parameter
Peter Ujfalusi [Wed, 21 Sep 2016 12:41:31 +0000 (15:41 +0300)]
dmaengine: ti-dma-crossbar: Correct type for of_find_property() third parameter

The correct type is int and not for the third parameter of
of_find_property().
Fixes compilation for 64bit architectures (x86_64, aarch64).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine/ARM: omap-dma: Fix the DMAengine compile test on non OMAP configs
Peter Ujfalusi [Wed, 21 Sep 2016 12:41:30 +0000 (15:41 +0300)]
dmaengine/ARM: omap-dma: Fix the DMAengine compile test on non OMAP configs

The DMAengine driver for omap-dma use three function calls from the
plat-omap legacy driver. When the DMAengine driver is built when ARCH_OMAP
is not set, the compilation will fail due to missing symbols.
Add empty inline functions to allow the DMAengine driver to be compiled
with COMPILE_TEST.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: edma: Rename set_bits and remove unused clear_bits helper
Peter Ujfalusi [Thu, 22 Sep 2016 06:31:04 +0000 (09:31 +0300)]
dmaengine: edma: Rename set_bits and remove unused clear_bits helper

The clear_bits() helper is not used by the driver so it can be removed.

powerpc architecture defines the set_bits() in
arch/powerpc/include/asm/bitops.h which results failed compile testing on
powerpc architecture:

>> drivers/dma/edma.c:415:20: error: conflicting types for 'set_bits'
    static inline void set_bits(int offset, int len, unsigned long *p)
                       ^~~~~~~~
   In file included from include/linux/bitops.h:36:0,
                    from include/linux/kernel.h:10,
                    from include/linux/list.h:8,
                    from include/linux/kobject.h:20,
                    from include/linux/device.h:17,
                    from include/linux/dmaengine.h:20,
                    from drivers/dma/edma.c:16:
   arch/powerpc/include/asm/bitops.h:75:14: note: previous definition of 'set_bits' was here
    DEFINE_BITOP(set_bits, or, "")
                 ^
   arch/powerpc/include/asm/bitops.h:58:24: note: in definition of macro 'DEFINE_BITOP'
    static __inline__ void fn(unsigned long mask, \
                           ^~

>> drivers/dma/edma.c:421:20: error: conflicting types for 'clear_bits'
    static inline void clear_bits(int offset, int len, unsigned long *p)
                       ^~~~~~~~~~
   In file included from include/linux/bitops.h:36:0,
                    from include/linux/kernel.h:10,
                    from include/linux/list.h:8,
                    from include/linux/kobject.h:20,
                    from include/linux/device.h:17,
                    from include/linux/dmaengine.h:20,
                    from drivers/dma/edma.c:16:
   arch/powerpc/include/asm/bitops.h:76:14: note: previous definition of 'clear_bits' was here
    DEFINE_BITOP(clear_bits, andc, "")
                 ^
   arch/powerpc/include/asm/bitops.h:58:24: note: in definition of macro 'DEFINE_BITOP'
    static __inline__ void fn(unsigned long mask, \
                           ^~

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: edma: Use correct type for of_find_property() third parameter
Peter Ujfalusi [Wed, 21 Sep 2016 12:41:29 +0000 (15:41 +0300)]
dmaengine: edma: Use correct type for of_find_property() third parameter

The correct type is int and not for the third parameter of
of_find_property().
Fixes compilation for 64bit architectures (x86_64, aarch64).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: edma: Fix of_device_id data parameter usage (legacy vs TPCC)
Peter Ujfalusi [Wed, 21 Sep 2016 12:41:28 +0000 (15:41 +0300)]
dmaengine: edma: Fix of_device_id data parameter usage (legacy vs TPCC)

Use pointers to static constant variables for eDMA binding
type (legacy vs TPCC).

Fixes the following warning when compiling the driver for 64bit
architectures (x86_64 for example):
drivers/dma/edma.c:2185:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   if (match && (u32)match->data == EDMA_BINDING_TPCC)
                ^

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: edma: Add missing MODULE_DEVICE_TABLE() for of_device_id structs
Peter Ujfalusi [Wed, 21 Sep 2016 12:41:27 +0000 (15:41 +0300)]
dmaengine: edma: Add missing MODULE_DEVICE_TABLE() for of_device_id structs

The MODULE_DEVICE_TABLE() were missing from the driver for the of_device_id
structures.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: tegra-adma: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 10:31:52 +0000 (16:01 +0530)]
dmaengine: tegra-adma: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Suggested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: sun6i: Add support for Allwinner A83T (sun8i) variant
Jean-Francois Moine [Sun, 18 Sep 2016 07:59:50 +0000 (09:59 +0200)]
dmaengine: sun6i: Add support for Allwinner A83T (sun8i) variant

The A83T SoC has the same dma engine as the A31 (sun6i), with a reduced
amount of endpoints and physical channels.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: s3c24xx: Add dma_slave_map for s3c2440 devices
Sam Van Den Berge [Thu, 22 Sep 2016 18:51:15 +0000 (20:51 +0200)]
dmaengine: s3c24xx: Add dma_slave_map for s3c2440 devices

This patch updates the s3c24xx dma driver to be able to pass a
dma_slave_map array via the platform data. This is needed to
be able to use the new, simpler dmaengine API [1].
I used the virtual DMA channels as a parameter for the dma_filter
function. By doing that, I could reuse the existing filter function in
drivers/dma/s3c24xx-dma.c.

I have tested this on my mini2440 board with the audio driver.
According to my observations, dma_request_slave_channel in the
function dmaengine_pcm_new in the file
sound/soc/soc-generic-dmaengine-pcm.c now returns a valid DMA channel
whereas before no DMA channel was returned at that point.

Entries for DMACH_XD0, DMACH_XD1 and DMACH_TIMER are missing because I
don't realy know which driver to use for these.

[1]
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-December/393635.html

Signed-off-by: Sam Van Den Berge <sam.van.den.berge@telenet.be>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: moxart: fix kconfig unmet direct dependencies
Vinod Koul [Tue, 20 Sep 2016 05:02:47 +0000 (10:32 +0530)]
dmaengine: moxart: fix kconfig unmet direct dependencies

We have unmet direct dependencies as DMA_SUN4I selects DMA_OF so remove the
selection

warning: (DMA_SUN4I && MOXART_DMA && STM32_DMA) selects DMA_OF which has
unmet direct dependencies (DMADEVICES && OF)

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: sun4i: fix kconfig unmet direct dependencies
Vinod Koul [Tue, 20 Sep 2016 05:02:47 +0000 (10:32 +0530)]
dmaengine: sun4i: fix kconfig unmet direct dependencies

We have unmet direct dependencies as DMA_SUN4I selects DMA_OF so remove the
selection

warning: (DMA_SUN4I && MOXART_DMA && STM32_DMA) selects DMA_OF which has
unmet direct dependencies (DMADEVICES && OF)

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: zxdma: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 10:40:07 +0000 (16:10 +0530)]
dmaengine: zxdma: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: timb-dma: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 10:37:05 +0000 (16:07 +0530)]
dmaengine: timb-dma: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: s3c24xx: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 10:30:41 +0000 (16:00 +0530)]
dmaengine: s3c24xx: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: s3c24xx: fix pointer cast warnings
Vinod Koul [Wed, 14 Sep 2016 10:51:32 +0000 (16:21 +0530)]
dmaengine: s3c24xx: fix pointer cast warnings

On some systems, pointer can be large than unsigned int, triggering warning
pointer-to-int-cast on conversion.

drivers/dma/s3c24xx-dma.c: In function 's3c24xx_dma_filter':
drivers/dma/s3c24xx-dma.c:1421:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Use a long value for type conversion.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: s3c24xx: use correct print specifiers for size_t
Vinod Koul [Wed, 14 Sep 2016 10:45:20 +0000 (16:15 +0530)]
dmaengine: s3c24xx: use correct print specifiers for size_t

This driver warns:

drivers/dma/s3c24xx-dma.c: In function 's3c24xx_dma_prep_memcpy':
drivers/dma/s3c24xx-dma.c:826:2: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=]
drivers/dma/s3c24xx-dma.c:830:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]

We should use %zu to print 'size_t' values.

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: stm32-dma: make stm32_dma_set_config static
Vinod Koul [Fri, 2 Sep 2016 10:29:10 +0000 (15:59 +0530)]
dmaengine: stm32-dma: make stm32_dma_set_config static

Sparse complains:
drivers/dma/stm32-dma.c:957:6: warning: symbol 'stm32_dma_set_config' was
not declared. Should it be static?

SO make stm32_dma_set_config static.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: stm32-dma: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 10:27:51 +0000 (15:57 +0530)]
dmaengine: stm32-dma: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: mmp_tdma: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 10:27:09 +0000 (15:57 +0530)]
dmaengine: mmp_tdma: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

While at it, to fix build on other archs, select MMP_SRAM only for ARCH_MMP
and also fix the platform header

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: mmp_pdma: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 10:25:56 +0000 (15:55 +0530)]
dmaengine: mmp_pdma: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: mmp_tdma: use correct print specifiers for size_t
Vinod Koul [Wed, 14 Sep 2016 10:23:08 +0000 (15:53 +0530)]
dmaengine: mmp_tdma: use correct print specifiers for size_t

This driver warns:

drivers/dma/mmp_tdma.c: In function 'mmp_tdma_prep_dma_cyclic':
drivers/dma/mmp_tdma.c:437:5: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]

We should use %zu to print 'size_t' values.

Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: ep93xx: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 10:08:43 +0000 (15:38 +0530)]
dmaengine: ep93xx: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: ep93xx: don't use variables defined in global scope
Vinod Koul [Wed, 14 Sep 2016 10:09:56 +0000 (15:39 +0530)]
dmaengine: ep93xx: don't use variables defined in global scope

The driver uses same variable name in local and global context in a
function, rename the local one for better readability.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: ep93xx: use correct print specifiers for size_t
Vinod Koul [Wed, 14 Sep 2016 10:09:56 +0000 (15:39 +0530)]
dmaengine: ep93xx: use correct print specifiers for size_t

This driver warns:

drivers/dma/ep93xx_dma.c: In function 'ep93xx_dma_prep_slave_sg':
drivers/dma/ep93xx_dma.c:1054:6: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]

drivers/dma/ep93xx_dma.c: In function 'ep93xx_dma_prep_dma_cyclic':
drivers/dma/ep93xx_dma.c:1129:5: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]

We should use %zu to print 'size_t' values.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: sa11x0: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 10:01:42 +0000 (15:31 +0530)]
dmaengine: sa11x0: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: sa11x0: use correct print specifiers for size_t
Vinod Koul [Wed, 14 Sep 2016 09:52:49 +0000 (15:22 +0530)]
dmaengine: sa11x0: use correct print specifiers for size_t

This driver when compiled on 64 bits gave warnings:

drivers/dma/sa11x0-dma.c:602:2: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]

We should use %zu to print 'size_t' values.

Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: sa11x0: use correct print specifiers for u32
Vinod Koul [Wed, 14 Sep 2016 09:52:49 +0000 (15:22 +0530)]
dmaengine: sa11x0: use correct print specifiers for u32

This driver when compiled on 64 bits gave warnings:

drivers/dma/sa11x0-dma.c:494:2: warning: format ‘%zx’ expects argument of type ‘size_t’, but argument 4 has type ‘u32’ [-Wformat=]

We should use %x to print 'u32' values.

Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: sa11x0: use correct print specifiers for dma_addr_t
Vinod Koul [Wed, 14 Sep 2016 09:45:43 +0000 (15:15 +0530)]
dmaengine: sa11x0: use correct print specifiers for dma_addr_t

This driver when compiled on 64 bits gave warnings:

drivers/dma/sa11x0-dma.c:466:27: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat=]
drivers/dma/sa11x0-dma.c:554:31: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat=]
drivers/dma/sa11x0-dma.c:696:34: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat=]

We should use %pad to print 'dma_addr_t' values.

Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: coh901318: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 09:59:49 +0000 (15:29 +0530)]
dmaengine: coh901318: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: coh901318: use NULL for pointer initialization
Vinod Koul [Tue, 13 Sep 2016 17:25:01 +0000 (22:55 +0530)]
dmaengine: coh901318: use NULL for pointer initialization

Sparse complains:
drivers/dma/coh901318_lli.c:78:31: warning: Using plain integer as NULL pointer
drivers/dma/coh901318_lli.c:91:39: warning: Using plain integer as NULL pointer

Use NULL for pointer initialization rather than plain integer

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: coh901318: fix pointer cast warnings
Vinod Koul [Tue, 13 Sep 2016 16:57:53 +0000 (22:27 +0530)]
dmaengine: coh901318: fix pointer cast warnings

On some systems, pointer can be large than unsigned int, triggering warning
pointer-to-int-cast on conversion.

drivers/dma/coh901318.c: In function 'coh901318_filter_id':
drivers/dma/coh901318.c:1769:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  unsigned int ch_nr = (unsigned int) chan_id;

Also, converting an iomem pointer for print leads to warn on some system
which can be avoided with %p specfier

drivers/dma/coh901318.c: In function 'coh901318_probe':
drivers/dma/coh901318.c:2748:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   (u32) base->virtbase);

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: coh901318: return ssize_t for coh901318_debugfs_read
Vinod Koul [Tue, 13 Sep 2016 16:55:07 +0000 (22:25 +0530)]
dmaengine: coh901318: return ssize_t for coh901318_debugfs_read

The file_operations.read expects return as ssize_t, so update
coh901318_debugfs_read to return ssize_t to fix the warning:

drivers/dma/coh901318.c:1369:2: warning: initialization from incompatible pointer type [enabled by default]
  .read  = coh901318_debugfs_read,

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: coh901318: use correct print specifiers
Vinod Koul [Tue, 13 Sep 2016 16:48:32 +0000 (22:18 +0530)]
dmaengine: coh901318: use correct print specifiers

This driver when compiled on 64 bits gave warnings:

drivers/dma/coh901318.c: In function 'coh901318_list_print':
warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat=]
warning: format '%x' expects argument of type 'unsigned int', but argument 8 has type 'dma_addr_t' [-Wformat=]
warning: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'dma_addr_t' [-Wformat=]

drivers/dma/coh901318.c: In function 'coh901318_prep_memcpy':
warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]
warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat=]
warning: format '%d' expects argument of type 'int', but argument 8 has type 'size_t' [-Wformat=]

We should use %pad to print 'dma_addr_t' values and %zu to print size_t
values

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: jz4780: make jz4780_dma_prep_dma_memcpy static
Vinod Koul [Fri, 2 Sep 2016 09:57:55 +0000 (15:27 +0530)]
dmaengine: jz4780: make jz4780_dma_prep_dma_memcpy static

Sparse complains:
drivers/dma/dma-jz4780.c:399:32: warning: symbol
'jz4780_dma_prep_dma_memcpy' was not declared. Should it be static?

So make this static

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: jz4780: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 09:57:20 +0000 (15:27 +0530)]
dmaengine: jz4780: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: jz4740: enable COMPILE_TEST
Vinod Koul [Fri, 2 Sep 2016 09:55:11 +0000 (15:25 +0530)]
dmaengine: jz4740: enable COMPILE_TEST

To get more coverage, enable COMPILE_TEST for this driver.

Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: jz4740: remove unused arch header
Vinod Koul [Tue, 20 Sep 2016 03:32:43 +0000 (09:02 +0530)]
dmaengine: jz4740: remove unused arch header

The defines in asm/mach-jz4740/dma.h are not used by driver so remove it

Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: rcar-dmac: add iommu support for slave transfers
Niklas Söderlund [Wed, 10 Aug 2016 11:22:19 +0000 (13:22 +0200)]
dmaengine: rcar-dmac: add iommu support for slave transfers

Enable slave transfers to a device behind a IPMMU by mapping the slave
addresses using the dma-mapping API.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: rcar-dmac: group slave configuration
Niklas Söderlund [Wed, 10 Aug 2016 11:22:18 +0000 (13:22 +0200)]
dmaengine: rcar-dmac: group slave configuration

Group slave address and transfer size in own structs for source and
destination. This is in preparation for hooking up the dma-mapping API
to the slave addresses.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoarm: dma-mapping: add {map,unmap}_resource for iommu ops
Niklas Söderlund [Wed, 10 Aug 2016 11:22:17 +0000 (13:22 +0200)]
arm: dma-mapping: add {map,unmap}_resource for iommu ops

Add methods to map/unmap device resources addresses for dma_map_ops that
are IOMMU aware. This is needed to map a device MMIO register from a
physical address.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodma-mapping: add dma_{map,unmap}_resource
Niklas Söderlund [Wed, 10 Aug 2016 11:22:16 +0000 (13:22 +0200)]
dma-mapping: add dma_{map,unmap}_resource

Map/Unmap a device MMIO resource from a physical address. If no dma_map_ops
method is available the operation is a no-op.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodma-debug: add support for resource mappings
Niklas Söderlund [Wed, 10 Aug 2016 11:22:15 +0000 (13:22 +0200)]
dma-debug: add support for resource mappings

A MMIO mapped resource can not be represented by a struct page so a new
debug type is needed to handle this. This patch add such type and
functionality to add/remove entries and how to translate them to a
physical address.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodma-mapping: add {map,unmap}_resource to dma_map_ops
Niklas Söderlund [Wed, 10 Aug 2016 11:22:14 +0000 (13:22 +0200)]
dma-mapping: add {map,unmap}_resource to dma_map_ops

Add methods to handle mapping of device resources from a physical
address. This is needed for example to be able to map MMIO FIFO
registers to a IOMMU.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: dmatest: Restore "memcpy" as default mode
Eugeniy Paltsev [Wed, 14 Sep 2016 17:40:38 +0000 (20:40 +0300)]
dmaengine: dmatest: Restore "memcpy" as default mode

Commit 0d4cb44da6ca0e8 ("dmaengine: dmatest: Add support for
scatter-gather DMA mode") changes default "dmatest" behavior by
changing default mode from "memcpy" to "scatter-gather".
Now "memcpy" gets back as default mode.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: hsu: refactor hsu_dma_do_irq() to return int
Andy Shevchenko [Tue, 23 Aug 2016 13:09:40 +0000 (16:09 +0300)]
dmaengine: hsu: refactor hsu_dma_do_irq() to return int

Since we have nice macro IRQ_RETVAL() we would use it to convert a flag of
handled interrupt from int to irqreturn_t.

The rationale of doing this is:
a) hence we implicitly mark hsu_dma_do_irq() as an auxiliary function that
   can't be used as interrupt handler directly, and
b) to be in align with serial driver which is using serial8250_handle_irq()
   that returns plain int by design.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: mv_xor: Add support for IO (PCIe) src/dst areas
Stefan Roese [Thu, 15 Sep 2016 05:37:31 +0000 (07:37 +0200)]
dmaengine: mv_xor: Add support for IO (PCIe) src/dst areas

To enable the access to a specific area, the MVEBU XOR controllers needs
to have this area enabled / mapped via an address window. Right now,
only the DRAM memory area is enabled via such memory windows. So
using this driver to DMA to / from a e.g. PCIe memory region is
currently not supported.

This patch now adds support for such PCIe / IO regions by checking
if the src / dst address is located in an IO memory area in contrast
to being located in DRAM. This is done by using the newly introduced
MBus function mvebu_mbus_get_io_win_info(). If the src / dst address
is located in such an IO area, a new address window is created in
the XOR DMA controller. Enabling the controller to access this area.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Marcin Wojtas <mw@semihalf.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agobus: mvebu-mbus: Provide stub function for mvebu_mbus_get_io_win_info()
Stefan Roese [Thu, 15 Sep 2016 05:37:30 +0000 (07:37 +0200)]
bus: mvebu-mbus: Provide stub function for mvebu_mbus_get_io_win_info()

This patch provides a stub function for mvebu_mbus_get_io_win_info(),
which will be used for all non-Orion (ARM32 MVEBU) platforms for
compile test coverage.

On such platforms this function will return an error so that drivers
might detect a potential problem.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Marcin Wojtas <mw@semihalf.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: cppi41: Ignore EINPROGRESS for PM runtime
Tony Lindgren [Tue, 13 Sep 2016 17:22:43 +0000 (10:22 -0700)]
dmaengine: cppi41: Ignore EINPROGRESS for PM runtime

We can occasionally get -EINPROGRESS for pm_runtime_get. In that case
we can just continue as we're queueing transfers anyways when
pm_runtime_active is not set.

Fixes: fdea2d09b997 ("dmaengine: cppi41: Add basic PM runtime support")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: cleanup with list_first_entry_or_null()
Masahiro Yamada [Mon, 12 Sep 2016 18:08:17 +0000 (03:08 +0900)]
dmaengine: cleanup with list_first_entry_or_null()

The combo of list_empty() check and return list_first_entry()
can be replaced with list_first_entry_or_null().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: omap-dma: Correct type2 descriptor's member types
Peter Ujfalusi [Tue, 13 Sep 2016 07:58:43 +0000 (10:58 +0300)]
dmaengine: omap-dma: Correct type2 descriptor's member types

The type of CDEI, CSEI, CDFI and CSFI is signed.
This did not caused issue so far as we only use unsigned values.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: NO_IRQ removal from powerpc-only drivers
Michael Ellerman [Sat, 10 Sep 2016 09:56:04 +0000 (19:56 +1000)]
dmaengine: NO_IRQ removal from powerpc-only drivers

We'd like to eventually remove NO_IRQ on powerpc, so remove usages of it
from powerpc-only drivers.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: pl330: Acquire dmac's spinlock in pl330_tx_status
Hsin-Yu Chao [Tue, 23 Aug 2016 09:16:55 +0000 (17:16 +0800)]
dmaengine: pl330: Acquire dmac's spinlock in pl330_tx_status

There is a racing when accessing dmac thread in pl330_tx_status that
the pl330_update is handling active request at the same time and
changing the status of descriptors. This could cause an invalid
transferred count from BUSY descriptor added up to the residual number.
Fix the bug by using the dmac's spinlock in pl330_tx_status to protect
thread resources from changing.
Note that the nested order of holding dmac's and dma_chan's spinlock is
consistent with the rest of the driver: dma_chan first and then dmac,
so it is safe from deadlock scenario.

Signed-off-by: Hsin-Yu Chao <hychao@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: pl330: fix residual for non-running BUSY descriptors
Stephen Barber [Fri, 19 Aug 2016 00:59:59 +0000 (17:59 -0700)]
dmaengine: pl330: fix residual for non-running BUSY descriptors

Only one descriptor in the work list should be running at
any given time, but it's possible to have an enqueued BUSY
descriptor that has not yet transferred any data, or for
a BUSY descriptor to linger briefly before transitioning
to DONE. These cases should be handled to keep residual
calculations consistent even with the non-running BUSY
descriptors in the work list.

Signed-off-by: Stephen Barber <smbarber@chromium.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: dmatest: Apply copy_align to DMA_SG as well
Nicolin Chen [Thu, 8 Sep 2016 01:24:28 +0000 (18:24 -0700)]
dmaengine: dmatest: Apply copy_align to DMA_SG as well

The DMA_SG is still a type of memory copy operation that should
conform the hardware restriction. So this patch just applies the
copy_align to DMA_SG as well.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: cppi41: mark PM functions as __maybe_unused
Arnd Bergmann [Tue, 6 Sep 2016 13:20:05 +0000 (15:20 +0200)]
dmaengine: cppi41: mark PM functions as __maybe_unused

When CONFIG_PM_SLEEP is disabled, we get a build error in
the cppi41 dmaengine driver, since the runtime-pm functions
are hidden within the wrong #ifdef:

drivers/dma/cppi41.c:1158:21: error: 'cppi41_runtime_suspend' undeclared here (not in a function)

This removes the #ifdef and instead uses __maybe_unused
annotations that cannot have this problem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: fdea2d09b997 ("dmaengine: cppi41: Add basic PM runtime support")
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: k3dma: use correct format string for debug output
Arnd Bergmann [Tue, 6 Sep 2016 13:17:49 +0000 (15:17 +0200)]
dmaengine: k3dma: use correct format string for debug output

The newly added k3_dma_prep_dma_cyclic function has some debug output
that uses incorrect typecasts, some of which cause a warning like:

drivers/dma/k3dma.c: In function 'k3_dma_prep_dma_cyclic':
drivers/dma/k3dma.c:589:671: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

In general, we have to print 'dma_addr_t' values using special
'%pad' format to get the correct behavior on kernels that have
a 64-bit dma_addr_t type but 32-bit pointers.

Similarly, printing size_t values should be done using the %z
modifier to get the correct behavior on 64-bit kernels.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: a7e08fa6cc78 ("k3dma: Add cyclic mode for audio")
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: ipu: remove bogus NO_IRQ reference
Arnd Bergmann [Fri, 2 Sep 2016 23:22:02 +0000 (01:22 +0200)]
dmaengine: ipu: remove bogus NO_IRQ reference

A workaround for a warning introduced a use of the NO_IRQ
macro that should have been gone for a long time.

It is clear from the code that the value cannot actually
be used, but apparently there was a configuration at
some point that caused a warning, so instead of just
reverting that patch, this rearranges the code in a way that
the warning cannot reappear.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 6ef41cf6f721 ("dmaengine :ipu: change ipu_irq_handler() to remove compile warning")
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: sirf: fix irq number error check
Arnd Bergmann [Fri, 2 Sep 2016 23:17:20 +0000 (01:17 +0200)]
dmaengine: sirf: fix irq number error check

irq_of_parse_and_map() returns 0 on error, no NO_IRQ, so the
failure condition can never be met.

This changes the comparison to check for zero instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: mxs: remove NO_IRQ check
Arnd Bergmann [Fri, 2 Sep 2016 23:01:06 +0000 (01:01 +0200)]
dmaengine: mxs: remove NO_IRQ check

The mxs_chan->chan_irq variable is guaranteed to never be NO_IRQ,
as it gets assigned the result of platform_get_irq() that returns
either a valid positive interrupt number, or a negative failure
code that leads to the channel not being used.

This removes the redundant check, eliminating one more instance
of NO_IRQ.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: moxart: remove NO_IRQ
Arnd Bergmann [Fri, 2 Sep 2016 21:41:10 +0000 (23:41 +0200)]
dmaengine: moxart: remove NO_IRQ

The use of NO_IRQ is incorrect here and should never have been there,
as irq_of_parse_and_map() returns '0' on failure, not NO_IRQ.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: dmatest: exclude compare and fill time during perf report
Sinan Kaya [Thu, 1 Sep 2016 14:02:55 +0000 (10:02 -0400)]
dmaengine: dmatest: exclude compare and fill time during perf report

Dmatest is currently including compare and fill time into the
calculated performance numbers. This does not reflect the HW
capability and the results vary based on the CPU speed instead of
the HW speed.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: qcom_hidma: add error reporting for tx_status
Sinan Kaya [Wed, 31 Aug 2016 15:10:29 +0000 (11:10 -0400)]
dmaengine: qcom_hidma: add error reporting for tx_status

The HIDMA driver is capable of error detection. However, the error was
not being passed back to the client when tx_status API is called.

Changing the error handling behavior to follow this oder.

1. dmaengine asserts error interrupt
2. Driver receives and mark's the txn as error
3. Driver completes the txn and intimates the client. No further
   submissions. Drop the locks before calling callback, as subsequent
   processing by client maybe in callback thread.
4. Client invokes status and you can return error
5. On error, client calls terminate_all. You can reset channel, free all
   descriptors in the active, pending and completed lists
6. Client prepares new txn and so on.

As part of this work, got rid of the reset in the interrupt handler when
an error happens and the HW is put into disabled state. The only way to
recover is for the client to terminate the channel.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: qcom_hidma: report transfer errors with new interface
Sinan Kaya [Wed, 31 Aug 2016 15:10:28 +0000 (11:10 -0400)]
dmaengine: qcom_hidma: report transfer errors with new interface

Pass the DMA errors to the client by passing a result argument. The HW only
supports a generic error when something goes wrong. That's why, using
DMA_TRANS_ABORTED all the time.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: qcom_hidma: release the descriptor before the callback
Sinan Kaya [Wed, 31 Aug 2016 15:10:27 +0000 (11:10 -0400)]
dmaengine: qcom_hidma: release the descriptor before the callback

There is a race condition between data transfer callback and descriptor
free code. The callback routine may decide to clear the resources even
though the descriptor has not yet been freed.

Instead of calling the callback first and then releasing the memory,
this code is changing the order to return the descriptor back to the
free pool and then call the user provided callback.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: cppi41: Add basic PM runtime support
Tony Lindgren [Wed, 31 Aug 2016 14:19:59 +0000 (07:19 -0700)]
dmaengine: cppi41: Add basic PM runtime support

Let's keep the device enabled between cppi41_dma_issue_pending()
and dmaengine_desc_get_callback_invoke() and rely on the PM runtime
autoidle timeout elsewhere.

As the PM runtime is for whole device, not for each channel,
we need to queue pending transfers if the device is PM runtime
suspended. Then we start the pending transfers in PM runtime
resume.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agodmaengine: cppi41: Prepare to add PM runtime support
Tony Lindgren [Fri, 19 Aug 2016 22:59:39 +0000 (15:59 -0700)]
dmaengine: cppi41: Prepare to add PM runtime support

Let's just move code from cppi41_dma_issue_pending() to
push_desc_queue() as that's the only call to push_desc_queue().

We want to do this for PM runtime as we need to call push_desc_queue()
also for pending queued transfers from PM runtime resume.

No functional changes, just moves code around.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoKconfig: Allow k3dma driver to be selected for more then HISI3xx platforms
John Stultz [Mon, 29 Aug 2016 17:30:53 +0000 (10:30 -0700)]
Kconfig: Allow k3dma driver to be selected for more then HISI3xx platforms

This allows the k3dma driver to be selected on HiKey via the ARCH_HISI
dependency.

Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Andy Green <andy@warmcat.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agok3dma: Add cyclic mode for audio
Andy Green [Mon, 29 Aug 2016 17:30:52 +0000 (10:30 -0700)]
k3dma: Add cyclic mode for audio

Currently the k3dma driver doesn't offer the cyclic mode
necessary for handling audio.

This patch adds it.

Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Andy Green <andy@warmcat.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Andy Green <andy.green@linaro.org>
[jstultz: Forward ported to mainline, removed a few
 bits of logic that didn't seem to have much effect]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agok3dma: Fix memory handling in preparation for cyclic mode
John Stultz [Mon, 29 Aug 2016 17:30:51 +0000 (10:30 -0700)]
k3dma: Fix memory handling in preparation for cyclic mode

With cyclic mode, the shared virt-dma logic doesn't actually
manage the descriptor state, nor the calling of the descriptor
free callback. This results in leaking a desc structure every
time we start an audio transfer.

Thus we must manage it ourselves. The k3dma driver already keeps
track of the active and finished descriptors via ds_run and ds_done
pointers, so cleanup how we handle those two values, so when we
tear down everything in terminate_all, call free_desc on the ds_run
and ds_done pointers if they are not null.

NOTE: HiKey doesn't use the non-cyclic dma modes, so I'm not been
able to test those modes. But with this patch we no longer leak
the desc structures.

Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Andy Green <andy@warmcat.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agok3dma: Fix occasional DMA ERR issue by using proper dma api
John Stultz [Mon, 29 Aug 2016 17:30:50 +0000 (10:30 -0700)]
k3dma: Fix occasional DMA ERR issue by using proper dma api

After lots of debugging on an occasional DMA ERR issue, I realized
that the desc structures which we point the dma hardware are being
allocated out of regular memory. This means when we fill the desc
structures, that data doesn't always get flushed out to memory by
the time we start the dma transfer, resulting in the dma engine getting
some null values, resulting in a DMA ERR on the first irq.

Thus, this patch adopts mechanism similar to the zx296702_dma of
allocating the desc structures from a dma pool, so the memory caching
rules are properly set to avoid this issue.

Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Andy Green <andy@warmcat.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: John Stutlz <john.stultz@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agok3dma: Fix "nobody cared" message seen on any error
Andy Green [Mon, 29 Aug 2016 17:30:49 +0000 (10:30 -0700)]
k3dma: Fix "nobody cared" message seen on any error

As it was before, as soon as the DMAC IP felt there was an error
he would return IRQ_NONE since no actual transfer had completed.

After spinning on that for 100K interrupts, Linux yanks the IRQ with
a "nobody cared" error.

This patch lets it handle the interrupt and keep the IRQ alive.

Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Andy Green <andy@warmcat.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Andy Green <andy.green@linaro.org>
[jstultz: Forward ported to mainline]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agok3dma: Fix dma err offsets
Andy Green [Mon, 29 Aug 2016 17:30:48 +0000 (10:30 -0700)]
k3dma: Fix dma err offsets

The offsets for ERR1 and ERR2 are wrong actually.
That's why you can never clear an error.

Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Andy Green <andy@warmcat.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Andy Green <andy.green@linaro.org>
[jstultz: Forward ported to mainline]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>