aboutsummaryrefslogtreecommitdiff
path: root/drivers/dma
AgeCommit message (Collapse)AuthorFilesLines
2013-08-05dma: mmp_pdma: clear DRCMR when free a phy channelXiang Wang1-0/+6
In mmp pdma, phy channels are allocated/freed dynamically. The mapping from DMA request to DMA channel number in DRCMR should be cleared when a phy channel is freed. Otherwise conflicts will happen when: 1. A is using channel 2 and free it after finished, but A still maps to channel 2 in DRCMR of A. 2. Now another one B gets channel 2. So B maps to channel 2 too in DRCMR of B. In the datasheet, it is described that "Do not map two active requests to the same channel since it produces unpredictable results" and we can observe that during test. Signed-off-by: Xiang Wang <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05dma: mmp_pdma: add protect when alloc/free phy channelsXiang Wang1-16/+26
In mmp pdma, phy channels are allocated/freed dynamically and frequently. But no proper protection is added. Conflict will happen when multi-users are requesting phy channels at the same time. Use spinlock to protect. Signed-off-by: Xiang Wang <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05dma: dw: return DMA_PAUSED only if cookie status is DMA_IN_PROGRESSAndy Shevchenko1-1/+1
To obey a usual practice let's return DMA_PAUSED status only if dma_cookie_status returned DMA_IN_PROGRESS. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05dma: dw: return DMA_SUCCESS immediately from device_tx_status()Andy Shevchenko1-4/+4
There is no point to go throught the rest of the function if first call to dma_cookie_status() returned DMA_SUCCESS. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05dma: dw: allow shared interruptsAndy Shevchenko1-5/+8
In the PC world is quite possible that devices are sharing the same interrupt line. The patch prepares dw_dmac driver to such cases. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05dma: dw: improve comparison with ~0Andy Shevchenko1-5/+11
In general ~0 does not fit some integer types. Let's do a helper to make a comparison with that constant properly. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05dma: dw: append MODULE_DEVICE_TABLE for ACPI caseAndy Shevchenko1-0/+1
In rare cases (mostly for the testing purposes) the dw_dmac driver might be compiled as a module as well as the other LPSS device drivers (I2C, SPI, HSUART). When udev handles the event of the devices appearing the dw_dmac module is missing. This patch will fix that. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05acpi-dma: fix sparse warningAndy Shevchenko1-1/+1
This patch fixes sparse warning: drivers/dma/acpi-dma.c:76:21: sparse: cast to restricted __le32 Since everything in all ACPI tables is little-endian, by definition, the used types in practice are uXX. Thus, we have to enforce __leXX if we want to convert them to CPU order. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05txx9dmac: return DMA_SUCCESS immediately from device_tx_status()Andy Shevchenko1-7/+6
There is no point to go throught the rest of the function if first call to dma_cookie_status() returned DMA_SUCCESS. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05mmp_tdma: set cookies as well when asked for tx statusAndy Shevchenko1-1/+2
dma_set_residue() sets only residue value, so user can't rely on the returned values of cookies. That patch standardize the behaviour. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05ipu_idmac: re-use dma_cookie_status()Andy Shevchenko1-4/+1
It's better to use generic dma_cookie_status() that allows user to get standard possible return codes independently of the DMAC driver in charge. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Shawn Guo <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05tegra20-apb-dma: remove useless use of lockAndy Shevchenko1-5/+3
Accordingly to dma_cookie_status() description locking is not required. Signed-off-by: Andy Shevchenko <[email protected]> Cc: Stephen Warren <[email protected]> Cc: [email protected] Signed-off-by: Vinod Koul <[email protected]>
2013-08-05pch_dma: remove useless use of lockAndy Shevchenko1-8/+1
Accordingly to dma_cookie_status() description locking is not required. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05mpc512x_dma: remove useless use of lockAndy Shevchenko1-9/+1
Accordingly to dma_cookie_status() description locking is not required. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05mmp_pdma: remove useless use of lockAndy Shevchenko1-9/+1
Accordingly to dma_cookie_status() description locking is not required. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05fsldma: remove useless use of lockAndy Shevchenko1-9/+1
Accordingly to dma_cookie_status() description locking is not required. Signed-off-by: Andy Shevchenko <[email protected]> Cc: Li Yang <[email protected]> Cc: Zhang Wei <[email protected]> Cc: [email protected] Signed-off-by: Vinod Koul <[email protected]>
2013-08-05ep93xx_dma: remove useless use of lockAndy Shevchenko1-9/+1
Accordingly to dma_cookie_status() description locking is not required. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05edma: no need to assign residue to 0 explicitlyAndy Shevchenko1-2/+0
Residue value is assigned to 0 by dma_cookie_status(). Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05mxs-dma: remove useless variableAndy Shevchenko1-3/+1
last_used variable is applied only once, so, let's substitute it by its value. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-08-05imx-sdma: remove useless variableAndy Shevchenko1-6/+3
last_used variable is applied only once, so, let's substitute it by its value. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-31shdma: fixup sh_dmae_get_partial() calculation errorKuninori Morimoto1-2/+2
sh_desc->hw.tcr is controlling real data size, and, register TCR is controlling data transfer count which was xmit_shifted value of hw.tcr. Current sh_dmae_get_partial() is calculating in different unit. This patch fixes it. This bug has been present since c014906a870ce70e009def0c9d170ccabeb0be63 ("dmaengine: shdma: extend .device_terminate_all() to record partial transfer"), which was added in 2.6.34-rc1. Cc: Vinod Koul <[email protected]> Signed-off-by: Kuninori Morimoto <[email protected]> Acked-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Simon Horman <[email protected]>
2013-07-28dma: pl330: Fix cyclic transfersLars-Peter Clausen1-26/+67
Allocate a descriptor for each period of a cyclic transfer, not just the first. Also since the callback needs to be called for each finished period make sure to initialize the callback and callback_param fields of each descriptor in a cyclic transfer. Cc: [email protected] Signed-off-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-25dma: convert dma_devclass to use dev_groupsGreg Kroah-Hartman1-10/+16
The dev_attrs field of struct class is going away soon, dev_groups should be used instead. This converts the dma dma_devclass code to use the correct field. Cc: Dan Williams <[email protected]> Acked-by: Vinod Koul <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-22pch_dma: fix error return code in pch_dma_probe()Wei Yongjun1-0/+1
Fix to return -ENODEV when no proper base address found error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-15dma: pl330: Implement device_slave_capsLars-Peter Clausen1-0/+27
Implement the device_slave_caps() callback for the pl330 driver. This allows dmaengine users like the generic ALSA dmaengine PCM driver to query the capabilities of the driver. The PL330 supports all buswidths and both mem-to-dev as well as dev-to-mem transfers. In theory there is no limit on the number of segments that can be transferred (in practice you'll run out of memory eventually) and the number of bytes per segment is limited by the size of the PL330 program buffer. Due to the nature of the PL330 the maximum number of bytes per segment depends on the burstsize, the driver sets it to the value for a 1-byte burstsize, since it is the smallest. Signed-off-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-09drivers/dma/iop-adma.c: fix new warningsOlof Johansson1-2/+2
The recent "drivers/dma: remove unused support for MEMSET operations" change has fallout from lack of build testing by the author. This fixes: drivers/dma/iop-adma.c:1020:13: warning: unused variable 'dma_addr' [-Wunused-variable] drivers/dma/iop-adma.c:1519:2: warning: format '%s' expects a matching 'char *' argument [-Wformat=] Signed-off-by: Olof Johansson <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: Sebastian Hesselbarth <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-07Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds28-433/+1633
Pull slave-dmaengine updates from Vinod Koul: "Once you have some time from extended weekend celebrations please consider pulling the following to get: - Various fixes and PCI driver for dw_dmac by Andy - DT binding for imx-dma by Markus & imx-sdma by Shawn - DT fixes for dmaengine by Lars - jz4740 dmac driver by Lars - and various fixes across the drivers" What "extended weekend celebrations"? I'm in the merge window, who has time for extended celebrations.. * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (40 commits) DMA: shdma: add DT support DMA: shdma: shdma_chan_filter() has to be in shdma-base.h DMA: shdma: (cosmetic) don't re-calculate a pointer dmaengine: at_hdmac: prepare clk before calling enable dmaengine/trivial: at_hdmac: add curly brackets to if/else expressions dmaengine: at_hdmac: remove unsuded atc_cleanup_descriptors() dmaengine: at_hdmac: add FIFO configuration parameter to DMA DT binding ARM: at91: dt: add header to define at_hdmac configuration MIPS: jz4740: Correct clock gate bit for DMA controller MIPS: jz4740: Remove custom DMA API MIPS: jz4740: Register jz4740 DMA device dma: Add a jz4740 dmaengine driver MIPS: jz4740: Acquire and enable DMA controller clock dma: mmp_tdma: disable irq when disabling dma channel dmaengine: PL08x: Avoid collisions with get_signal() macro dmaengine: dw: select DW_DMAC_BIG_ENDIAN_IO automagically dma: dw: add PCI part of the driver dma: dw: split driver to library part and platform code dma: move dw_dmac driver to an own directory dw_dmac: don't check resource with devm_ioremap_resource ...
2013-07-05DMA: shdma: add DT supportGuennadi Liakhovetski4-13/+128
This patch adds Device Tree support to the shdma driver. No special DT properties are used, only standard DMA DT bindings are implemented. Since shdma controllers reside on SoCs, their configuration is SoC-specific and shall be passed to the driver from the SoC platform data, using the auxdata procedure. Signed-off-by: Guennadi Liakhovetski <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05DMA: shdma: (cosmetic) don't re-calculate a pointerGuennadi Liakhovetski1-1/+1
Use an existing pointer instead of retrieving it again. Signed-off-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dmaengine: at_hdmac: prepare clk before calling enableBoris BREZILLON1-6/+9
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings. Signed-off-by: Boris BREZILLON <[email protected]> [[email protected]: remove return code checking in at_dma_resume_noirq()] Signed-off-by: Nicolas Ferre <[email protected]>
2013-07-05dmaengine/trivial: at_hdmac: add curly brackets to if/else expressionsNicolas Ferre1-2/+4
Correct coding style following the patch: 7c407d3e54dcc0c79119553c8d5ef176c1d5bc3a (DMA: AT91: Get residual bytes in dma buffer). Signed-off-by: Nicolas Ferre <[email protected]>
2013-07-05dmaengine: at_hdmac: remove unsuded atc_cleanup_descriptors()Nicolas Ferre1-31/+0
Since patch 7c407d3e54dcc0c79119553c8d5ef176c1d5bc3a (DMA: AT91: Get residual bytes in dma buffer), the function atc_cleanup_descriptors() is not used anymore. We remove it to prevent warnings. Reported-by: Arnd Bergmann <[email protected]> Signed-off-by: Nicolas Ferre <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2013-07-05dmaengine: at_hdmac: add FIFO configuration parameter to DMA DT bindingLudovic Desroches1-4/+21
For most devices the FIFO configuration is the same i.e. when half FIFO size is available/filled, a source/destination request is serviced. But USART devices have to do it when there is enough space/data available to perform a single AHB access so the ASAP configuration. Acked-by: Nicolas Ferre <[email protected]> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Signed-off-by: Ludovic Desroches <[email protected]> Signed-off-by: Nicolas Ferre <[email protected]>
2013-07-05MIPS: jz4740: Remove custom DMA APILars-Peter Clausen1-37/+221
Now that all users of the custom jz4740 DMA API have been converted to use the dmaengine API instead we can remove the custom API and move all the code talking to the hardware to the dmaengine driver. Signed-off-by: Lars-Peter Clausen <[email protected]> Acked-by: Ralf Baechle <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dma: Add a jz4740 dmaengine driverLars-Peter Clausen3-0/+440
This patch adds dmaengine support for the JZ4740 DMA controller. For now the driver will be a wrapper around the custom JZ4740 DMA API. Once all users of the custom JZ4740 DMA API have been converted to the dmaengine API the custom API will be removed and direct hardware access will be added to the dmaengine driver. Signed-off-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dma: mmp_tdma: disable irq when disabling dma channelQiao Zhou1-0/+4
mask dma irq when disabling dma channel, so that interrupt status will not be set and interrupt won't come again. Signed-off-by: Qiao Zhou <[email protected]> Acked-by: Zhangfei Gao <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dmaengine: PL08x: Avoid collisions with get_signal() macroMark Brown1-4/+4
As pointed out by Arnd Bergmann there is a get_signal macro definied in linux/signal.h which can conflict with the platform data callback function of the same name leading to confusing errors from the compiler (especially if signal.h manages to get pulled into the driver itself due to header dependencies). Avoid such errors by renaming get_signal and put_signal in the platform data to get_xfer_signal and put_xfer_signal. Signed-off-by: Mark Brown <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dmaengine: dw: select DW_DMAC_BIG_ENDIAN_IO automagicallyVinod Koul2-9/+8
Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dma: dw: add PCI part of the driverAndy Shevchenko3-0/+113
This is the PCI part of the DesignWare DMAC driver. The controller is usually used in the Intel hardware such as Intel Medfield. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dma: dw: split driver to library part and platform codeAndy Shevchenko7-279/+436
To simplify the driver development let's split driver to library and platform code parts. It helps us to add PCI driver in future. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Viresh Kumar <[email protected]> [Fixed compile error and few checkpatch issues] Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dma: move dw_dmac driver to an own directoryAndy Shevchenko6-21/+27
The dw_dmac driver is going to be split into multiple files. To make this more convenient move it to an own directory. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Viresh Kumar <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dw_dmac: don't check resource with devm_ioremap_resourceAndy Shevchenko1-4/+1
devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Viresh Kumar <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dma: pl330: use dma_addr_t for describing bus addressesWill Deacon1-1/+1
The microcode bus address (pl330_dmac.mcode_bus) is currently a u32, which fails to compile when building on a system with 64-bit bus addresses. This patch uses dma_addr_t to represent the address instead. Cc: Jassi Brar <[email protected]> Cc: Vinod Koul <[email protected]> Signed-off-by: Will Deacon <[email protected]> Acked-by: Jassi Brar <[email protected]> Acked-by: Grant Likely <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dma: pl330: rip out broken, redundant ID probingWill Deacon1-24/+3
The PL330 driver probes the peripheral and primecell IDs of the device to make sure that it is indeed an AMBA PL330. However, it does this by making byte accesses to a device mapping of the word-aligned ID registers, which is either UNPREDICTABLE or generates an alignment fault (depending on the presence of the virtualisation extensions). Rather than fix this code, we can actually rip most of it out and let the AMBA bus driver correctly do the probing for us. Cc: Jassi Brar <[email protected]> Cc: Vinod Koul <[email protected]> Signed-off-by: Will Deacon <[email protected]> Acked-by: Jassi Brar <[email protected]> Acked-by: Grant Likely <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dma: imx-sdma: move to generic device tree bindingsShawn Guo1-0/+40
Update imx-sdma driver to adopt generic DMA device tree bindings. It calls of_dma_controller_register() with imx-sdma specific of_dma_xlate to get the generic DMA device tree helper support. The #dma-cells for imx-sdma must be 3, which includes request ID, peripheral type and priority. The existing way of requesting channel, clients directly call dma_request_channel(), still work there, and will be removed after all imx-sdma clients get converted to generic DMA device tree helper. Signed-off-by: Shawn Guo <[email protected]> Signed-off-by: Vinod Koul <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2013-07-05dmaengine: sirf: set dma residue based on the current dma transfer positionRongjun Ying1-0/+17
read SIRFSOC_DMA_CH_ADDR register to get current dma transfer position, then update dma residue so that things like ALSA drivers work as ALSA drivers need the right residue value. Signed-off-by: Rongjun Ying <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dma: tegra: avoid channel lock up after freeDmitry Osipenko1-0/+1
Lock scenario: Channel 1 was allocated and prepared as slave_sg, used and freed. Now preparation of cyclic dma on channel 1 will fail with err "DMA configuration conflict" because tdc->isr_handler still setted to handle_once_dma_done. This happens because tegra_dma_abort_all() won't be called on channel freeing if pending list is empty and channel not busy. We need to clear isr_handler on channel freeing to avoid locking. Signed-off-by: Dmitry Osipenko <[email protected]> Acked-by: Stephen Warren <[email protected]> Acked-by: Laxman Dewangan <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dma: tegra20-apbdma: err message correctionDmitry Osipenko1-1/+1
Fixed err msg params order on irq request fail. Signed-off-by: Dmitry Osipenko <[email protected]> Acked-by: Stephen Warren <[email protected]> Acked-by: Laxman Dewangan <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dw_dmac: remove inline marking of EXPORT_SYMBOL functionsDenis Efremov1-2/+2
EXPORT_SYMBOL and inline directives are contradictory to each other. The patch fixes this inconsistency. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Denis Efremov <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
2013-07-05dma: timb_dma: remove unnecessary platform_set_drvdata()Jingoo Han1-2/+0
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Vinod Koul <[email protected]>