alistair23-linux/drivers
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
..
accessibility
acpi Additional ACPICA material for v4.2-rc1 2015-07-02 17:11:28 -07:00
amba
android
ata ARM: SoC cleanups for v4.2 2015-06-26 11:08:27 -07:00
atm
auxdisplay
base Merge branch 'akpm' (patches from Andrew) 2015-07-01 17:47:51 -07:00
bcma
block Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
bluetooth Bluetooth: ath3k: Add support of 04ca:300d AR3012 device 2015-06-18 21:00:06 +03:00
bus ARM: SoC: driver updates for v4.2 2015-06-26 11:54:29 -07:00
cdrom
char Merge tag 'drm-intel-next-fixes-2015-07-02' of git://anongit.freedesktop.org/drm-intel 2015-07-02 14:36:40 -07:00
clk Replace module_platform_driver with builtin_platform driver in non modules. 2015-07-02 10:42:13 -07:00
clocksource Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-07-01 15:44:18 -07:00
connector
cpufreq Replace module_platform_driver with builtin_platform driver in non modules. 2015-07-02 10:42:13 -07:00
cpuidle Replace module_platform_driver with builtin_platform driver in non modules. 2015-07-02 10:42:13 -07:00
crypto crypto: marvell/cesa - another fix up for of_get_named_gen_pool() rename 2015-07-03 11:37:02 -07:00
dca
devfreq
dio
dma dmaengine: tegra-apb: Simplify locking for device using global pause 2015-08-20 12:10:25 +05:30
dma-buf
edac A build fix for octeon_edac from Aaro Koskinen. 2015-07-03 12:10:12 -07:00
eisa
extcon extcon: Redefine the unique id of supported external connectors without 'enum extcon' type 2015-06-12 17:01:42 -07:00
firewire
firmware Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2015-07-03 15:20:57 -07:00
fmc
gpio Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-07-01 15:19:35 -07:00
gpu dmaengine: ipu: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc 2015-07-16 18:41:18 +05:30
hid Merge branches 'for-4.2/i2c-hid', 'for-4.2/lenovo', 'for-4.2/plantronics', 'for-4.2/rmi', 'for-4.2/sensor-hub', 'for-4.2/sjoy', 'for-4.2/sony' and 'for-4.2/wacom' into for-linus 2015-06-22 16:23:43 +02:00
hsi Fix up implicit <module.h> users that will break later. 2015-07-02 10:25:22 -07:00
hv Drivers: hv: vmbus: Allocate ring buffer memory in NUMA aware fashion 2015-06-12 16:58:33 -07:00
hwmon hwmon: (w83627ehf) Use swap() in w82627ehf_swap_tempreg() 2015-07-03 14:39:06 +02:00
hwspinlock hwspinlock: qcom: Correct msb in regmap_field 2015-07-01 16:15:05 +03:00
hwtracing/coresight
i2c Char/Misc driver patches for 4.2-rc1 2015-06-26 14:51:15 -07:00
ide Minor merge needed, due to function move. 2015-07-01 10:49:25 -07:00
idle
iio
infiniband Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2015-07-04 08:14:22 -07:00
iommu IOMMU Fixes for Linux v4.2-rc0 2015-07-01 14:44:22 -07:00
ipack
irqchip Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-07-04 09:22:51 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
leds Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2015-07-01 19:09:11 -07:00
lguest Merge branch 'x86-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-06-22 17:59:09 -07:00
macintosh macintosh/nvram: Remove as unused 2015-06-15 16:42:37 +10:00
mailbox Replace module_init with appropriate alternate initcall in non modules. 2015-07-02 10:36:29 -07:00
mcb
md Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
media Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2015-07-01 19:09:11 -07:00
memory ARM: SoC: driver updates for v4.2 2015-06-26 11:54:29 -07:00
memstick memstick: remove deprecated use of pci api 2015-06-30 19:44:57 -07:00
message fusion: remove dead MTRR code 2015-06-13 08:44:14 -07:00
mfd Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-07-01 15:19:35 -07:00
misc Minor merge needed, due to function move. 2015-07-01 10:49:25 -07:00
mmc ARM: SoC: late fixes and dependencies 2015-07-02 14:40:49 -07:00
mtd Minor merge needed, due to function move. 2015-07-01 10:49:25 -07:00
net A very significant modification to NTB in this series. 2015-07-04 14:07:47 -07:00
nfc Char/Misc driver patches for 4.2-rc1 2015-06-26 14:51:15 -07:00
ntb NTB: Add split BAR output for debugfs stats 2015-07-04 14:09:32 -04:00
nubus
nvdimm arch, x86: pmem api for ensuring durability of persistent memory updates 2015-06-26 11:23:38 -04:00
of Devicetree changes for v4.2 2015-07-01 19:40:18 -07:00
oprofile
parisc
parport parport: check exclusive access before register 2015-06-12 16:58:33 -07:00
pci Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-07-01 15:19:35 -07:00
pcmcia Fix up implicit <module.h> users that will break later. 2015-07-02 10:25:22 -07:00
phy Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-06-27 12:44:34 -07:00
pinctrl Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-07-01 15:19:35 -07:00
platform platform-drivers-x86 for 4.2-2 2015-07-05 10:54:09 -07:00
pnp Merge branches 'pnp' and 'pm-tools' 2015-06-19 01:18:43 +02:00
power Replace module_platform_driver with builtin_platform driver in non modules. 2015-07-02 10:42:13 -07:00
powercap
pps
ps3
ptp
pwm pwm: Changes for v4.2-rc1 2015-06-23 13:32:38 -07:00
rapidio Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2015-06-23 14:08:54 -07:00
ras
regulator Fix up implicit <module.h> users that will break later. 2015-07-02 10:25:22 -07:00
remoteproc remoteproc: fix !CONFIG_OF build breakage 2015-06-18 11:44:41 +03:00
reset
rpmsg
rtc Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-06-27 12:44:34 -07:00
s390 KVM: s390: virtio-ccw: don't overwrite config space values 2015-07-03 18:55:18 +02:00
sbus
scsi Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-07-04 14:13:43 -07:00
sfi
sh Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-07-01 15:19:35 -07:00
sn
soc ARM: SoC: late fixes and dependencies 2015-07-02 14:40:49 -07:00
spi Merge remote-tracking branches 'spi/topic/sirf', 'spi/topic/spidev' and 'spi/topic/zynq' into spi-next 2015-06-18 00:19:56 +01:00
spmi
ssb
staging Staging driver patches for 4.2-rc1 2015-06-26 15:46:08 -07:00
target Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-07-04 14:13:43 -07:00
tc
thermal Minor merge needed, due to function move. 2015-07-01 10:49:25 -07:00
thunderbolt
tty ARM: SoC: late fixes and dependencies 2015-07-02 14:40:49 -07:00
uio uio: pruss: Drop depends on ARCH_DAVINCI_DA850 from config 2015-06-12 17:01:43 -07:00
usb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
uwb
vfio VFIO updates for v4.2 2015-06-28 12:32:13 -07:00
vhost Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-07-04 14:13:43 -07:00
video fbdev fixes for 4.2 2015-07-03 12:11:17 -07:00
virt
virtio virtio/vhost: cross endian support 2015-07-03 16:02:25 -07:00
vlynq
vme vme: tsi148: depend on HAS_DMA for Kconfig 2015-06-12 17:31:05 -07:00
w1 w1: use correct lock on error in w1_seq_show() 2015-06-12 16:58:33 -07:00
watchdog Merge git://www.linux-watchdog.org/linux-watchdog 2015-07-01 19:33:16 -07:00
xen Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-07-04 14:13:43 -07:00
zorro
Kconfig libnvdimm, nfit: initial libnvdimm infrastructure and NFIT support 2015-06-24 21:24:10 -04:00
Makefile The libnvdimm sub-system introduces, in addition to the libnvdimm-core, 2015-06-29 10:34:42 -07:00