GitHub/LineageOS/android_kernel_motorola_exynos9610.git
8 years agoasync_pq_val: fix DMA memory leak
Justin Maggard [Tue, 4 Oct 2016 20:17:58 +0000 (13:17 -0700)]
async_pq_val: fix DMA memory leak

Add missing dmaengine_unmap_put(), so we don't OOM during RAID6 sync.

Fixes: 1786b943dad0 ("async_pq_val: convert to dmaengine_unmap_data")
Signed-off-by: Justin Maggard <jmaggard@netgear.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoMerge branch 'topic/unmap_cleanup' into for-linus
Vinod Koul [Mon, 3 Oct 2016 04:06:11 +0000 (09:36 +0530)]
Merge branch 'topic/unmap_cleanup' into for-linus

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

8 years agoMerge branch 'topic/ste_dma40' into for-linus
Vinod Koul [Mon, 3 Oct 2016 04:05:55 +0000 (09:35 +0530)]
Merge branch 'topic/ste_dma40' into for-linus

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 agoste_dma40: Rename a jump label in d40_log_lli_to_lcxa()
Markus Elfring [Sat, 17 Sep 2016 14:39:06 +0000 (16:39 +0200)]
ste_dma40: Rename a jump label in d40_log_lli_to_lcxa()

Adjust a jump label according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Rename a jump label in __d40_execute_command_phy()
Markus Elfring [Sat, 17 Sep 2016 14:28:54 +0000 (16:28 +0200)]
ste_dma40: Rename a jump label in __d40_execute_command_phy()

Adjust a jump label according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Rename a jump label in dma_tasklet()
Markus Elfring [Sat, 17 Sep 2016 14:23:43 +0000 (16:23 +0200)]
ste_dma40: Rename a jump label in dma_tasklet()

Adjust a jump label according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Rename jump labels in d40_alloc_mask_set()
Markus Elfring [Sat, 17 Sep 2016 14:16:42 +0000 (16:16 +0200)]
ste_dma40: Rename jump labels in d40_alloc_mask_set()

Adjust jump labels according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Rename a jump label in d40_alloc_mask_free()
Markus Elfring [Sat, 17 Sep 2016 14:10:41 +0000 (16:10 +0200)]
ste_dma40: Rename a jump label in d40_alloc_mask_free()

Adjust a jump label according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Rename a jump label in d40_free_dma()
Markus Elfring [Sat, 17 Sep 2016 14:04:46 +0000 (16:04 +0200)]
ste_dma40: Rename a jump label in d40_free_dma()

Adjust a jump label according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Rename a jump label in d40_is_paused()
Markus Elfring [Sat, 17 Sep 2016 14:00:05 +0000 (16:00 +0200)]
ste_dma40: Rename a jump label in d40_is_paused()

Adjust jump labels according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Move an assignment in d40_prep_desc()
Markus Elfring [Sat, 17 Sep 2016 13:54:12 +0000 (15:54 +0200)]
ste_dma40: Move an assignment in d40_prep_desc()

Move one assignment for the local variable "cfg" so that its setting
will only be performed after a call of the function "d40_desc_get"
succeeded by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Rename a jump label in d40_prep_desc()
Markus Elfring [Sat, 17 Sep 2016 13:51:37 +0000 (15:51 +0200)]
ste_dma40: Rename a jump label in d40_prep_desc()

Adjust jump labels according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Move two assignments in d40_prep_sg()
Markus Elfring [Sat, 17 Sep 2016 13:40:05 +0000 (15:40 +0200)]
ste_dma40: Move two assignments in d40_prep_sg()

Move assignments for two local variables so that their setting
will only be performed after corresponding data processing succeeded
by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: One check less in d40_prep_sg() after error detection
Markus Elfring [Sat, 17 Sep 2016 13:34:07 +0000 (15:34 +0200)]
ste_dma40: One check less in d40_prep_sg() after error detection

* Adjust jump targets according to the Linux coding style convention.

* Delete a repeated check which became unnecessary with this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Rename a jump label in d40_alloc_chan_resources()
Markus Elfring [Sat, 17 Sep 2016 13:15:15 +0000 (15:15 +0200)]
ste_dma40: Rename a jump label in d40_alloc_chan_resources()

Adjust jump labels according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Rename jump labels in d40_dmaengine_init()
Markus Elfring [Sat, 17 Sep 2016 13:10:15 +0000 (15:10 +0200)]
ste_dma40: Rename jump labels in d40_dmaengine_init()

Adjust jump labels according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Rename a jump label in d40_probe()
Markus Elfring [Sat, 17 Sep 2016 12:50:53 +0000 (14:50 +0200)]
ste_dma40: Rename a jump label in d40_probe()

Adjust jump labels according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Adjust the position of a jump label in d40_probe()
Markus Elfring [Sat, 17 Sep 2016 12:36:26 +0000 (14:36 +0200)]
ste_dma40: Adjust the position of a jump label in d40_probe()

Add a space character before a single jump label in this function
according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Delete unnecessary variable initialisations in d40_hw_detect_init()
Markus Elfring [Sat, 17 Sep 2016 12:34:18 +0000 (14:34 +0200)]
ste_dma40: Delete unnecessary variable initialisations in d40_hw_detect_init()

Five local variables will be set to an appropriate value a bit later.
Thus omit the explicit initialisation which became unnecessary with
a previous update step.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Less checks in d40_hw_detect_init() after error detection
Markus Elfring [Sat, 17 Sep 2016 12:10:47 +0000 (14:10 +0200)]
ste_dma40: Less checks in d40_hw_detect_init() after error detection

Four checks could be repeated by the d40_hw_detect_init() function during
error handling even if the passed variables contained a null pointer.

* Adjust jump targets according to the Linux coding style convention.

* Call the interface "iounmap" only once at the end.

* Delete the repeated checks which became unnecessary with
  this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Use kmalloc_array() in d40_hw_detect_init()
Markus Elfring [Sat, 17 Sep 2016 09:44:55 +0000 (11:44 +0200)]
ste_dma40: Use kmalloc_array() in d40_hw_detect_init()

A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".

This issue was detected also by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Replace four kzalloc() calls by kcalloc() in d40_hw_detect_init()
Markus Elfring [Sat, 17 Sep 2016 07:56:32 +0000 (09:56 +0200)]
ste_dma40: Replace four kzalloc() calls by kcalloc() in d40_hw_detect_init()

* The script "checkpatch.pl" can point information out like the following.

  WARNING: Prefer kcalloc over kzalloc with multiply

  Thus fix the affected source code places.

* Replace the specification of data types by pointer dereferences
  to make the corresponding size determination a bit safer according to
  the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Improve a size determination in d40_of_probe()
Markus Elfring [Sat, 17 Sep 2016 06:28:05 +0000 (08:28 +0200)]
ste_dma40: Improve a size determination in d40_of_probe()

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Move an assignment in d40_lcla_allocate()
Markus Elfring [Sat, 17 Sep 2016 06:24:46 +0000 (08:24 +0200)]
ste_dma40: Move an assignment in d40_lcla_allocate()

Move one assignment for the local variable "ret" so that its setting
will only be performed after corresponding data processing succeeded
by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Rename a jump label in d40_lcla_allocate()
Markus Elfring [Sat, 17 Sep 2016 06:23:37 +0000 (08:23 +0200)]
ste_dma40: Rename a jump label in d40_lcla_allocate()

Adjust jump labels according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Return directly after a failed kmalloc_array()
Markus Elfring [Sat, 17 Sep 2016 06:21:30 +0000 (08:21 +0200)]
ste_dma40: Return directly after a failed kmalloc_array()

Return directly after a memory allocation failed in this function
at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
8 years agoste_dma40: Use kmalloc_array() in d40_lcla_allocate()
Markus Elfring [Fri, 16 Sep 2016 15:56:07 +0000 (17:56 +0200)]
ste_dma40: Use kmalloc_array() in d40_lcla_allocate()

* A multiplication for the size determination of a memory allocation
  indicated that an array data structure should be processed.
  Thus use the corresponding function "kmalloc_array".

  This issue was detected by using the Coccinelle software.

* Replace the specification of a data type by a pointer dereference
  to make the corresponding size determination a bit safer according to
  the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.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>