gpu: host1x: debug: Fix multiple channels emitting messages simultaneously
authorDmitry Osipenko <digetx@gmail.com>
Mon, 29 Jun 2020 03:18:41 +0000 (06:18 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:40 +0000 (08:23 +0200)
commit7cf4e6f2b365dfd5629a53bbf8efc6ccee2fe25e
tree8e6e608c50fa1435b3c0e2ca72fdb859eb2faaa9
parent3fbcad2f1bf0b2e886bfa7af26a2642272f8c9c5
gpu: host1x: debug: Fix multiple channels emitting messages simultaneously

[ Upstream commit 35681862808472a0a4b9a8817ae2789c0b5b3edc ]

Once channel's job is hung, it dumps the channel's state into KMSG before
tearing down the offending job. If multiple channels hang at once, then
they dump messages simultaneously, making the debug info unreadable, and
thus, useless. This patch adds mutex which allows only one channel to emit
debug messages at a time.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/host1x/debug.c