Commit e68ee83f authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Greg Kroah-Hartman

gpu: host1x: debug: Fix multiple channels emitting messages simultaneously

[ Upstream commit 35681862 ]

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: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b1b3ee66
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "debug.h" #include "debug.h"
#include "channel.h" #include "channel.h"
static DEFINE_MUTEX(debug_lock);
unsigned int host1x_debug_trace_cmdbuf; unsigned int host1x_debug_trace_cmdbuf;
static pid_t host1x_debug_force_timeout_pid; static pid_t host1x_debug_force_timeout_pid;
...@@ -61,12 +63,14 @@ static int show_channel(struct host1x_channel *ch, void *data, bool show_fifo) ...@@ -61,12 +63,14 @@ static int show_channel(struct host1x_channel *ch, void *data, bool show_fifo)
struct output *o = data; struct output *o = data;
mutex_lock(&ch->cdma.lock); mutex_lock(&ch->cdma.lock);
mutex_lock(&debug_lock);
if (show_fifo) if (show_fifo)
host1x_hw_show_channel_fifo(m, ch, o); host1x_hw_show_channel_fifo(m, ch, o);
host1x_hw_show_channel_cdma(m, ch, o); host1x_hw_show_channel_cdma(m, ch, o);
mutex_unlock(&debug_lock);
mutex_unlock(&ch->cdma.lock); mutex_unlock(&ch->cdma.lock);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment