1
0
Fork 0
alistair23-linux/drivers/dma
Serge Semin 18ec92b1ce dmaengine: dw: Activate FIFO-mode for memory peripherals only
[ Upstream commit 6d9459d040 ]

CFGx.FIFO_MODE field controls a DMA-controller "FIFO readiness" criterion.
In other words it determines when to start pushing data out of a DW
DMAC channel FIFO to a destination peripheral or from a source
peripheral to the DW DMAC channel FIFO. Currently FIFO-mode is set to one
for all DW DMAC channels. It means they are tuned to flush data out of
FIFO (to a memory peripheral or by accepting the burst transaction
requests) when FIFO is at least half-full (except at the end of the block
transfer, when FIFO-flush mode is activated) and are configured to get
data to the FIFO when it's at least half-empty.

Such configuration is a good choice when there is no slave device involved
in the DMA transfers. In that case the number of bursts per block is less
than when CFGx.FIFO_MODE = 0 and, hence, the bus utilization will improve.
But the latency of DMA transfers may increase when CFGx.FIFO_MODE = 1,
since DW DMAC will wait for the channel FIFO contents to be either
half-full or half-empty depending on having the destination or the source
transfers. Such latencies might be dangerous in case if the DMA transfers
are expected to be performed from/to a slave device. Since normally
peripheral devices keep data in internal FIFOs, any latency at some
critical moment may cause one being overflown and consequently losing
data. This especially concerns a case when either a peripheral device is
relatively fast or the DW DMAC engine is relatively slow with respect to
the incoming data pace.

In order to solve problems, which might be caused by the latencies
described above, let's enable the FIFO half-full/half-empty "FIFO
readiness" criterion only for DMA transfers with no slave device involved.
Thanks to the commit 99ba8b9b0d ("dmaengine: dw: Initialize channel
before each transfer") we can freely do that in the generic
dw_dma_initialize_chan() method.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200731200826.9292-3-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-29 09:58:09 +01:00
..
bestcomm treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
dw dmaengine: dw: Activate FIFO-mode for memory peripherals only 2020-10-29 09:58:09 +01:00
dw-axi-dmac dmaengine fixes for v5.2-rc4 2019-06-08 12:46:31 -07:00
dw-edma dmaengine: dw-edma: Fix scatter-gather address calculation 2020-09-09 19:12:35 +02:00
hsu dmaengine updates for v5.3-rc1 2019-07-17 09:55:43 -07:00
ioat dmaengine: ioat setting ioat timeout as module parameter 2020-07-29 10:18:37 +02:00
ipu treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mediatek dmaengine: mediatek: hsdma_probe: fixed a memory leak when devm_request_irq fails 2020-10-01 13:17:18 +02:00
ppc4xx treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 7 2019-05-21 11:28:40 +02:00
qcom dmaengine: qcom: bam_dma: Fix resource leak 2019-10-18 13:27:58 +05:30
sh dmaengine: sh: usb-dmac: set tx_result parameters 2020-07-22 09:33:00 +02:00
ti dmaengine: ti: edma: fix missed failure handling 2020-01-26 10:01:08 +01:00
xilinx dmaengine: zynqmp_dma: fix burst length configuration 2020-10-01 13:17:28 +02:00
Kconfig Main MIPS changes for v5.4: 2019-09-22 09:30:30 -07:00
Makefile dma: Drop JZ4740 driver 2019-07-30 10:41:53 -07:00
TODO
acpi-dma.c dmaengine: acpi: Put the CSRT table after using it 2020-09-17 13:47:45 +02:00
altera-msgdma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
amba-pl08x.c dmaengine updates for v5.3-rc1 2019-07-17 09:55:43 -07:00
at_hdmac.c dmaengine: at_hdmac: check return value of of_find_device_by_node() in at_dma_xlate() 2020-09-09 19:12:23 +02:00
at_hdmac_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
at_xdmac.c dmaengine updates for v5.3-rc1 2019-07-17 09:55:43 -07:00
bcm-sba-raid.c dmaengine: bcm-sba-raid: no need to check return value of debugfs_create functions 2019-06-14 11:14:58 +05:30
bcm2835-dma.c dmaengine updates for v5.4-rc1 2019-09-17 19:04:40 -07:00
coh901318.c dmaengine: coh901318: Fix a double lock bug in dma_tc_handle() 2020-03-12 13:00:30 +01:00
coh901318.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
coh901318_lli.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
dma-axi-dmac.c dmaengine: axi-dmac: add a check for devm_regmap_init_mmio 2020-02-14 16:34:19 -05:00
dma-jz4780.c drivers/dma/dma-jz4780: Fix race condition between probe and irq handler 2020-09-17 13:47:46 +02:00
dmaengine.c dmaengine: Store module owner in dma_device struct 2020-02-24 08:36:40 +01:00
dmaengine.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dmatest.c dmaengine: dmatest: Check list for emptiness before access its last entry 2020-10-29 09:57:41 +01:00
ep93xx_dma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fsl-edma-common.c dmaengine: fsl-edma: fix wrong tcd endianness for big-endian cpu 2020-07-29 10:18:37 +02:00
fsl-edma-common.h dmaengine: fsl-edma-common: correct DSIZE_32BYTE 2020-07-22 09:33:15 +02:00
fsl-edma.c dmaengine: fsl-edma: Fix NULL pointer exception in fsl_edma_tx_handler 2020-07-22 09:33:15 +02:00
fsl-qdma.c dmaengine: fsl-qdma: fix duplicated argument to && 2020-02-24 08:36:29 +01:00
fsl_raid.c dmaengine: fsl_raid: make of_device_ids const. 2017-06-29 09:25:28 +05:30
fsl_raid.h
fsldma.c dmaengine: fsldma: Mark expected switch fall-through 2019-08-20 19:42:34 -05:00
fsldma.h fsldma: fix very broken 32-bit ppc ioread64 functionality 2020-09-09 19:12:22 +02:00
idma64.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
idma64.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
img-mdc-dma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
imx-dma.c dmaengine: imx-dma: Mark expected switch fall-through 2019-07-31 20:49:04 +05:30
imx-sdma.c dmaengine: imx-sdma: Fix the event id check to include RX event for UART6 2020-03-12 13:00:23 +01:00
iop-adma.c dmaengine updates for v5.4-rc1 2019-09-17 19:04:40 -07:00
iop-adma.h dma: iop-adma: allow building without platform headers 2019-08-14 15:36:22 +02:00
k3dma.c dmaengine: k3dma: Avoid null pointer traversal 2020-01-17 19:49:06 +01:00
lpc18xx-dmamux.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mcf-edma.c dmaengine: mcf-edma: Fix NULL pointer exception in mcf_edma_tx_handler 2020-07-22 09:33:15 +02:00
mic_x100_dma.c dmaengine updates for v5.3-rc1 2019-07-17 09:55:43 -07:00
mic_x100_dma.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 290 2019-06-05 17:36:38 +02:00
mmp_pdma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mmp_tdma.c dmaengine: mmp_tdma: Reset channel error on release 2020-05-20 08:20:14 +02:00
moxart-dma.c treewide: Use struct_size() for kmalloc()-family 2018-06-06 11:15:43 -07:00
mpc512x_dma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 7 2019-05-21 11:28:40 +02:00
mv_xor.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
mv_xor.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
mv_xor_v2.c dmaengine: mv_xor_v2: Fix -Wshift-negative-value 2019-08-20 17:06:36 +05:30
mxs-dma.c dmaengine updates for v5.3-rc1 2019-07-17 09:55:43 -07:00
nbpfaxi.c dmaengine: nbpfaxi: Use dev_get_drvdata() 2019-04-29 10:47:15 +05:30
of-dma.c dmaengine: of-dma: Fix of_dma_router_xlate's of_dma_xlate handling 2020-09-09 19:12:23 +02:00
owl-dma.c dmaengine: owl: Use correct lock in owl_dma_get_pchan() 2020-05-27 17:46:43 +02:00
pch_dma.c dmaengine: pch_dma.c: Avoid data race between probe and irq handler 2020-05-20 08:20:13 +02:00
pl330.c dmaengine: pl330: Fix burst length if burst size is smaller than bus width 2020-09-09 19:12:25 +02:00
pxa_dma.c dmaengine updates for v5.3-rc1 2019-07-17 09:55:43 -07:00
s3c24xx-dma.c dmaengine: Remove dev_err() usage after platform_get_irq() 2019-07-31 20:50:53 +05:30
sa11x0-dma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sirf-dma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 4 2019-05-21 11:28:40 +02:00
sprd-dma.c dmaengine: sprd: Fix the possible memory leak issue 2019-10-15 15:47:24 +05:30
st_fdma.c dmaengine: Remove dev_err() usage after platform_get_irq() 2019-07-31 20:50:53 +05:30
st_fdma.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ste_dma40.c dmaengine: ste_dma40: fix unneeded variable warning 2019-07-22 20:58:33 +05:30
ste_dma40_ll.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
ste_dma40_ll.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
stm32-dma.c dmaengine: stm32-dma: use vchan_terminate_vdesc() in .terminate_all 2020-10-01 13:17:36 +02:00
stm32-dmamux.c dmaengine: stm32-dmamux: Switch to use device_property_count_u32() 2019-07-29 12:25:21 +05:30
stm32-mdma.c dmaengine: stm32-mdma: use vchan_terminate_vdesc() in .terminate_all 2020-10-01 13:17:35 +02:00
sun4i-dma.c dmaengine: Remove dev_err() usage after platform_get_irq() 2019-07-31 20:50:53 +05:30
sun6i-dma.c dmaengine: Remove dev_err() usage after platform_get_irq() 2019-07-31 20:50:53 +05:30
tegra20-apb-dma.c dmaengine: tegra-apb: Prevent race conditions on channel's freeing 2020-10-01 13:17:36 +02:00
tegra210-adma.c dmaengine: tegra210-adma: Fix runtime PM imbalance on error 2020-07-29 10:18:36 +02:00
timb_dma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
txx9dmac.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
txx9dmac.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
uniphier-mdmac.c dmaengine: Remove dev_err() usage after platform_get_irq() 2019-07-31 20:50:53 +05:30
virt-dma.c dmaengine: virt-dma: Fix access after free in vchan_complete() 2020-01-09 10:20:00 +01:00
virt-dma.h dmaengine updates for v5.3-rc1 2019-07-17 09:55:43 -07:00
xgene-dma.c dmaengine: Remove dev_err() usage after platform_get_irq() 2019-07-31 20:50:53 +05:30
zx_dma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00