]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
video: tegra: host: Fix race in timeout
authorArto Merilainen <amerilainen@nvidia.com>
Wed, 14 May 2014 07:18:48 +0000 (10:18 +0300)
committerMandar Padmawar <mpadmawar@nvidia.com>
Tue, 20 May 2014 09:27:28 +0000 (02:27 -0700)
commit1363cf920d41caea027455bfa6c2cba8e434ca1d
tree76a07df07c7378b7b4a6d1662ae1d1562c1e1720
parentdd6c795393b2ee62ef463d8860005490af13c43e
video: tegra: host: Fix race in timeout

Timeout handler locks a single cdma mutex. However, as part
of debug dump we need to take a lock also all other cdma locks.

If we concurrently execute two timeout handlers for two different
channels, mutex locking ordering is not same and therefore we
risk getting deadlock.

This patch adds global timeout handler mutex to ensure that only
a single timeout handler is active at a time. This ensures that
- despite differing ordering - two handlers are not able to
race.

Change-Id: I64b203478c175afa36f396d4dc4b3838130974cb
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/409599
Reviewed-by: Mandar Padmawar <mpadmawar@nvidia.com>
Tested-by: Mandar Padmawar <mpadmawar@nvidia.com>
drivers/video/tegra/host/host1x/host1x.c
drivers/video/tegra/host/host1x/host1x.h
drivers/video/tegra/host/host1x/host1x_cdma.c