video: tegra: host: Fix debug dump
authorArto Merilainen <amerilainen@nvidia.com>
Wed, 28 May 2014 06:00:43 +0000 (09:00 +0300)
committerWinnie Hsu <whsu@nvidia.com>
Fri, 17 Oct 2014 17:56:29 +0000 (10:56 -0700)
commit6876f819d21ef127f98999e3f21d83ecd402956b
tree5c9ecce93d2db6aa14a337e1120b6f08a12dc72f
parent83296fee29da1a2e6973157aa9f9d913071657bc
video: tegra: host: Fix debug dump

Currently the debug dump routine is vulnerable against tricky races.
As normal operation is more important than getting the full dump
always, this patch reworks mutex usage in debug dump routine:

 - lock the channel list is now before going through channels. This
   ensures that channel states remain valid even if some of the
   channels were finished during dump.
 - this patch modifies mutex_lock() calls to mutex_trylock() calls.
   This ensures that the function call cannot block.

Bug 1517429

Change-Id: Idf170de196bcededbaec6c9031d268cf2d8bc35d
(cherry picked from commit 544cbc483b973ca1c78173edcf2072434c02b5dd)
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/498508
Reviewed-on: http://git-master/r/538724
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
Tested-by: Shreshtha Sahu <ssahu@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
drivers/video/tegra/host/debug.c