Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26082a82 authored by Clarence Ip's avatar Clarence Ip Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: add ability to force panic before recovery



Define a new bit in the debugfs dbg_ctrl node to allow the
driver to trigger a kernel panic instead of executing
hardware recovery on commit errors. This is useful during
test and debugging phases of driver development.

Change-Id: I7af0589e2b19c2336a978b89c8097a3e0c2561f6
Signed-off-by: default avatarClarence Ip <cip@codeaurora.org>
parent 934d3289
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3506,6 +3506,9 @@ static int _sde_crtc_reset_hw(struct drm_crtc *crtc,
	if (dump_status)
		SDE_DBG_DUMP("all", "dbg_bus", "vbif_dbg_bus");

	/* optionally generate a panic instead of performing a h/w reset */
	SDE_DBG_CTRL("stop_ftrace", "reset_hw_panic");

	for (i = 0; i < sde_crtc->num_mixers; ++i) {
		ctl = sde_crtc->mixers[i].hw_ctl;
		if (!ctl || !ctl->ops.reset)
+10 −2
Original line number Diff line number Diff line
@@ -71,7 +71,8 @@

#define DBG_CTRL_STOP_FTRACE	BIT(0)
#define DBG_CTRL_PANIC_UNDERRUN	BIT(1)
#define DBG_CTRL_MAX			BIT(2)
#define DBG_CTRL_RESET_HW_PANIC	BIT(2)
#define DBG_CTRL_MAX			BIT(3)

/**
 * struct sde_dbg_reg_offset - tracking for start and end of region
@@ -2709,7 +2710,6 @@ void sde_dbg_ctrl(const char *name, ...)
	va_list args;
	char *blk_name = NULL;


	/* no debugfs controlled events are enabled, just return */
	if (!sde_dbg_base.debugfs_ctrl)
		return;
@@ -2738,8 +2738,16 @@ void sde_dbg_ctrl(const char *name, ...)
			pr_debug("panic underrun\n");
			panic("underrun");
		}

		if (!strcmp(blk_name, "reset_hw_panic") &&
				sde_dbg_base.debugfs_ctrl &
				DBG_CTRL_RESET_HW_PANIC) {
			pr_debug("reset hw panic\n");
			panic("reset_hw");
		}
	}

	va_end(args);
}