04 Mar, 2016
2 commits
-
DMACHCLR clears each channels, but its channel number is based on
its SoC or IP. Current driver is using fixed 0x7fff (= for 15ch),
it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes itSigned-off-by: Kuninori Morimoto
Acked-by: Geert Uytterhoeven
Acked-by: Laurent Pinchart
Signed-off-by: Vinod Koul -
This change will also make Coverity happy by avoiding a theoretical NULL
pointer dereference; yet another reason is to use the above helper function
to tighten the code and make it more readable.Signed-off-by: Wolfram Sang
Acked-by: Geert Uytterhoeven
Signed-off-by: Vinod Koul
08 Feb, 2016
1 commit
-
Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.
This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.Signed-off-by: Simon Horman
Signed-off-by: Vinod Koul
14 Jan, 2016
1 commit
-
Pull dmaengine updates from Vinod Koul:
"This round we have few new features, new driver and updates to few
drivers.The new features to dmaengine core are:
- Synchronized transfer termination API to terminate the dmaengine
transfers in synchronized and async fashion as required by users.
We have its user now in ALSA dmaengine lib, img, at_xdma, axi_dmac
drivers.
- Universal API for channel request and start consolidation of
request flows. It's user is ompa-dma driver.
- Introduce reuse of descriptors and use in pxa_dma driverAdd/Remove:
- New STM32 DMA driver
- Removal of unused R-Car HPB-DMAC driverUpdates:
- ti-dma-crossbar updates for supporting eDMA
- tegra-apb pm updates
- idma64
- mv_xor updates
- ste_dma updates"* tag 'dmaengine-4.5-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (54 commits)
dmaengine: mv_xor: add suspend/resume support
dmaengine: mv_xor: de-duplicate mv_chan_set_mode*()
dmaengine: mv_xor: remove mv_xor_chan->current_type field
dmaengine: omap-dma: Add support for DMA filter mapping to slave devices
dmaengine: edma: Add support for DMA filter mapping to slave devices
dmaengine: core: Introduce new, universal API to request a channel
dmaengine: core: Move and merge the code paths using private_candidate
dmaengine: core: Skip mask matching when it is not provided to private_candidate
dmaengine: mdc: Correct terminate_all handling
dmaengine: edma: Add probe callback to edma_tptc_driver
dmaengine: dw: fix potential memory leak in dw_dma_parse_dt()
dmaengine: stm32-dma: Fix unchecked deference of chan->desc
dmaengine: sh: Remove unused R-Car HPB-DMAC driver
dmaengine: usb-dmac: Document SoC specific compatibility strings
ste_dma40: Delete an unnecessary variable initialisation in d40_probe()
ste_dma40: Delete another unnecessary check in d40_probe()
ste_dma40: Delete an unnecessary check before the function call "kmem_cache_destroy"
dmaengine: tegra-apb: Free interrupts before killing tasklets
dmaengine: tegra-apb: Update driver to use GFP_NOWAIT
dmaengine: tegra-apb: Only save channel state for those in use
...
06 Jan, 2016
1 commit
10 Dec, 2015
1 commit
-
As of commit 4baadb9e05c68962 ("ARM: shmobile: r8a7778: remove obsolete
setup code"), the Renesas R-Car HPB-DMAC driver is no longer used.
In theory it could still be used on R-Car Gen1 SoCs, but that requires
adding DT support to the driver, which is not planned.Remove the driver, it can be resurrected from git history when needed.
Signed-off-by: Geert Uytterhoeven
Acked-by: Simon Horman
Signed-off-by: Vinod Koul
05 Dec, 2015
1 commit
-
This patch fixes an issue that list_for_each_entry() in
usb_dmac_chan_terminate_all() is possible to cause endless loop because
this will move own desc to the desc_freed. So, this driver should use
list_for_each_entry_safe() instead of list_for_each_entry().Signed-off-by: Yoshihiro Shimoda
Signed-off-by: Vinod Koul
16 Nov, 2015
2 commits
-
If the call to pm_runtime_get_sync() failed, Runtime PM was left
enabled.Signed-off-by: Geert Uytterhoeven
Signed-off-by: Vinod Koul -
If CONFIG_PREEMPT=y:
Unable to handle kernel NULL pointer dereference at virtual address 00000014
pgd = c0003000
[00000014] *pgd=80000040004003, *pmd=00000000
Internal error: Oops: 206 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 17 Comm: kworker/0:1 Tainted: G W 4.3.0-rc3-koelsch-022
71-g705498fc5e6a5da8-dirty #1789
Hardware name: Generic R8A7791 (Flattened Device Tree)
Workqueue: pm pm_runtime_work
task: ef578e40 ti: ef57a000 task.ti: ef57a000
PC is at usb_dmac_chan_halt+0xc/0xc0
LR is at usb_dmac_runtime_suspend+0x28/0x38
pc : [] lr : [] psr: 80000113
sp : ef57bdf8 ip : 00000008 fp : 00000003
r10: 00000008 r9 : c06ab928 r8 : ef49e810
r7 : 00000000 r6 : 000000ac r5 : ef770010 r4 : 00000000
r3 : 00000000 r2 : 8ffc2b84 r1 : 00000000 r0 : ef770010
Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 30c5307d Table: 40003000 DAC: fffffffd
Process kworker/0:1 (pid: 17, stack limit = 0xef57a210)
Stack: (0xef57bdf8 to 0xef57c000)[...
[] (usb_dmac_chan_halt) from [] (usb_dmac_runtime_suspend+0x28/0x38)
[] (usb_dmac_runtime_suspend) from [] (pm_genpd_runtime_suspend+0x74/0x23c)This happens because usb_dmac_probe() calls pm_runtime_put() before
usb_dmac_chan_probe(), leading to the device being suspended before the
DMA channels are initialized, causing a NULL pointer dereference.Move the call to pm_runtime_put() to the end of usb_dmac_probe() to fix
this.Add a check to usb_dmac_runtime_suspend() to prevent the crash from
happening in the error path.Reported-by: Sergei Shtylyov
Signed-off-by: Geert Uytterhoeven
Tested-by: Yoshihiro Shimoda
Signed-off-by: Vinod Koul
26 Aug, 2015
2 commits
-
Acked-by: Geert Uytterhoeven
Signed-off-by: Vinod Koul -
Acked-by: Geert Uytterhoeven
Signed-off-by: Vinod Koul
30 Jun, 2015
1 commit
-
Pull dmaengine updates from Vinod Koul:
"This time we have support for few new devices, few new features and
odd fixes spread thru the subsystem.New devices added:
- support for CSRatlas7 dma controller
- Allwinner H3(sun8i) controller
- TI DMA crossbar driver on DRA7x
- new pxa driverNew features added:
- memset support is bought back now that we have a user in xdmac controller
- interleaved transfers support different source and destination strides
- supporting DMA routers and configuration thru DT
- support for reusing descriptors
- xdmac memset and interleaved transfer support
- hdmac support for interleaved transfers
- omap-dma support for memcpyOthers:
- Constify platform_device_id
- mv_xor fixes and improvements"* tag 'dmaengine-4.2-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (46 commits)
dmaengine: xgene: fix file permission
dmaengine: fsl-edma: clear pending interrupts on initialization
dmaengine: xdmac: Add memset support
Documentation: dmaengine: document DMA_CTRL_ACK
dmaengine: virt-dma: don't always free descriptor upon completion
dmaengine: Revert "drivers/dma: remove unused support for MEMSET operations"
dmaengine: hdmac: Implement interleaved transfers
dmaengine: Move icg helpers to global header
dmaengine: mv_xor: improve descriptors list handling and reduce locking
dmaengine: mv_xor: Enlarge descriptor pool size
dmaengine: mv_xor: add support for a38x command in descriptor mode
dmaengine: mv_xor: Rename function for consistent naming
dmaengine: mv_xor: bug fix for racing condition in descriptors cleanup
dmaengine: pl330: fix wording in mcbufsz message
dmaengine: sirf: add CSRatlas7 SoC support
dmaengine: xgene-dma: Fix "incorrect type in assignement" warnings
dmaengine: fix kernel-doc documentation
dmaengine: pxa_dma: add support for legacy transition
dmaengine: pxa_dma: add debug information
dmaengine: pxa: add pxa dmaengine driver
...
06 Jun, 2015
1 commit
-
…opic/pxa', 'asoc/topic/qcom' and 'asoc/topic/rcar' into asoc-next
26 May, 2015
2 commits
-
Use the generic mechanism to declare a bitmap instead of unsigned long.
Signed-off-by: Joe Perches
Signed-off-by: Vinod Koul -
dma_ts_shift[] isn't used outside this source file. All other users use
the definition from arch/arm/mach-shmobile/dma-register.h.Signed-off-by: Geert Uytterhoeven
Reviewed-by: Simon Horman
Signed-off-by: Vinod Koul
22 May, 2015
1 commit
-
Current rcar-dmac driver is using spin_lock_irq() / spin_unlock_irq()
in some functions. But, some other driver might call DMAEngine API
during interrupt disabled. In such case, rcar-dmac side spin_unlock_irq()
forcefully allows all interrupts. Therefore, other driver receives
unexpected interruption, and its exclusive access control will be broken.
This patch replaces spin_lock_irq() to spin_lock_irqsave(),
and spin_unlock_irq() to spin_unlock_irqrestore().Reported-by: Cao Minh Hiep
Signed-off-by: Kuninori Morimoto
Tested-by: Keita Kobayashi
Acked-by: Vinod Koul
Signed-off-by: Mark Brown
27 Apr, 2015
1 commit
-
If CONFIG_PM=n:
drivers/dma/sh/usb-dmac.c:677: warning: ‘usb_dmac_runtime_suspend’ defined but not used
drivers/dma/sh/usb-dmac.c:688: warning: ‘usb_dmac_runtime_resume’ defined but not usedProtect the unused functions by #ifdef CONFIG_PM to fix this.
Signed-off-by: Geert Uytterhoeven
Signed-off-by: Vinod Koul
25 Apr, 2015
1 commit
-
Pull slave-dmaengine updates from Vinod Koul:
- new drivers for:
- Ingenic JZ4780 controller
- APM X-Gene controller
- Freescale RaidEngine device
- Renesas USB Controller- remove device_alloc_chan_resources dummy handlers
- sh driver cleanups for peri peri and related emmc and asoc patches
as well- fixes and enhancements spread over the drivers
* 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (59 commits)
dmaengine: dw: don't prompt for DW_DMAC_CORE
dmaengine: shdmac: avoid unused variable warnings
dmaengine: fix platform_no_drv_owner.cocci warnings
dmaengine: pch_dma: fix memory leak on failure path in pch_dma_probe()
dmaengine: at_xdmac: unlock spin lock before return
dmaengine: xgene: devm_ioremap() returns NULL on error
dmaengine: xgene: buffer overflow in xgene_dma_init_channels()
dmaengine: usb-dmac: Fix dereferencing freed memory 'desc'
dmaengine: sa11x0: report slave capabilities to upper layers
dmaengine: vdma: Fix compilation warnings
dmaengine: fsl_raid: statify fsl_re_chan_probe
dmaengine: Driver support for FSL RaidEngine device.
dmaengine: xgene_dma_init_ring_mngr() can be static
Documentation: dma: Add documentation for the APM X-Gene SoC DMA device DTS binding
arm64: dts: Add APM X-Gene SoC DMA device and DMA clock DTS nodes
dmaengine: Add support for APM X-Gene SoC DMA engine driver
dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver
dmaengine: renesas,usb-dmac: Add device tree bindings documentation
dmaengine: edma: fixed wrongly initialized data parameter to the edma callback
dmaengine: ste_dma40: fix implicit conversion
...
21 Apr, 2015
1 commit
18 Apr, 2015
2 commits
-
This driver uses '#ifdef CONFIG_ARCH_SHMOBILE' and '#ifdef CONFIG_ARM'
interchangeably in its sh_dmae_probe function, which causes a build
warning when building for ARM without also enabling shmobile:dma/sh/shdmac.c: In function sh_dmae_probe:
dma/sh/shdmac.c:696:6: warning: unused variable errirq [-Wunused-variable]
dma/sh/shdmac.c:695:16: warning: unused variable irqflags [-Wunused-variable]
dma/sh/shdmac.c: At top level:
dma/sh/shdmac.c:447:20: warning: sh_dmae_err defined but not used [-Wunused-function]This changes all the #ifdef to test for CONFIG_ARCH_SHMOBILE to
avoid that warning. An earlier patch from Laurent had fixed the warning
for non-ARM case, but it still remained present in ARM randconfig builds.Signed-off-by: Arnd Bergmann
Fixes: 52d6a5ee101bf ("DMA: shdma: Fix warnings due to declared but unused symbols")
Acked-by: Laurent Pinchart
Signed-off-by: Vinod Koul -
This patch fixes an issue that the usb_dmac_desc_free() is
dereferencing freed memory 'desc' because it uses list_for_each_entry().
This function should use list_for_each_entry_safe().Reported-by: Dan Carpenter
Signed-off-by: Yoshihiro Shimoda
Signed-off-by: Vinod Koul
02 Apr, 2015
1 commit
-
This DMAC is Renesas USB high-speed module DMA controller that
supports slave transfer.This USB-DMAC has similar register sets with R-Car Gen2 DMAC, but
the USB-DMAC has specific registers to control the USB transactions.
If this code is added into the rcar-dmac driver, it will become
unreadable. So, this driver is independent from the rcar-dmac.And, this USB-DMAC uses virt-dma infrastructure.
Signed-off-by: Yoshihiro Shimoda
Signed-off-by: Vinod Koul
18 Mar, 2015
1 commit
-
Renesas R-Car sound (= rsnd) needs 2 DMAC which are called as
Audio DMAC (= 1st DMAC) and Audio DMAC peri peri (2nd DMAC).
And rsnd had assumed that 1st / 2nd DMACs are implemented as DMAEngine.
But, in result of DMA ML discussion, 2nd DMAC was concluded that it is
not a general purpose DMAC (2nd DMAC is for Device to Device inside
sound system). Additionally, current DMAEngine can't support Device to
Device, and we don't have correct DT bindings for it at this point.
So the easiest solution for it is that move it from DMAEngine to rsnd
driver.
Audio DMAC peri peri on DMAEngine is no longer needed. remove it.Signed-off-by: Kuninori Morimoto
Acked-by: Geert Uytterhoeven
Acked-by: Arnd Bergmann
03 Mar, 2015
1 commit
-
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/0x64If 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
Reviewed-by: Ulf Hansson
Signed-off-by: Vinod Koul
23 Feb, 2015
1 commit
-
in dma_slave_config, which is incompatible with the way that the
dmaengine API normally works.I've had a closer look at the existing code now and found that all
slave drivers that pass a slave_id in dma_slave_config for SH do that
right after passing the same ID into shdma_chan_filter, so we can just
rely on that. However, the various shdma drivers currently do not
remember the slave ID that was passed into the filter function when
used in non-DT mode and only check the value to find a matching channel,
unlike all other drivers.There might still be drivers that are not part of the kernel that rely
on setting the slave_id to some other value, so to be on the safe side,
this adds another 'real_slave_id' field to shdma_chan that remembers
the ID and uses it when a driver passes a zero slave_id in dma_slave_config,
like most drivers do.Eventually, the real_slave_id and slave_id fields should just get merged
into one field, but that requires other changes.Signed-off-by: Arnd Bergmann
Signed-off-by: Kuninori Morimoto
Signed-off-by: Vinod Koul
16 Feb, 2015
5 commits
-
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
Acked-by: Geert Uytterhoeven
Signed-off-by: Vinod Koul -
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
Acked-by: Geert Uytterhoeven
Signed-off-by: Vinod Koul -
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
Acked-by: Geert Uytterhoeven
Signed-off-by: Vinod Koul -
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
Acked-by: Geert Uytterhoeven
Signed-off-by: Vinod Koul -
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
Acked-by: Geert Uytterhoeven
Signed-off-by: Vinod Koul
12 Feb, 2015
3 commits
-
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
Signed-off-by: Laurent Pinchart
Signed-off-by: Vinod Koul -
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 .
Signed-off-by: Sergei Shtylyov
Signed-off-by: Vinod Koul -
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 .
Signed-off-by: Sergei Shtylyov
Signed-off-by: Vinod Koul
03 Feb, 2015
1 commit
26 Jan, 2015
2 commits
-
ecc19d17868be9c9f8f00ed928791533c420f3e0
(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
Acked-by: Laurent Pinchart
Tested-by: Geert Uytterhoeven
Signed-off-by: Vinod Koul -
The driver doesn't support residue reporting at all.
residue_granularity should be set to DMA_RESIDUE_GRANULARITY_DESCRIPTOR.
Special thanks to LaurentReported-by: Laurent Pinchart
Signed-off-by: Kuninori Morimoto
Signed-off-by: Vinod Koul
14 Jan, 2015
1 commit
-
ecc19d17868be9c9f8f00ed928791533c420f3e0
(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
Signed-off-by: Vinod Koul
23 Dec, 2014
3 commits
-
If the atomic DMA coherent pool is too small, disable use of hardware
descriptor lists instead of crashing the system:ERROR: 256 KiB atomic DMA coherent pool is too small!
Please increase it with coherent_pool= kernel parameter!Unable to handle kernel NULL pointer dereference at virtual address 00000004
Internal error: Oops: a07 [#1] PREEMPT SMP ARMPC is at rcar_dmac_chan_reinit+0x3c/0x160
LR is at _raw_spin_lock_irqsave+0x18/0x5c[] (rcar_dmac_chan_reinit) from [] (rcar_dmac_isr_error+0x84/0xa0)
[] (rcar_dmac_isr_error) from [] (handle_irq_event_percpu+0x50/0x150)
[] (handle_irq_event_percpu) from [] (handle_irq_event+0x3c/0x5c)
[] (handle_irq_event) from [] (handle_fasteoi_irq+0xb8/0x198)
[] (handle_fasteoi_irq) from [] (generic_handle_irq+0x20/0x30)
[] (generic_handle_irq) from [] (handle_IRQ+0x50/0xc4)
[] (handle_IRQ) from [] (gic_handle_irq+0x28/0x5c)
[] (gic_handle_irq) from [] (__irq_svc+0x40/0x70)Kernel panic - not syncing: Fatal exception in interrupt
Signed-off-by: Jürg Billeter
Signed-off-by: Laurent Pinchart -
Unlike DMA transfers descriptors that are preallocated and cached,
memory used to store hardware descriptors is allocated and freed with
the DMA coherent allocation API for every transfer. Besides degrading
performances, this creates a CMA stress test that seems to cause issues.
Running dmatest with the noverify option produces[ 50.066539] alloc_contig_range test_pages_isolated(6b845, 6b846) failed
[ 50.235180] alloc_contig_range test_pages_isolated(6b848, 6b84e) failed
[ 52.964584] alloc_contig_range test_pages_isolated(6b847, 6b848) failed
[ 54.127113] alloc_contig_range test_pages_isolated(6b843, 6b844) failed
[ 56.270253] alloc_contig_range test_pages_isolated(6b84c, 6b850) failedThe root cause needs to be fixed, but in the meantime, as a workaround
and a performance improvement, cache hardware descriptors.Signed-off-by: Laurent Pinchart
Tested-by: Wolfram Sang -
The DMAC supports hardware-based auto-configuration from descriptor
lists. This reduces the number of interrupts required for processing a
DMA transfer. Support that mode in the driver.Signed-off-by: Laurent Pinchart
Tested-by: Wolfram Sang