linux_dsm_epyc7002/drivers/dma
Torsten Fleischer bdf6c79278 dmaengine: at_hdmac: Fix calculation of the residual bytes
This patch fixes the following issues regarding to the calculation of the
residue:

1. The residue is always calculated for the current transfer even if the
cookie is associated to a pending transfer.

2. For scatter/gather DMA the calculation of the residue for the current
transfer doesn't include the bytes of the child descriptors that are already
transferred.
It only calculates the difference between the transfer's total length minus
the number of bytes that are already transferred for the current child
descriptor.
For example: There is a scatter/gather DMA transfer with a total length of
1 MByte. Getting the residue several times while the transfer is running shows
something like that:

1: residue = 975584
2: residue = 1002766
3: residue = 992627
4: residue = 983767
5: residue = 985694
6: residue = 1008094
7: residue = 1009741
8: residue = 1011195

3. The driver stores the residue but never resets it when starting a new
transfer.
For example: If there are two subsequent DMA transfers. The first one with
a total length of 1 MByte and the second one with a total length of 1 kByte.
Getting the residue for both transfers shows something like that:

transfer 1: residue = 975584
transfer 2: residue = 1048380

Changes from V1:
   * Fixed coding style of the multi-line comments.
   * Improved accuracy of the residue calculation when the transfer for the
     first descriptor is active.

Changes from V2:
   * Member 'tx_width' of 'struct at_desc' restored, because the transfer width
     can't be derived from the source width when using "slave_sg".
     The transfer width is needed for the calculation of the residue if either
     the transfer of the first or the last descriptor is in progress.
     In the case of a "memory_to_memory_sg" transfer (part of this patch
     series) the transfer width of both descriptors may differ. Thus it is
     required to additionally set 'tx_width' of the last descriptor.
   * Added functions for multiply used calculations.

Signed-off-by: Torsten Fleischer <torfl6749@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-03-13 14:58:31 +05:30
..
bestcomm dma: bestcomm: drop owner assignment from platform_drivers 2014-10-20 16:20:28 +02:00
dw dmaengine: dw: don't handle interrupt when dmaengine is not used 2015-03-05 14:07:48 +05:30
ioat dmaengine: ioatdma: workaround for incorrect DMACAP register 2015-03-05 14:32:02 +05:30
ipu dmaengine: ipu-idmac: Split device_control 2014-12-22 12:28:59 +05:30
ppc4xx dma: ppc4xx: drop owner assignment from platform_drivers 2014-10-20 16:20:29 +02:00
sh dmaengine: shdma: Move DMA stop to (runtime) suspend callbacks 2015-03-02 22:10:44 +05:30
xilinx dmaengine: xilinx: Split device_control 2014-12-22 12:33:21 +05:30
acpi-dma.c resources: Move struct resource_list_entry from ACPI into resource core 2015-02-05 15:09:25 +01:00
amba-pl08x.c dmaengine: pl08x: Split device_control 2014-12-22 12:28:56 +05:30
at_hdmac_regs.h dmaengine: at_hdmac: Fix calculation of the residual bytes 2015-03-13 14:58:31 +05:30
at_hdmac.c dmaengine: at_hdmac: Fix calculation of the residual bytes 2015-03-13 14:58:31 +05:30
at_xdmac.c dmaengine: at_xdmac: fix for chan conf simplification 2015-03-05 14:29:57 +05:30
bcm2835-dma.c dmaengine: bcm2835: Declare slave capabilities for the generic code 2014-12-22 12:33:23 +05:30
coh901318_lli.c Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-02-26 09:24:48 -08:00
coh901318.c dmaengine: coh901318: fix function return types build warnings 2015-01-18 20:01:36 +05:30
coh901318.h dma: coh901318: merge header files 2013-01-07 17:36:37 +01:00
cppi41.c dmaengine: cppi41: Split device_control 2014-12-22 12:28:57 +05:30
dma-jz4740.c dmaengine: jz4740: Split device_control 2014-12-22 12:28:58 +05:30
dmaengine.c dmaengine: Move dma_get_slave_caps() implementation to dmaengine.c 2015-01-18 19:55:57 +05:30
dmaengine.h dmaengine: consolidate initialization of cookies 2012-03-13 11:37:22 +05:30
dmatest.c dmatest: move src_off, dst_off, len inside loop 2015-02-04 18:17:21 -08:00
edma.c dmaenegine: edma: fix sparse warnings 2015-02-16 09:33:32 +05:30
ep93xx_dma.c dmaengine: ep93xx: update the driver comments 2014-12-22 20:27:25 +05:30
fsl-edma.c dmaengine: fsl-edma: Declare slave capabilities for the generic code 2014-12-22 12:33:23 +05:30
fsldma.c dmaengine: fsldma: remove the unused variable 2015-01-13 23:58:08 +05:30
fsldma.h dmaengine: fsldma: declare slave capabilities for the generic code 2015-01-13 23:58:08 +05:30
img-mdc-dma.c dmaengine: Add driver for IMG MDC 2015-02-04 18:13:32 -08:00
imx-dma.c Merge branch 'topic/slave_caps_device_control_fix_rebased' into for-linus 2015-02-02 16:55:35 -08:00
imx-sdma.c Merge branch 'topic/slave_caps_device_control_fix_rebased' into for-linus 2015-02-02 16:55:35 -08:00
intel_mid_dma_regs.h dma: fix comments 2012-09-01 08:57:12 -07:00
intel_mid_dma.c dmaengine: intel-mid-dma: Split device_control 2014-12-22 12:28:59 +05:30
iop-adma.c dmaengine: Remove .owner field for driver 2014-11-06 11:54:18 +05:30
k3dma.c dmaengine: k3: fix duplicate function definition 2015-01-13 21:20:09 +05:30
Kconfig Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2015-02-18 08:49:20 -08:00
Makefile dmaengine: Add driver for IMG MDC 2015-02-04 18:13:32 -08:00
mic_x100_dma.c dma: MIC X100 DMA Driver 2014-07-12 09:57:42 -07:00
mic_x100_dma.h dma: MIC X100 DMA Driver 2014-07-12 09:57:42 -07:00
mmp_pdma.c dmaengine: mmp_pdma: fix warning about slave caps 2015-03-05 22:15:35 +05:30
mmp_tdma.c dma: mmp-tdma: refine dma disable and dma-pos update 2015-03-04 18:03:15 +05:30
moxart-dma.c dmaengine: moxart: Split device_control 2014-12-22 12:29:01 +05:30
mpc512x_dma.c dmaengine: mpc512x: Split device_control 2014-12-22 12:29:04 +05:30
mv_xor.c dmaengine: mv_xor: Remove device_control 2014-12-22 12:33:22 +05:30
mv_xor.h dma: mv_xor: Add support for DMA_INTERRUPT 2014-09-23 20:17:01 +05:30
mxs-dma.c dmaengine: mxs-dma: Declare slave capabilities for the generic code 2015-01-13 23:48:40 +05:30
nbpfaxi.c dmaengine: nbpfaxi: update the driver comments 2014-12-22 20:28:04 +05:30
of-dma.c dmaengine: of: bail out early if "dmas" property is not present 2015-01-25 22:44:23 -08:00
omap-dma.c dmaengine: omap: fix the assignment to .device_config 2014-12-22 12:34:22 +05:30
pch_dma.c dmaengine: pch-dma: Rename device_control 2014-12-22 12:33:22 +05:30
pl330.c dmaengine: pl330: add DMA_PAUSE feature 2015-02-16 09:33:36 +05:30
qcom_bam_dma.c dmaengine: qcom_bam_dma: fix wrong register offsets 2015-03-05 22:07:12 +05:30
s3c24xx-dma.c dmaengine: s3c24xx: missing unlock on an error path 2015-02-04 17:52:42 -08:00
sa11x0-dma.c dmaengine: sa11x0: Fix warning and compilation errors 2015-01-18 20:01:15 +05:30
sirf-dma.c dmaengine: sirf: Declare slave capabilities for the generic code 2014-12-22 12:34:21 +05:30
ste_dma40_ll.c dmaengine: ste_dma40_ll: Replace meaningless register set with comment 2013-06-04 11:12:10 +02:00
ste_dma40_ll.h dmaengine: ste_dma40: Remove unnecessary call to d40_phy_cfg() 2013-05-23 21:13:19 +02:00
ste_dma40.c dmaengine: ste_dma: fix incompatible pointer type warns 2014-12-22 12:34:23 +05:30
sun6i-dma.c dmaengine: sun6i: Declare slave capabilities for the generic code 2014-12-22 12:34:21 +05:30
tegra20-apb-dma.c dmaengine: tegra: add slave capabilities reporting 2015-01-14 00:00:30 +05:30
timb_dma.c dmaengine: td: Rename device_control 2014-12-22 12:33:22 +05:30
TODO dmaengine: dw: don't perform DMA when dmaengine_submit is called 2014-07-15 22:14:30 +05:30
txx9dmac.c dmaengine: txx9: Rename device_control 2014-12-22 12:33:22 +05:30
txx9dmac.h MIPS: Replace MIPS-specific 64BIT_PHYS_ADDR with generic PHYS_ADDR_T_64BIT 2014-11-24 22:46:44 +01:00
virt-dma.c dmaengine: virt-dma: add support for cyclic DMA periodic callbacks 2012-07-01 14:15:23 +01:00
virt-dma.h dma: fix vchan_cookie_complete() debug print 2014-01-26 17:33:45 +05:30