alistair23-linux/drivers/dma
Jon Hunter 23a1ec304a dmaengine: tegra-apb: Simplify locking for device using global pause
Sparse reports the following with regard to locking in the
tegra_dma_global_pause() and tegra_dma_global_resume() functions:

drivers/dma/tegra20-apb-dma.c:362:9: warning: context imbalance in
	'tegra_dma_global_pause' - wrong count at exit
drivers/dma/tegra20-apb-dma.c:366:13: warning: context imbalance in
	'tegra_dma_global_resume' - unexpected unlock

The warning is caused because tegra_dma_global_pause() acquires a lock
but does not release it. However, the lock is released by
tegra_dma_global_resume(). These pause/resume functions are called in
pairs and so it does appear to work.

This global pause is used on early tegra devices that do not have an
individual pause for each channel. The lock appears to be used to ensure
that multiple channels do not attempt to assert/de-assert the global pause
at the same time which could cause the DMA controller to be in the wrong
paused state. Rather than locking around the entire code between the pause
and resume, employ a simple counter to keep track of the global pause
requests. By using a counter, it is only necessary to hold the lock when
pausing and unpausing the DMA controller and hence, fixes the sparse
warning.

Please note that for devices that support individual channel pausing, the
DMA controller lock is not held between pausing and unpausing the channel.
Hence, this change will make the devices that use the global pause behave
in the same way, with regard to locking, as those that don't.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-08-20 12:10:25 +05:30
..
bestcomm dmaengine: constify of_device_id array 2015-03-18 22:13:14 +05:30
dw Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2015-04-24 09:49:37 -07:00
hsu dmaengine: hsu: remove excessive lock 2015-07-16 18:30:46 +05:30
ioat dmaengine: ioatdma: Clean up IOAT_COMPLETION_PENDING flag 2015-08-17 13:37:31 +05:30
ipu dmaengine: kill off set_irq_flags usage 2015-08-19 21:31:58 +05:30
ppc4xx dmaengine: Remove FSF mailing addresses 2015-03-16 22:28:15 +05:30
sh dmaengine updates for 4.2-rc1 2015-06-29 09:44:45 -07:00
xilinx dmaengine: xilinx-dma: move header file to common location 2015-03-17 16:23: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: support dt channel assignment 2015-08-18 22:12:14 +05:30
at_hdmac.c dmaengine: Use Pointer xt after NULL check. 2015-07-07 09:52:11 +05:30
at_hdmac_regs.h dmaengine: hdmac: Implement interleaved transfers 2015-06-12 18:13:36 +05:30
at_xdmac.c dmaengine: at_xdmac: fix bug in prep_dma_cyclic 2015-08-19 21:21:28 +05:30
bcm2835-dma.c dmaengine: bcm2835-dma: Fix memory leak when stopping a running transfer 2015-03-30 23:17:08 +05:30
coh901318.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
coh901318.h dma: coh901318: merge header files 2013-01-07 17:36:37 +01:00
coh901318_lli.c Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-02-26 09:24:48 -08:00
cppi41.c dmaengine: cppi41: add missing bitfields 2015-04-11 21:12:58 +05:30
dma-jz4740.c Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2015-04-24 09:49:37 -07:00
dma-jz4780.c dmaengine: jz4780: Kill tasklets before unregistering the device 2015-08-18 22:28:50 +05:30
dmaengine.c dmaengine updates for 4.2-rc1 2015-06-29 09:44:45 -07:00
dmaengine.h dmaengine: consolidate initialization of cookies 2012-03-13 11:37:22 +05:30
dmatest.c kernel/params: constify struct kernel_param_ops uses 2015-05-28 11:32:10 +09:30
edma.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
ep93xx_dma.c dmaengine: ep93xx: Constify platform_device_id 2015-05-04 16:38:55 +05:30
fsl-edma.c dmaengine: fsl-edma: clear pending interrupts on initialization 2015-06-25 09:22:32 +05:30
fsl_raid.c dmaengine: fsl_raid: statify fsl_re_chan_probe 2015-04-02 16:11:35 +05:30
fsl_raid.h dmaengine: Driver support for FSL RaidEngine device. 2015-04-02 16:10:27 +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: img-mdc: remove device_alloc_chan_resources handler 2015-03-18 22:44:58 +05:30
imx-dma.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
imx-sdma.c dmaengine: imx-sdma: Check for clk_enable() errors 2015-08-20 10:52:12 +05:30
iop-adma.c dmaengine: Remove FSF mailing addresses 2015-03-16 22:28:15 +05:30
k3dma.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
Kconfig dmaengine: sun4i: Add support for the DMA engine on sun[457]i SoCs 2015-08-20 10:45:19 +05:30
lpc18xx-dmamux.c dmaengine: add driver for lpc18xx dmamux 2015-08-18 22:12:14 +05:30
Makefile dmaengine: sun4i: Add support for the DMA engine on sun[457]i SoCs 2015-08-20 10:45:19 +05:30
mic_x100_dma.c x86/mm: Decouple <linux/vmalloc.h> from <asm/io.h> 2015-06-03 12:02:00 +02:00
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: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
mmp_tdma.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
moxart-dma.c dmaengine: moxart-dma: Fix memory leak when stopping a running transfer 2015-03-30 23:17:08 +05:30
mpc512x_dma.c dmaengine: constify of_device_id array 2015-03-18 22:13:14 +05:30
mv_xor.c dmaengine: mv_xor: optimize performance by using a subset of the XOR channels 2015-08-19 22:32:14 +05:30
mv_xor.h dmaengine: mv_xor: improve descriptors list handling and reduce locking 2015-06-10 22:18:31 +05:30
mxs-dma.c dmaengine: mxs: Constify platform_device_id 2015-05-04 16:38:55 +05:30
nbpfaxi.c dmaengine: nbpfaxi: Constify platform_device_id 2015-05-04 16:38:55 +05:30
of-dma.c dmaengine: of_dma: Support for DMA routers 2015-05-09 17:11:25 +05:30
omap-dma.c Merge branch 'topic/omap' into for-linus 2015-06-25 09:21:43 +05:30
pch_dma.c dmaengine: Remove remaining FSF mailing addresses 2015-07-06 19:18:53 +05:30
pl330.c dmaengine: pl330: do not emit loop for 1 byte transfer. 2015-08-19 22:11:46 +05:30
pxa_dma.c dmaengine: pxa_dma: fix debug information 2015-08-18 22:10:09 +05:30
qcom_bam_dma.c Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2015-04-24 09:49:37 -07:00
s3c24xx-dma.c dmaengine: s3c24xx: Constify platform_device_id 2015-05-04 16:38:55 +05:30
sa11x0-dma.c dmaengine: sa11x0: report slave capabilities to upper layers 2015-04-17 23:24:35 +05:30
sirf-dma.c dmaengine: sirf: clear pending DMA interrupt when DMA terminates 2015-08-18 22:13:59 +05:30
ste_dma40.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +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
sun4i-dma.c dmaengine: sun4i: Add support for the DMA engine on sun[457]i SoCs 2015-08-20 10:45:19 +05:30
sun6i-dma.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
tegra20-apb-dma.c dmaengine: tegra-apb: Simplify locking for device using global pause 2015-08-20 12:10:25 +05:30
ti-dma-crossbar.c dmaengine: Add driver for TI DMA crossbar on DRA7x 2015-05-14 20:49:25 +05:30
timb_dma.c dmaengine: Remove remaining FSF mailing addresses 2015-07-06 19:18:53 +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: don't always free descriptor upon completion 2015-06-17 22:15:59 +05:30
virt-dma.h dmaengine: virt-dma: don't always free descriptor upon completion 2015-06-17 22:15:59 +05:30
xgene-dma.c dmaengine: xgene-dma: Add ACPI support for X-Gene DMA engine driver 2015-08-20 11:57:11 +05:30