remarkable-linux/drivers/dma
Alexander Sverdlin 98f9de366f dmaengine: ep93xx: Don't drain the transfers in terminate_all()
Draining the transfers in terminate_all callback happens with IRQs disabled,
therefore induces huge latency:

 irqsoff latency trace v1.1.5 on 4.11.0
 --------------------------------------------------------------------
 latency: 39770 us, #57/57, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0)
    -----------------
    | task: process-129 (uid:0 nice:0 policy:2 rt_prio:50)
    -----------------
  => started at: _snd_pcm_stream_lock_irqsave
  => ended at:   snd_pcm_stream_unlock_irqrestore

                  _------=> CPU#
                 / _-----=> irqs-off
                | / _----=> need-resched
                || / _---=> hardirq/softirq
                ||| / _--=> preempt-depth
                |||| /     delay
  cmd     pid   ||||| time  |   caller
     \   /      |||||  \    |   /
process-129     0d.s.    3us : _snd_pcm_stream_lock_irqsave
process-129     0d.s1    9us : snd_pcm_stream_lock <-_snd_pcm_stream_lock_irqsave
process-129     0d.s1   15us : preempt_count_add <-snd_pcm_stream_lock
process-129     0d.s2   22us : preempt_count_add <-snd_pcm_stream_lock
process-129     0d.s3   32us : snd_pcm_update_hw_ptr0 <-snd_pcm_period_elapsed
process-129     0d.s3   41us : soc_pcm_pointer <-snd_pcm_update_hw_ptr0
process-129     0d.s3   50us : dmaengine_pcm_pointer <-soc_pcm_pointer
process-129     0d.s3   58us+: snd_dmaengine_pcm_pointer_no_residue <-dmaengine_pcm_pointer
process-129     0d.s3   96us : update_audio_tstamp <-snd_pcm_update_hw_ptr0
process-129     0d.s3  103us : snd_pcm_update_state <-snd_pcm_update_hw_ptr0
process-129     0d.s3  112us : xrun <-snd_pcm_update_state
process-129     0d.s3  119us : snd_pcm_stop <-xrun
process-129     0d.s3  126us : snd_pcm_action <-snd_pcm_stop
process-129     0d.s3  134us : snd_pcm_action_single <-snd_pcm_action
process-129     0d.s3  141us : snd_pcm_pre_stop <-snd_pcm_action_single
process-129     0d.s3  150us : snd_pcm_do_stop <-snd_pcm_action_single
process-129     0d.s3  157us : soc_pcm_trigger <-snd_pcm_do_stop
process-129     0d.s3  166us : snd_dmaengine_pcm_trigger <-soc_pcm_trigger
process-129     0d.s3  175us : ep93xx_dma_terminate_all <-snd_dmaengine_pcm_trigger
process-129     0d.s3  182us : preempt_count_add <-ep93xx_dma_terminate_all
process-129     0d.s4  189us*: m2p_hw_shutdown <-ep93xx_dma_terminate_all
process-129     0d.s4 39472us : m2p_hw_setup <-ep93xx_dma_terminate_all

 ... rest skipped...

process-129     0d.s. 40080us : <stack trace>
 => ep93xx_dma_tasklet
 => tasklet_action
 => __do_softirq
 => irq_exit
 => __handle_domain_irq
 => vic_handle_irq
 => __irq_usr
 => 0xb66c6668

Just abort the transfers and warn if the HW state is not what we expect.
Move draining into device_synchronize callback.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2017-05-24 09:52:46 +05:30
..
bestcomm dmaengine: NO_IRQ removal from powerpc-only drivers 2016-09-14 18:57:38 +05:30
dw dmaengine updates for 4.11-rc1 2017-02-21 17:06:22 -08:00
hsu serial: 8250_mid: handle interrupt correctly in DMA case 2017-01-19 14:20:23 +01:00
ioat dmaengine: ioat: use setup_timer 2017-04-24 09:38:41 +05:30
ipu dmaengine: ipu: Make sure the interrupt routine checks all interrupts. 2017-01-02 10:48:44 +05:30
ppc4xx Merge branch 'topic/unmap_cleanup' into for-linus 2016-10-03 09:36:11 +05:30
qcom dmaengine: qcom_hidma: pause the channel on shutdown 2017-03-27 10:43:38 +05:30
sh dmaengine: usb-dmac: Fix DMAOR AE bit definition 2017-05-16 09:58:51 +05:30
xilinx dmaengine: xilinx: avoid memory corruption for device_prep_dma_memcpy() 2017-03-14 16:14:29 +05:30
acpi-dma.c dmaengine: acpi-dma: align debug message with flow 2016-02-22 09:06:09 +05:30
amba-pl08x.c dmaengine: pl08x: remove lock documentation 2017-05-04 16:06:30 +05:30
at_hdmac.c dmaengine: at_hdmac: move to dma_pool_zalloc 2016-12-08 21:24:17 +05:30
at_hdmac_regs.h dmaengine: at_hdmac: use %pad format string for dma_addr_t 2015-11-16 09:21:05 +05:30
at_xdmac.c dmaengine: at_xdmac: don't restore unsaved status 2016-12-06 10:45:48 +05:30
bcm2835-dma.c dmaengine: bcm2835: Fix cyclic DMA period splitting 2017-03-06 08:49:11 +05:30
coh901318.c Merge branch 'topic/err_reporting' into for-linus 2016-10-03 09:17:33 +05:30
coh901318.h
coh901318_lli.c dmaengine: coh901318: use NULL for pointer initialization 2016-09-26 22:28:24 +05:30
cppi41.c dmaengine: cppi41: Fix an Oops happening in cppi41_dma_probe() 2017-04-06 12:41:59 +05:30
dma-axi-dmac.c dmaengine: axi-dmac: Return IRQ_NONE if no IRQs are pending 2016-07-01 22:56:41 +05:30
dma-jz4740.c dmaengine: jz4740: remove unused arch header 2016-09-26 22:25:57 +05:30
dma-jz4780.c Merge branch 'topic/compile_test' into for-linus 2016-10-03 09:16:03 +05:30
dmaengine.c dmaengine: Fix array index out of bounds warning in __get_unmap_pool() 2017-03-14 10:11:27 +05:30
dmaengine.h dmaengine: add support to provide error result from a DMA transation 2016-08-08 08:11:42 +05:30
dmatest.c dmaengine: dmatest: Add check for supported buffer count (sg_buffers) 2017-05-01 15:51:06 +05:30
edma.c dmaengine updates for 4.10-rc1 2016-12-14 20:42:45 -08:00
ep93xx_dma.c dmaengine: ep93xx: Don't drain the transfers in terminate_all() 2017-05-24 09:52:46 +05:30
fsl-edma.c dmaengine: fsl-edma: kill the tasklets upon exit 2016-07-16 20:19:00 +05:30
fsl_raid.c dmaengine: fsl_raid: Fix module autoload 2016-11-14 08:35:13 +05:30
fsl_raid.h dmaengine: Driver support for FSL RaidEngine device. 2015-04-02 16:10:27 +05:30
fsldma.c Merge branch 'topic/unmap_cleanup' into for-linus 2016-10-03 09:36:11 +05:30
fsldma.h dmaengine: fsldma: declare slave capabilities for the generic code 2015-01-13 23:58:08 +05:30
idma64.c dmaengine: idma64: clear LLP_[SD]_EN bits in last descriptor 2016-02-15 22:06:45 +05:30
idma64.h asm-generic changes for 4.6 2016-03-24 23:13:48 -07:00
img-mdc-dma.c dmaengine: img-mdc: remove unused ‘prev_phys’ 2016-12-12 22:25:22 +05:30
imx-dma.c dmaengine: imx-dma: convert callback to helper function 2016-08-08 08:11:39 +05:30
imx-sdma.c dmaengine: imx-sdma: add 1ms delay to ensure SDMA channel is stopped 2017-03-27 10:50:59 +05:30
iop-adma.c dmaengine: iop-adma: convert callback to helper function 2016-08-08 08:11:39 +05:30
k3dma.c dmaengine: k3dma: move to dma_pool_zalloc 2016-12-08 21:24:21 +05:30
Kconfig Merge branch 'topic/cppi' into for-linus 2017-05-04 16:03:05 +05:30
lpc18xx-dmamux.c dmaengine: add driver for lpc18xx dmamux 2015-08-18 22:12:14 +05:30
Makefile dmaengine: zx: rename zx296702_dma.c to zx_dma.c 2017-01-02 10:53:48 +05:30
mic_x100_dma.c dmaengine: mic_x100_dma: remove unused ‘data’ 2016-12-12 22:25:22 +05:30
mic_x100_dma.h dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
mmp_pdma.c dmaengine: mmp_pdma: convert callback to helper function 2016-08-08 08:11:39 +05:30
mmp_tdma.c Merge branch 'topic/err_reporting' into for-linus 2016-10-03 09:17:33 +05:30
moxart-dma.c dmaengine: moxart: remove NO_IRQ 2016-09-05 16:40:52 +05:30
mpc512x_dma.c Merge branch 'topic/err_reporting' into for-linus 2016-10-03 09:17:33 +05:30
mv_xor.c dmaengine: mv_xor: use offset_in_page() macro 2017-04-24 18:40:03 +05:30
mv_xor.h dmaengine: mv_xor: Add support for scatter-gather DMA mode 2016-11-25 11:16:36 +05:30
mv_xor_v2.c dmaengine: mv_xor_v2: set DMA mask to 40 bits 2017-05-14 18:24:44 +05:30
mxs-dma.c Merge branch 'topic/no_irq' into for-linus 2016-10-03 09:18:29 +05:30
nbpfaxi.c dmaengine: nbpfaxi: add optional max-burst property for memory reads/writes 2016-11-14 10:07:58 +05:30
of-dma.c dmaengine: of_dma: approximate an average distribution 2016-05-14 13:34:10 +05:30
omap-dma.c dmaengine: omap-dma: Fix the port_window support 2017-01-10 11:08:01 +05:30
pch_dma.c dmaengine: pch_dma: remove unused ‘cookie’ 2016-12-12 22:25:22 +05:30
pl330.c dmaengine: pl330: remove pdata based initialization 2017-03-28 21:37:48 +05:30
pxa_dma.c Revert "dmaengine: pxa_dma: add support for legacy transition" 2016-10-18 20:14:32 +05:30
s3c24xx-dma.c dmaengine: s3c24xx: remove unused ‘cdata’ 2016-12-12 22:25:22 +05:30
sa11x0-dma.c dmaengine: sa11x0: use correct print specifiers for size_t 2016-09-26 22:29:26 +05:30
sirf-dma.c dmaengine: sirf-dma: remove unused ‘sdesc’ 2016-12-12 22:25:22 +05:30
st_fdma.c dmaengine: st_fdma: Fix the error return code in st_fdma_probe() 2016-10-19 22:29:33 +05:30
st_fdma.h dmaengine: st_fdma: Add STMicroelectronics FDMA driver header file 2016-10-18 20:12:06 +05:30
ste_dma40.c dmaengine: ste_dma40: indicate granularity on channels 2017-01-14 20:33:42 +05:30
ste_dma40_ll.c dmaengine: ste_dma40_ll: make d40_width_to_bits static 2016-06-08 08:59:55 +05:30
ste_dma40_ll.h
stm32-dma.c dmaengine: stm32-dma: fix up error dev_err message 2017-03-06 10:41:24 +05:30
sun4i-dma.c dmaengine: sun4i: fix invalid argument 2017-04-24 09:50:05 +05:30
sun6i-dma.c dmaengine: sun6i: fix the uninitialized value for v_lli 2016-11-25 11:49:38 +05:30
tegra20-apb-dma.c dmaengine: tegra20-apb-dma: convert callback to helper function 2016-08-08 08:11:41 +05:30
tegra210-adma.c dmaengine: tegra210-adma: Update driver to use of_pm_clk_add_clk 2016-08-22 11:55:05 +05:30
ti-dma-crossbar.c dmaengine: ti-dma-crossbar: Add some 'of_node_put()' in error path. 2017-01-02 10:37:26 +05:30
timb_dma.c dmaengine: timb_dma: convert callback to helper function 2016-08-08 08:11:41 +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: txx9dmac: convert callback to helper function 2016-08-08 08:11:41 +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: Convert to use list_for_each_entry_safe() 2017-04-26 09:03:27 +05:30
virt-dma.h dmaengine: virt-dma: move function declarations 2016-10-01 11:41:39 +05:30
xgene-dma.c dmaengine: xgene-dma: move unmap to before callback 2016-08-08 08:11:43 +05:30
zx_dma.c dmaengine: zx: fix build warning 2017-01-25 15:33:45 +05:30