Commit graph

2313 commits

Author SHA1 Message Date
Robert Jarzmik ecb9b4241f dmaengine: mmp_pdma: fix warning about slave caps
Fix the dmaengine complaint about missing slave caps :
 - declare the available bus widths
 - declare the available transfer types
 - declare the residue calculation type

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-03-05 22:15:35 +05:30
Stanimir Varbanov 90b1047f13 dmaengine: qcom_bam_dma: fix wrong register offsets
The commit fb93f520e (dmaengine: qcom_bam_dma: Generalize BAM
register offset calculations) wrongly populated base offsets
for event registers for bam v1.4.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Reviewed-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-03-05 22:07:12 +05:30
Stanimir Varbanov fe4be5e9f9 dmaengine: bam-dma: fix a warning about missing capabilities
Avoid the warning below triggered during dmaengine async device
registration.

WARNING: CPU: 1 PID: 1 at linux/drivers/dma/dmaengine.c:863
dma_async_device_register+0x2a8/0x4b8()
this driver doesn't support generic slave capabilities reporting

To do that fill mandatory .directions bit mask,
.src/dst_addr_widths and .residue_granularity dma_device fields
with appropriate values.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-03-05 21:44:38 +05:30
Dave Jiang 9ca1c5f2ab dmaengine: ioatdma: workaround for incorrect DMACAP register
BDX-DE IOATDMA reports incorrect DMACAP register for PQ related
ops. Ignoring those bits.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-03-05 14:32:02 +05:30
Ludovic Desroches 6eb9d3c1e9 dmaengine: at_xdmac: fix for chan conf simplification
When simplificating the channel configuration, the cyclic case has been
forgotten. It leads to use bad configuration causing many bugs.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-03-05 14:29:57 +05:30
Jie Yang 94b3eed7b8 dmaengine: dw: don't handle interrupt when dmaengine is not used
When dma controller is not used by any user and set off,
we should disble interrupt handler, at least the interrupt
reset part, for some subsystem, e.g. ADSP, may use the
dma in its own logic, here reset the interrupt may make
this subsystem work abnormally.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-03-05 14:07:48 +05:30
Qiao Zhou 1eed601a5b dma: mmp-tdma: refine dma disable and dma-pos update
Below are the refinements.
1. Set DMA abort bit when disabling dma channel. This will clear
the remaining data in dma FIFO, to fix channel-swap issue.
2. Read DMA HW pointer when updating DMA status. Previously dma
position is calculated by adding one period size in dma interrupt.
This is inaccurate/insufficient for some high-quality audio APP.
Since interrupt bottom half handler has variable schedule delay,
it causes big error when calculating sample delay. Read the actual
HW pointer and feedback can improve the accuracy.
3. Do some minor code clean.

Signed-off-by: Qiao Zhou <zhouqiao@marvell.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-03-04 18:03:15 +05:30
Geert Uytterhoeven b6d1778bc5 dmaengine: shdma: Move DMA stop to (runtime) suspend callbacks
During system reboot, the sh-dma-engine device may be runtime-suspended,
causing a crash:

    Unhandled fault: imprecise external abort (0x1406) at 0x0002c02c
    Internal error: : 1406 [#1] SMP ARM
    ...
    PC is at sh_dmae_ctl_stop+0x28/0x64
    LR is at sh_dmae_ctl_stop+0x24/0x64

If the sh-dma-engine is runtime-suspended, its module clock is turned
off, and its registers cannot be accessed.

To fix this, move the call to sh_dmae_ctl_stop(), which touches the
DMAOR register, to the sh_dmae_suspend() and sh_dmae_runtime_suspend()
callbacks.  This makes PM operations more symmetric, as both
sh_dmae_resume() and sh_dmae_runtime_resume() already call sh_dmae_rst()
to re-initialize the DMAOR register.

Remove sh_dmae_shutdown(), as it became empty.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-03-02 22:10:44 +05:30
Qiao Zhou 3a314f143d dmaenegine: mmp-pdma: fix irq handler overwrite physical chan issue
Some dma channels may be reserved for other purpose in other layer,
like secure driver in EL2/EL3. PDMA driver can see the interrupt
status, but it should not try to handle related interrupt, since it
doesn't belong to PDMA driver in kernel. These interrupts should be
handled by corresponding client/module.Otherwise, it will overwrite
illegal memory and cause unexpected issues, since pdma driver only
requests resources for pdma channels.

In PDMA driver, the reserved channels are at the end of total 32
channels. If we find interrupt bit index is not smaller than total
dma channels, we should ignore it.

Signed-off-by: Qiao Zhou <zhouqiao@marvell.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-23 22:09:56 +05:30
Linus Torvalds ce1d3fde87 Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Pull dmaengine updates from Vinod Koul:
 "This update brings:

   - the big cleanup up by Maxime for device control and slave
     capabilities.  This makes the API much cleaner.

   - new IMG MDC driver by Andrew

   - new Renesas R-Car Gen2 DMA Controller driver by Laurent along with
     bunch of fixes on rcar drivers

   - odd fixes and updates spread over driver"

* 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (130 commits)
  dmaengine: pl330: add DMA_PAUSE feature
  dmaengine: pl330: improve pl330_tx_status() function
  dmaengine: rcar-dmac: Disable channel 0 when using IOMMU
  dmaengine: rcar-dmac: Work around descriptor mode IOMMU errata
  dmaengine: rcar-dmac: Allocate hardware descriptors with DMAC device
  dmaengine: rcar-dmac: Fix oops due to unintialized list in error ISR
  dmaengine: rcar-dmac: Fix spinlock issues in interrupt
  dmaenegine: edma: fix sparse warnings
  dmaengine: rcar-dmac: Fix uninitialized variable usage
  dmaengine: shdmac: extend PM methods
  dmaengine: shdmac: use SET_RUNTIME_PM_OPS()
  dmaengine: pl330: fix bug that cause start the same descs in cyclic
  dmaengine: at_xdmac: allow muliple dwidths when doing slave transfers
  dmaengine: at_xdmac: simplify channel configuration stuff
  dmaengine: at_xdmac: introduce save_cc field
  dmaengine: at_xdmac: wait for in-progress transaction to complete after pausing a channel
  ioat: fail self-test if wait_for_completion times out
  dmaengine: dw: define DW_DMA_MAX_NR_MASTERS
  dmaengine: dw: amend description of dma_dev field
  dmatest: move src_off, dst_off, len inside loop
  ...
2015-02-18 08:49:20 -08:00
Linus Torvalds ea7531ac4a ARM: SoC cleanups
This is a good healthy set of various code removals. Total net delta is 8100
 lines removed.
 
 Among the larger cleanups are:
 
 - Removal of old Samsung S3C DMA infrastructure by Arnd
 - Removal of the non-DT version of the 'lager' board by Magnus Damm
 - General stale code removal on OMAP and Davinci by Rickard Strandqvist
 - Removal of non-DT support on am3517 platforms by Tony Lindgren
 
 ... plus several other cleanups of various platforms across the board.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJU4uYeAAoJEIwa5zzehBx3v58P/RGKt5e4CgCdHKjVhbPmADSE
 FVECT4qrIkf4dFgU5qPCBDCtQn/B3ljxZnq6Hqi8VxYD+pRcXt94R50ZyhGUZ6QF
 GLXU8jDSlY906uJwW+CHZFVLmDjTM4ONLn1ZMRtcdOrU3yGC5rZq9+Kla6ZIE6jb
 mUAFMj6e+NBPYDonq93G7968EdyLJOtK4B2ylPW0+wgSRGIEPibCiNi9yyN4hBFr
 LiaOyY/execKUo2K2BFWkfAZWt7GrwBu/qAkz/9YDRDiikLwFG2UBWbaik5Fj8tf
 v8wvpL6Af6iLpRx1wI/HoCgjFS/g/n4O3svMe7aHGyfrkEAxNtoCKlFscO8w/aLc
 eABNAb5j65it8IHvQMR5RhgqWoQe4XMlDcwsxotTe64GfxpTahdhDmhk7RKAY9Xq
 MyITvtZPTPHTSZHNEDE3HtgHn62ndSinYFhdTaBi2FQxLNCUFl2TKZxpb0r65JI/
 2yOf6hcgWGTgV1VOruAc5SHcSkQOY3SptM4n4F1B0VcDrCphBDYhRTdokELFJIIq
 I47Week8o0f+a4ot/sf0QhU68wVZENgUJO3/Q5Buta+UGSZa4NYH7Ymc159e7hGS
 k+7mCeTJC85F0H/EBWvCcZzbpwiq7jBRAY2PhqYF1EQkefdR/+28o1sX090fVaXD
 n0gXv3/ZDvJB2ryv8lR/
 =tsjK
 -----END PGP SIGNATURE-----

Merge tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC cleanups from Olof Johansson:
 "This is a good healthy set of various code removals.  Total net delta
  is 8100 lines removed.

  Among the larger cleanups are:

   - Removal of old Samsung S3C DMA infrastructure by Arnd
   - Removal of the non-DT version of the 'lager' board by Magnus Damm
   - General stale code removal on OMAP and Davinci by Rickard Strandqvist
   - Removal of non-DT support on am3517 platforms by Tony Lindgren

  ... plus several other cleanups of various platforms across the board"

* tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (47 commits)
  ARM: sirf: drop redundant function and marco declaration
  arm: omap: specify PMUs are for ARMv7 CPUs
  arm: shmobile: specify PMUs are for ARMv7 CPUs
  arm: iop: specify PMUs are for XScale CPUs
  arm: pxa: specify PMUs are for XScale CPUs
  arm: realview: specify PMU types
  ARM: SAMSUNG: remove unused DMA infrastructure
  ARM: OMAP3: Add back Kconfig option MACH_OMAP3517EVM for ASoC
  ARM: davinci: Remove CDCE949 driver
  ARM: at91: remove useless at91rm9200_set_type()
  ARM: at91: remove useless at91rm9200_dt_initialize()
  ARM: at91: move debug-macro.S into the common space
  ARM: at91: remove useless at91_sysirq_mask_rtx
  ARM: at91: remove useless config MACH_AT91SAM9_DT
  ARM: at91: remove useless config MACH_AT91RM9200_DT
  ARM: at91: remove unused mach/memory.h
  ARM: at91: remove useless header file includes
  ARM: at91: remove unneeded header file
  rtc: at91/Kconfig: remove useless options
  ARM: at91/Documentation: add a README for Atmel SoCs
  ...
2015-02-17 09:17:33 -08:00
Robert Baldyga 88987d2c75 dmaengine: pl330: add DMA_PAUSE feature
DMA_PAUSE command is used for halting DMA transfer on chosen channel.
It can be useful when we want to safely read residue before terminating
all requests on channel. Otherwise there can be situation when some data
is transferred before channel termination but after reading residue,
which obviously results with data loss. To avoid this situation we can
pause channel, read residue and then terminate all requests.
This scenario is common, for example, in serial port drivers.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-16 09:33:36 +05:30
Robert Baldyga aee4d1fac8 dmaengine: pl330: improve pl330_tx_status() function
This patch adds possibility to read residue of DMA transfer. It's useful
when we want to know how many bytes have been transferred before we
terminate channel. It can take place, for example, on timeout interrupt.

Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-16 09:33:35 +05:30
Laurent Pinchart be6893e195 dmaengine: rcar-dmac: Disable channel 0 when using IOMMU
A still unconfirmed hardware bug prevents the IPMMU microTLB 0 to be
flushed correctly, resulting in memory corruption. DMAC 0 channel 0 is
connected to microTLB 0 on currently supported platforms, so we can't
use it with the IPMMU. As the IOMMU API operates at the device level we
can't disable it selectively, so ignore channel 0 for now if the device
is part of an IOMMU group.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-16 09:33:35 +05:30
Laurent Pinchart 3f46306127 dmaengine: rcar-dmac: Work around descriptor mode IOMMU errata
When descriptor memory is accessed through an IOMMU the DMADAR register
isn't initialized automatically from the first descriptor at beginning
of transfer by the DMAC like it should. Initialize it manually with the
destination address of the first chunk.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-16 09:33:34 +05:30
Laurent Pinchart 6a634808e3 dmaengine: rcar-dmac: Allocate hardware descriptors with DMAC device
When wired to an IOMMU to access data, the DMAC accesses the hardware
descriptors through the IOMMU as well. We're using the DMA mapping API
to allocate the descriptors, but with a NULL device at the moment, which
prevents IOMMU mappings from being created. Fix this by passing the DMAC
device instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-16 09:33:33 +05:30
Laurent Pinchart f7638c904b dmaengine: rcar-dmac: Fix oops due to unintialized list in error ISR
The error interrupt handler stops and reinitializes all channels. This
causes a crash for channels that have never been used, as their
descriptor lists are uninitialized. Fix it by initializing the
descriptor lists at probe time.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-16 09:33:33 +05:30
Laurent Pinchart f39150720e dmaengine: rcar-dmac: Fix spinlock issues in interrupt
The rcar_dmac_desc_put() function is called in interrupt context and
must thus use spin_lock_irqsave() instead of spin_lock_irq().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-16 09:33:32 +05:30
Lad, Prabhakar b7a4fd53d2 dmaenegine: edma: fix sparse warnings
this patch fixes following sparse warnings:

edma.c:537:32: warning: symbol 'edma_prep_dma_memcpy' was not declared. Should it be static?
edma.c:1070:6: warning: symbol 'edma_filter_fn' was not declared. Should it be static?

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-16 09:33:32 +05:30
Laurent Pinchart a55e07c8a5 dmaengine: rcar-dmac: Fix uninitialized variable usage
The desc variable is used uninitialized in the rcar_dmac_desc_get() and
rcar_dmac_xfer_chunk_get() functions if descriptors need to be
allocated. Fix it.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-12 12:52:19 +05:30
Sergei Shtylyov bf44a4175e dmaengine: shdmac: extend PM methods
In order to make it possible to restore from hibernation not only in Linux but
also in e.g. U-Boot, we have to use sh_dmae_{suspend|resume}() for the {freeze|
thaw|restore}() PM methods. It's handy to achieve this with SIMPLE_DEV_PM_OPS()
macro; since  that macro doesn't do anything when CONFIG_PM_SLEEP  is undefined,
we don't need to #define sh_dmae_{suspend|resume} NULL anymore but we'll have to
enclose sh_dmae_{suspend|resume}() into the new #ifdef...

Based on original patch by Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-12 12:52:18 +05:30
Sergei Shtylyov 82bf90c628 dmaengine: shdmac: use SET_RUNTIME_PM_OPS()
Use SET_RUNTIME_PM_OPS() to initialize the runtime PM method pointers in the
'struct dev_pm_ops';  since that macro doesn't  do anything  if CONFIG_PM is
not defined, we have  to move #ifdef up to also cover the runtime PM methods
in order to avoid compilation warnings.

Based on orignal patch by Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-12 12:52:17 +05:30
Addy Ke 0091b9d6c1 dmaengine: pl330: fix bug that cause start the same descs in cyclic
This bug will cause NULL pointer after commit dfac17, and cause
wrong package in I2S DMA transfer before commit dfac17.

Tested on RK3288-pinky2 board.

Detail:
I2S DMA transfer(sound/core/pcm_dmaengine.c):
dmaengine_pcm_prepare_and_submit -->
dmaengine_prep_dma_cyclic -->
pl330_prep_dma_cyclic -->
the case:
1. pl330_submit_req(desc0): thrd->req[0].desc = desc0, thrd->lstenq = 0
2. pl330_submit_req(desc1): thrd->req[1].desc = desc1, thrd->lstenq = 1
3. _start(desc0) by submit_req: thrd->req_running = 0
   because: idx = 1 - thrd->lstenq = 0
4. pl330_update(desc0 OK): thrd->req[0].desc = NULL, desc0 to req_done list
   because: idx = active = thrd->req_running = 0
5. _start(desc1) by pl330_update: thrd->req_running = 1
   because:
   idx = 1 - thrd->lstenq = 0, but thrd->req[0].desc == NULL,
   so:
   idx = thrd->lstenq = 1
6. pl330_submit_req(desc2): thrd->req[0].desc = desc2, thrd->lstenq = 0
7. _start(desc1) by submit_req: thrd->req_running = 1
   because: idx = 1 - thrd->lstenq = 1
   Note: _start started the same descs
         _start should start desc2 here, NOT desc1

8. pl330_update(desc1 OK): thrd->req[1].desc = NULL, desc1 to req_done list
   because: idx = active = thrd->req_running = 1
9. _start(desc2) by pl330_update : thrd->req_running = 0
   because: idx = 1 - thrd->lstenq = 0
10.pl330_update(desc1 OK, NOT desc2): thrd->req[0].desc = NULL,
   desc2 to req_done list
   because: idx = active = thrd->req_running = 0

11.pl330_submit_req(desc3): thrd->req[0].desc = desc3, thrd->lstenq = 0
12.pl330_submit_req(desc4): thrd->req[1].desc = desc4, thrd->lstenq = 1
13._start(desc3) by submit_req: thrd->req_running = 0
   because: idx = 1 - thrd->lstenq = 0
14.pl330_update(desc2 OK NOT desc3): thrd->req[0].desc = NULL
   desc3 to req_done list
   because: idx = active = thrd->req_running = 0
15._start(desc4) by pl330_update: thrd->req_running = 1
   because:
   idx = 1 - thrd->lstenq = 0, but thrd->req[0].desc == NULL,
   so:
   idx = thrd->lstenq = 1
16.pl330_submit_req(desc5): thrd->req[0].desc = desc5, thrd->lstenq = 0
17._start(desc4) by submit_req: thrd->req_running = 1
   because: idx = 1 - thrd->lstenq = 1
18.pl330_update(desc3 OK NOT desc4): thrd->req[1].desc = NULL
   desc4 to req_done list
   because: idx = active = thrd->req_running = 1
19._start(desc4) by pl330_update: thrd->req_running = 0
   because:
   idx = 1 - thrd->lstenq = 1, but thrd->req[1].desc == NULL,
   so:
   idx = thrd->lstenq = 0
20.pl330_update(desc4 OK): thrd->req[0].desc = NULL, desc5 to req_done list
   because: idx = active = thrd->req_running = 0
21.pl330_update(desc4 OK):
   1) before commit dfac17(set req_running -1 in pl330_update/mark_free()):
      because: active = -1, abort
      result: desc0-desc5's callback are all called,
	      but step 10 and step 18 go wrong.
   2) before commit dfac17:
      idx = active = thrd->req_runnig = 0 -->
      descdone = thrd->req[0] = NULL -->
      list_add_tail(&descdone->rqd, &pl330->req_done); -->
      got NULL pointer!!!

Signed-off-by: Addy Ke <addy.ke@rock-chips.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-10 16:20:19 -08:00
Jiang Liu 90e9782061 resources: Move struct resource_list_entry from ACPI into resource core
Currently ACPI, PCI and pnp all implement the same resource list
management with different data structure. We need to transfer from
one data structure into another when passing resources from one
subsystem into another subsystem. So move struct resource_list_entry
from ACPI into resource core and rename it as resource_entry,
then it could be reused by different subystems and avoid the data
structure conversion.

Introduce dedicated header file resource_ext.h instead of embedding
it into ioport.h to avoid header file inclusion order issues.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-02-05 15:09:25 +01:00
Ludovic Desroches 6d3a7d9e3a dmaengine: at_xdmac: allow muliple dwidths when doing slave transfers
When using FIFO, we need to support differents data width in a single
transfer. For example, serial device which usually uses 1-byte data
width will use 4-bytes data width when using the FIFO. If the transfer
size is not aligned on 4-bytes then the end of the transfer will be
performed with 1-byte data-width. For that reason,
at_xdmac_prep_slave_sg() now builds linked list descriptors using view 2
instead of view 1 so each of them can update the DWIDTH field into the
Channel Configuration Register.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-04 23:12:29 -08:00
Ludovic Desroches be83507482 dmaengine: at_xdmac: simplify channel configuration stuff
This patch simplifies the channel configuration register management.
Relying on a "software snapshot" of the configuration is not safe and
too complex.

Multiple dwidths will be introduced for slave transfers. In this case,
it becomes quite difficult to have an accurate snapshot of the channel
configuration register in the way it is done. Using the channel
configuration available in the lli descriptor simplifies this stuff.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-04 23:12:29 -08:00
Ludovic Desroches 734bb9a7b3 dmaengine: at_xdmac: introduce save_cc field
When suspending the device, read the channel configuration directly from
the register instead of relying on a software snapshot, it will be
safer.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-04 23:12:28 -08:00
Cyrille Pitchen cbb85e6726 dmaengine: at_xdmac: wait for in-progress transaction to complete after pausing a channel
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-04 23:12:28 -08:00
Nicholas Mc Guire 12385f458a ioat: fail self-test if wait_for_completion times out
wait_for_completion_timeout reaching timeout was being ignored,
fail the self-test if timeout condition occurs.

v2: fixup of coding style issues.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-04 22:54:22 -08:00
Andy Shevchenko d8ded50f8b dmaengine: dw: define DW_DMA_MAX_NR_MASTERS
Instead of using magic number in the code the patch provides
DW_DMA_MAX_NR_MASTERS constant.

While here, restrict the reading of data width array by amount of the actual
number of AHB masters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-04 22:39:44 -08:00
Andy Shevchenko ede23a5868 dmatest: move src_off, dst_off, len inside loop
The scope of those varsiables is in while-loop. This patch moves them there and
removes duplicate code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-04 18:17:21 -08:00
Andy Shevchenko a835bb8550 dmatest: fix indentation
Simple fixes an indentation in few places across the code.

There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-04 18:15:28 -08:00
Andrew Bresticker 5689ba7fd9 dmaengine: Add driver for IMG MDC
Add support for the IMG Multi-threaded DMA Controller (MDC) found on
certain IMG SoCs.  Currently this driver supports the variant present
on the MIPS-based Pistachio SoC.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-04 18:13:32 -08:00
Dan Carpenter 3028718fd0 dmaengine: s3c24xx: missing unlock on an error path
We should unlock here before returning -EINVAL.

Fixes: 39ad460096 ('dmaengine: s3c24xx: Split device_control')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-04 17:52:42 -08:00
Dave Jiang 68a8cc9e9e ioatdma: Adding support for BDX-DE ioatdma.
Adding PCI device IDs and hooks in workarounds for Broadwell DE ioatdma.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-02-03 17:47:40 -08:00
Vinod Koul 46c2eb6459 Merge branch 'topic/rcar' into for-linus 2015-02-02 16:55:43 -08:00
Vinod Koul 2cd6f7928c Merge branch 'topic/slave_caps_device_control_fix_rebased' into for-linus 2015-02-02 16:55:35 -08:00
Wolfram Sang c914570f28 dmaengine: of: bail out early if "dmas" property is not present
And don't print an error: not configured is not an error.

Reported-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-25 22:44:23 -08:00
Kuninori Morimoto 5cf5aec5b3 dmaengine: shdmac: fixup WARNING of slave caps retrieval
ecc19d1786
(dmaengine: Add a warning for drivers not using the generic slave
caps retrieval) added WARN() for DMA_SLAVE.
Kernel will shows WARNING without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-25 22:37:20 -08:00
Kuninori Morimoto 2b5fbb824f dmaengine: rcar-hpbdma: tidyup residue_granularity
The driver doesn't support residue reporting at all.
residue_granularity should be set to DMA_RESIDUE_GRANULARITY_DESCRIPTOR.
Special thanks to Laurent

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-25 22:37:05 -08:00
Arnd Bergmann d50b9e2e78 ARM: SAMSUNG: remove unused DMA infrastructure
Everything uses dmaengine now, so there is no reason to
keep this around any longer. Thanks to everyone who was involved
in moving the users over to use the dmaengine APIs.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
2015-01-24 13:09:54 +09:00
Arnd Bergmann 4d76bbed2d dmaengine: coh901318: fix function return types build warnings
A recent patch that removed coh901318_control() replaced it
with a number of pointers to existing functions, but those
unfortunately have the wrong return  type and need to be
changed to return an 'int' with an error value rather than
a 'void' to avoid these build warnings:

drivers/dma/coh901318.c:2697:32: warning: assignment from incompatible pointer type
  base->dma_slave.device_config = coh901318_dma_set_runtimeconfig;
                                ^
drivers/dma/coh901318.c:2698:31: warning: assignment from incompatible pointer type
  base->dma_slave.device_pause = coh901318_pause;
                               ^
drivers/dma/coh901318.c:2699:32: warning: assignment from incompatible pointer type
  base->dma_slave.device_resume = coh901318_resume

The coh901318_base_init function has the correct return type
already, but needs to be marked 'static' to avoid a sparse
warning about a missing declaration.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 6782af118b ("dmaengine: coh901318: Split device_control")
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-18 20:01:36 +05:30
Maxime Ripard 848e10bb52 dmaengine: s3c24xx: Fix typo
A typo has been introduced in the spin_unlock_irqrestore function. Fix it.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-18 20:01:15 +05:30
Maxime Ripard a0a51a64f6 dmaengine: sa11x0: Fix warning and compilation errors
The sa11x0_dma_resume conflicts between the dmaengine device_resume callback
and the dev_pm_ops resume implementation.

Also remove some unused variables at the same time.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-18 20:01:15 +05:30
Laurent Pinchart 0d5484b1c3 dmaengine: Move dma_get_slave_caps() implementation to dmaengine.c
The function is too big to be a static inline.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-18 19:55:57 +05:30
Ludovic Desroches 816070ede7 dmaengine: at_hdmac: declare slave capabilities
Declare slave capabilities to suppress "this driver doesn't support generic
slave capabilities reporting" warning.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-14 00:04:02 +05:30
Paul Walmsley 891653ab83 dmaengine: tegra: add slave capabilities reporting
After commit ecc19d1786 ("dmaengine: Add
a warning for drivers not using the generic slave caps retrieval"),
the Tegra APB DMA driver causes this warning during boot:

WARNING: CPU: 0 PID: 1 at drivers/dma/dmaengine.c:830 dma_async_device_register+0x294/0x538()
this driver doesn't support generic slave capabilities reporting

Fix by setting the appropriate reporting structure fields that are
passed to dma_async_device_register().

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Thierry Reding <treding@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-14 00:00:30 +05:30
Kevin Hao 0fdd244fe8 dmaengine: fsldma: remove the unused variable
Fix the following build warning:
  drivers/dma/fsldma.c: In function 'fsl_dma_device_terminate_all':
  drivers/dma/fsldma.c:947:6: warning: unused variable 'size' [-Wunused-variable]

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-13 23:58:08 +05:30
Kevin Hao 75dc1775ec dmaengine: fsldma: declare slave capabilities for the generic code
Since commit ecc19d1786 ("dmaengine: Add a warning for drivers not
using the generic slave caps retrieval"), the dma drivers are required
to fill the caps infos in order to support generic slaves caps
retrieval. Otherwise we will get a warning like this:
  WARNING: at drivers/dma/dmaengine.c:830
  Modules linked in:
  CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W       3.19.0-rc2-next-20150106-dirty #271
  task: c0000001f70a0000 ti: c0000001f7044000 task.ti: c0000001f7044000
  NIP: c00000000032b238 LR: c00000000032b234 CTR: c00000000001d258
  REGS: c0000001f7047330 TRAP: 0700   Tainted: G        W        (3.19.0-rc2-next-20150106-dirty)
  MSR: 0000000080029000 <CE,EE,ME>  CR: 24adbe22  XER: 20000000
  SOFTE: 1
  GPR00: c00000000032b234 c0000001f70475b0 c0000000009b4848 0000000000000040
  GPR04: 0000000000000001 0000000000000001 0000000000000000 000000000000000f
  GPR08: 0000000000000000 c000000000902988 c000000000902988 00000000000052c8
  GPR12: 0000000024adbe22 c00000000fff4000 c000000000002038 0000000000000000
  GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  GPR24: 0000000000000000 0000000000000000 c000000000972dc8 c0000000007e6fd0
  GPR28: c0000001f76d1d30 c0000001f76d1c10 c0000001f76d1c00 0000000000000000
  NIP [c00000000032b238] .dma_async_device_register+0x3f8/0x5b8
  LR [c00000000032b234] .dma_async_device_register+0x3f4/0x5b8
  Call Trace:
  [c0000001f70475b0] [c00000000032b234] .dma_async_device_register+0x3f4/0x5b8 (unreliable)
  [c0000001f70476a0] [c00000000032ca78] .fsldma_of_probe+0x298/0x438
  [c0000001f7047750] [c00000000037080c] .platform_drv_probe+0x50/0x9c
  [c0000001f70477d0] [c00000000036e74c] .really_probe+0xa4/0x29c
  [c0000001f7047870] [c00000000036eae4] .__driver_attach+0x100/0x104
  [c0000001f7047900] [c00000000036c1f0] .bus_for_each_dev+0x84/0xe4
  [c0000001f70479a0] [c00000000036e164] .driver_attach+0x24/0x38
  [c0000001f7047a10] [c00000000036dcc8] .bus_add_driver+0x1c8/0x2ac
  [c0000001f7047ab0] [c00000000036f14c] .driver_register+0x8c/0x158
  [c0000001f7047b30] [c0000000003707a8] .__platform_driver_register+0x6c/0x80
  [c0000001f7047ba0] [c000000000898a3c] .fsldma_init+0x2c/0x40
  [c0000001f7047c10] [c000000000001818] .do_one_initcall+0xb8/0x234
  [c0000001f7047d00] [c000000000878e2c] .kernel_init_freeable+0x188/0x268
  [c0000001f7047db0] [c000000000002054] .kernel_init+0x1c/0xfc8
  [c0000001f7047e30] [c000000000000884] .ret_from_kernel_thread+0x58/0xd4
  Instruction dump:
  7fb9f840 3bffffe0 409effac 7f54d378 48000060 813d0050 2f890000 40befdd0
  3c62ffe3 38632450 482f0aa9 60000000 <0fe00000> 4bfffdb8 7f03c378 482ed465

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-13 23:58:08 +05:30
Kuninori Morimoto 7a96337d05 dmaengine: rcar-hpbdma: fixup WARNING of slave caps retrieval
ecc19d1786
(dmaengine: Add a warning for drivers not using the generic slave
caps retrieval) added WARN() for DMA_SLAVE.
Kernel will shows WARNING without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-01-13 23:53:01 +05:30