Skip to content

Commit 3568186

Browse files
digetxthierryreding
authored andcommitted
gpu: host1x: debug: Fix multiple channels emitting messages simultaneously
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 <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent fd323e9 commit 3568186

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/host1x/debug.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include "debug.h"
1717
#include "channel.h"
1818

19+
static DEFINE_MUTEX(debug_lock);
20+
1921
unsigned int host1x_debug_trace_cmdbuf;
2022

2123
static pid_t host1x_debug_force_timeout_pid;
@@ -52,12 +54,14 @@ static int show_channel(struct host1x_channel *ch, void *data, bool show_fifo)
5254
struct output *o = data;
5355

5456
mutex_lock(&ch->cdma.lock);
57+
mutex_lock(&debug_lock);
5558

5659
if (show_fifo)
5760
host1x_hw_show_channel_fifo(m, ch, o);
5861

5962
host1x_hw_show_channel_cdma(m, ch, o);
6063

64+
mutex_unlock(&debug_lock);
6165
mutex_unlock(&ch->cdma.lock);
6266

6367
return 0;

0 commit comments

Comments
 (0)