summaryrefslogtreecommitdiff
path: root/drivers/dma
AgeCommit message (Collapse)Author
2016-09-05Merge 4.8-rc5 into tty-nextGreg Kroah-Hartman
We want the fixes in here for merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02dmaengine: hsu: refactor hsu_dma_do_irq() to return intAndy Shevchenko
Since we have nice macro IRQ_RETVAL() we would use it to convert a flag of handled interrupt from int to irqreturn_t. The rationale of doing this is: a) hence we implicitly mark hsu_dma_do_irq() as an auxiliary function that can't be used as interrupt handler directly, and b) to be in align with serial driver which is using serial8250_handle_irq() that returns plain int by design. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31dmaengine: imx-sdma - update the residue calculation for cyclic channelsNandor Han
The calculation of the DMA transaction residue supports only fixed size data transfers. This implementation is not covering all operations (e.g. data receiving) when we need to know the exact amount of bytes transferred. The loop channels handling was changed to clear the buffer descriptor errors and use the bd->mode.count to calculate the residue. Tested-by: Peter Senna Tschudin <peter.senna@collabora.com> Acked-by: Peter Senna Tschudin <peter.senna@collabora.com> Reviewed-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Nandor Han <nandor.han@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31dmaengine: imx-sdma - reduce transfer latency for DMA cyclic clientsNandor Han
Having the SDMA driver use a tasklet for running the clients callback introduce some issues: - probability to have desynchronized data because of the race condition created since the DMA transaction status is retrieved only when the callback is executed, leaving plenty of time for transaction status to get altered. - inter-transfer latency which can leave channels idle. Move the callback execution, for cyclic channels, to SDMA interrupt (as advised in `Documentation/dmaengine/provider.txt`) to (a)reduce the inter-transfer latency and (b) eliminate the race condition possibility where DMA transaction status might be changed by the time is read. The responsibility of the SDMA interrupt latency is moved to the SDMA clients which case by case should defer the work to bottom-halves when needed. Tested-by: Peter Senna Tschudin <peter.senna@collabora.com> Acked-by: Peter Senna Tschudin <peter.senna@collabora.com> Reviewed-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Nandor Han <nandor.han@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31dmaengine: dw: override LLP support if asked in platform dataAndy Shevchenko
There are at least two known devices, e.g. DMA controller found on ARC AXS101 SDP board, that have LLP register and no multi block transfer support at the same time. Override autodetection by user provided data. Reported-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Reviewed-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31dmaengine: dw: set polarity of handshake interfaceAndy Shevchenko
Intel Quark UART uses DesignWare DMA IP. Though the DMA IP is connected in such way that handshake interface uses inverted polarity. We have to provide a possibility to set this in the DMA driver when configuring a channel. Introduce a new member of custom slave configuration called 'hs_polarity' and set active low polarity in case this value is 'true'. Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31dmaengine: dw: keep copy of custom slave config in dwcAndy Shevchenko
It seems we need to extend custom slave configuration by one more member to support Intel Quart UART. It becomes a burden to manage all members of struct dw_dma_slave one-by-one. Replace the set of fields by embedding struct dw_dma_slave into struct dw_dma_chan. Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-22dmaengine: img-mdc: fix a possible NULL dereferenceLABBE Corentin
of_match_device could return NULL, and so cause a NULL pointer dereference later at line 850: mdma->soc = match->data; For fixing this problem, we use of_device_get_match_data(), this will simplify the code a little by using a standard function for getting the match data. This was reported by coverity (CID 1324134) Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-08-22dmaengine: at_xdmac: fix to pass correct device identity to free_irq()Wei Yongjun
free_irq() expects the same device identity that was passed to corresponding request_irq(), otherwise the IRQ is not freed. Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-08-22dmaengine: fsl_raid: add missing of_node_put() in fsl_re_probe()Wei Yongjun
When terminating for_each_compatible_node() iteration with break or return, of_node_put() should be used to prevent stale device node references from being left behind. Found by Coccinelle. Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-08-19dmaengine: pxa_dma: fix debug messageRobert Jarzmik
In a very tight timeframe, the debug message in the transfer completion handler can be misleading, as the completion test report can change just after the message, and the code flow cannot be deduced from the debug message. This is just a cleanup to make debugging easier. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-08-19dmaengine: pxa_dma: fix hotchain corner caseRobert Jarzmik
In the case where a descriptor is chained on a running channel, and as explained in the comment in the code 10 lines above, the success of the chaining is ensured either if : - the DMA is still running - or if the chained transfer is completed Unfortunately the transfer completness test was done on the descriptor to which the transfer was chained, and not the transfer being chained at the end, ie. hot-chained. This corner case is extremely hard to trigger, as usually the DMA chain is still running, and the first case takes care of returning success of the hot-chaining. It was seen by hot-chaining several "small transfers" to a running "big transfer", not in a real-life usecase but by testing the robustness of the driver. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-08-08dmaengine: usb-dmac: check CHCR.DE bit in usb_dmac_isr_channel()Yoshihiro Shimoda
The USB-DMAC's interruption happens even if the CHCR.DE is not set to 1 because CHCR.NULLE is set to 1. So, this driver should call usb_dmac_isr_transfer_end() if the DE bit is set to 1 only. Otherwise, the desc is possible to be NULL in the usb_dmac_isr_transfer_end(). Fixes: 0c1c8ff32fa2 ("dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver) Cc: <stable@vger.kernel.org> # v4.1+ Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-28Merge tag 'dmaengine-4.8-rc1' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds
Pull dmaengine updates from Vinod Koul: "This time we have bit of largish changes: two new drivers, bunch of updates and cleanups to existing set. Nothing super exciting though. New drivers: - Xilinx zynqmp dma engine driver - Marvell xor2 driver Updates: - dmatest sg support - updates and enhancements to Xilinx drivers, adding of cyclic mode - clock handling fixes across drivers - removal of OOM messages on kzalloc across subsystem - interleaved transfers support in omap driver - runtime pm support in qcom bam dma - tasklet kill freeup across drivers - irq cleanup on remove across drivers" * tag 'dmaengine-4.8-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (94 commits) dmaengine: k3dma: add missing clk_disable_unprepare() on error in k3_dma_probe() dmaengine: zynqmp_dma: add missing MODULE_LICENSE dmaengine: qcom_hidma: use for_each_matching_node() macro dmaengine: zynqmp_dma: Fix static checker warning dmaengine: omap-dma: Support for interleaved transfer dmaengine: ioat: statify symbol dmaengine: pxa_dma: implement device_synchronize dmaengine: imx-sdma: remove assignment never used dmaengine: imx-sdma: remove dummy assignment dmaengine: cppi: remove unused and bogus check dmaengine: qcom_hidma_lli: kill the tasklets upon exit dmaengine: pxa_dma: remove owner assignment dmaengine: fsl_raid: remove owner assignment dmaengine: coh901318: remove owner assignment dmaengine: qcom_hidma: kill the tasklets upon exit dmaengine: txx9dmac: explicitly freeup irq dmaengine: sirf-dma: kill the tasklets upon exit dmaengine: s3c24xx: kill the tasklets upon exit dmaengine: s3c24xx: explicitly freeup irq dmaengine: pl330: explicitly freeup irq ...
2016-07-28Merge branch 'topic/dmaengine_cleanups' into for-linusVinod Koul
2016-07-24dmaengine: k3dma: add missing clk_disable_unprepare() on error in k3_dma_probe()Wei Yongjun
Add the missing clk_disable_unprepare() before return from k3_dma_probe() in the error handling case. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-24dmaengine: zynqmp_dma: add missing MODULE_LICENSEArnd Bergmann
We get a warning about the missing MODULE_LICENSE tag for this newly added driver module: WARNING: modpost: missing MODULE_LICENSE() in drivers/dma/xilinx/zynqmp_dma.o see include/linux/module.h for more information This adds a "GPL" license, matching the "version 2 or later" information in the comment at the start of the file. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Kedareswara rao Appana <appanad@xilinx.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-24dmaengine: qcom_hidma: use for_each_matching_node() macroWei Yongjun
Use for_each_matching_node() macro instead of open coding it. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-24dmaengine: zynqmp_dma: Fix static checker warningKedareswara rao Appana
This patch fixes the below static checker warning drivers/dma/xilinx/zynqmp_dma.c:973 zynqmp_dma_chan_probe() warn: was && intended here instead of ||? Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-24dmaengine: omap-dma: Support for interleaved transferPeter Ujfalusi
Initial support for interleaved transfer with sDMA. The implementation only supports DMA_MEM_TO_MEM and frame_size must be 1. sDMA needs to be configured for double indexing when ICG is needed. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-23dmaengine: ioat: statify symbolVinod Koul
Sparse warns: drivers/dma/ioat/init.c:1215:6: warning: symbol 'ioat_resume' was not declared. Should it be static? Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Dave Jiang <dave.jiang@intel.com>
2016-07-23dmaengine: pxa_dma: implement device_synchronizeRobert Jarzmik
Implement the function which wait until a dma channel is stopped to have a synchronization point. This also protects the pxad_remove() from races, such as spurious interrupts while removing the driver, because : - as long as there is one dma channel requested, ie. dma_chan_get() but no dma_chan_put(), the try_module_get() of dma_chan_get() prevents the remove() routine from running - when the last channel is released, ie. the last dma_chan_put() is called, if there is a running DMA, pxad_synchronize() is called - pxad_synchronize() waits for the channel to stop, which in turn ensures on pxa architecture that the interrupt cannot be fired anymore Reported-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-23dmaengine: imx-sdma: remove assignment never usedVinod Koul
David reported: [drivers/dma/imx-sdma.c:769]: (style) Variable 'emi_2_emi' is assigned a value that is never used Since emi_2_emi is never used afterwards, remove thsi as well Reported-by: David Binderman <dcb314@hotmail.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-23dmaengine: imx-sdma: remove dummy assignmentVinod Koul
David reported: drivers/dma/imx-sdma.c:1003]: (style) Same expression on both sides of '|=' ORing with itself yields same result, So remove this Reported-by: David Binderman <dcb314@hotmail.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-23dmaengine: cppi: remove unused and bogus checkVinod Koul
In cppi41_dma_prep_slave_sg() variable num is initialized to zero, but never updated and a BUG_ON is checked for it being greater than zero which will be always false. Remove the bogus check and this variable Reported-by: David Binderman <linuxdev.baldrick@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-23dmaengine: qcom_hidma_lli: kill the tasklets upon exitVinod Koul
drivers should ensure that tasklets are killed, so that they can't be run after driver remove is executed Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Sinan Kaya <okaya@codeaurora.org>
2016-07-23dmaengine: pxa_dma: remove owner assignmentVinod Koul
debugfs file operations owner is set by core, so remove Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
2016-07-23dmaengine: fsl_raid: remove owner assignmentVinod Koul
platform driver operations owner is set by core, so remove Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Xuelin Shi <xuelin.shi@freescale.com>
2016-07-23dmaengine: coh901318: remove owner assignmentVinod Koul
debugfs file operations owner is set by core, so remove Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Linus Walleij <linus.walleij@linaro.org>
2016-07-23dmaengine: qcom_hidma: kill the tasklets upon exitVinod Koul
drivers should ensure that tasklets are killed, so that they can't be run after driver remove is executed Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Sinan Kaya <okaya@codeaurora.org>
2016-07-23dmaengine: txx9dmac: explicitly freeup irqVinod Koul
dmaengine device should explicitly call devm_free_irq() when using devm_request_irq(). The irq is still ON when devices remove is executed and irq should be quiesced before remove is completed. Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-23dmaengine: sirf-dma: kill the tasklets upon exitVinod Koul
drivers should ensure that tasklets are killed, so that they can't be run after driver remove is executed Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Barry Song <Baohua.Song@csr.com>
2016-07-23dmaengine: s3c24xx: kill the tasklets upon exitVinod Koul
drivers should ensure that tasklets are killed, so that they can't be executed after driver remove is executed, so ensure they are killed. This driver used vchan tasklets, so those need to be killed. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2016-07-23dmaengine: s3c24xx: explicitly freeup irqVinod Koul
dmaengine device should explicitly call devm_free_irq() when using devm_request_irq(). The irq is still ON when devices remove is executed and irq should be quiesced before remove is completed. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2016-07-16dmaengine: pl330: explicitly freeup irqVinod Koul
dmaengine device should explicitly call devm_free_irq() when using devm_request_irq(). The irq is still ON when devices remove is executed and irq should be quiesced before remove is completed. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Jassi Brar <jassisinghbrar@gmail.com> Cc: Linus Walleij <linus.walleij@linaro.org>
2016-07-16dmaengine: omap-dma: explicitly freeup irqVinod Koul
dmaengine device should explicitly call devm_free_irq() when using devm_request_irq(). The irq is still ON when devices remove is executed and irq should be quiesced before remove is completed. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
2016-07-16dmaengine: mpc512x: kill the tasklets upon exitVinod Koul
drivers should ensure that tasklets are killed, so that they can't be run after driver remove is executed Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Mario Six <mario.six@gdsys.cc>
2016-07-16dmaengine: nbpfaxi: kill the tasklets upon exitVinod Koul
drivers should ensure that tasklets are killed, so that they can't be run after driver remove is executed Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
2016-07-16dmaengine: nbpfaxi: explicitly freeup irqVinod Koul
dmaengine device should explicitly call devm_free_irq() when using devm_request_irq(). The irq is still ON when devices remove is executed and irq should be quiesced before remove is completed. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
2016-07-16dmaengine: moxart-dma: explicitly freeup irqVinod Koul
dmaengine device should explicitly call devm_free_irq() when using devm_request_irq(). The irq is still ON when devices remove is executed and irq should be quiesced before remove is completed. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Jonas Jensen <jonas.jensen@gmail.com>
2016-07-16dmaengine: mmp_tdma: statify symbolsVinod Koul
Sparse complains: drivers/dma/mmp_tdma.c:407:22: warning: symbol 'mmp_tdma_alloc_descriptor' was not declared. Should it be static? drivers/dma/mmp_tdma.c:595:17: warning: symbol 'mmp_tdma_xlate' was not declared. Should it be static? Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Qiao Zhou <zhouqiao@marvell.com>
2016-07-16dmaengine: mmp_pdma: explicitly freeup irqVinod Koul
dmaengine device should explicitly call devm_free_irq() when using devm_request_irq(). The irq is still ON when devices remove is executed and irq should be quiesced before remove is completed. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
2016-07-16dmaengine: k3dma: explicitly freeup irqVinod Koul
dmaengine device should explicitly call devm_free_irq() when using devm_request_irq(). The irq is still ON when devices remove is executed and irq should be quiesced before remove is completed. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
2016-07-16dmaengine: imx-sdma: explicitly freeup irqVinod Koul
dmaengine device should explicitly call devm_free_irq() when using devm_request_irq(). The irq is still ON when devices remove is executed and irq should be quiesced before remove is completed. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Fabio Estevam <fabio.estevam@freescale.com>
2016-07-16dmaengine: imx-dma: fix coding style issueVinod Koul
imxdma_probe function starting brace is wrongly indented, so fix that Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Linus Walleij <linus.walleij@linaro.org>
2016-07-16dmaengine: imx-dma: explicitly freeup irqVinod Koul
dmaengine device should explicitly call devm_free_irq() when using devm_request_irq(). The irq is still ON when devices remove is executed and irq should be quiesced before remove is completed. Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-16dmaengine: fsl-edma: kill the tasklets upon exitVinod Koul
drivers should ensure that tasklets are killed, so that they can't be executed after driver remove is executed, so ensure they are killed. This driver used vchan tasklets, so those need to be killed. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Jingchang Lu <b35083@freescale.com> Cc: Peter Griffin <peter.griffin@linaro.org>
2016-07-16dmaengine: jz4740: kill the tasklets upon exitVinod Koul
drivers should ensure that tasklets are killed, so that they can't be executed after driver remove is executed, so ensure they are killed. This driver used vchan tasklets, so those need to be killed. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2016-07-16dmaengine: fsl_raid: fix size_t print specifiersVinod Koul
size_t should be printed with %zu, not %lu as driver did, so fix these warning by doing this change drivers/dma/fsl_raid.c: In function 'fsl_re_prep_dma_genq': drivers/dma/fsl_raid.c:341:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' [-Wformat=] len, FSL_RE_MAX_DATA_LEN); ^ drivers/dma/fsl_raid.c: In function 'fsl_re_prep_dma_pq': drivers/dma/fsl_raid.c:428:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' [-Wformat=] len, FSL_RE_MAX_DATA_LEN); ^ drivers/dma/fsl_raid.c: In function 'fsl_re_prep_dma_memcpy': drivers/dma/fsl_raid.c:549:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' [-Wformat=] len, FSL_RE_MAX_DATA_LEN); ^ Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-07-16dmaengine: fsl_raid: kill the tasklets upon exitVinod Koul
drivers should ensure that tasklets are killed, so that they can't be run after driver remove is executed Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Xuelin Shi <xuelin.shi@freescale.com>