disp: msm: add devcoredump support for sde_dbg
Add devcoredump support for sde_dbg. Devcoredump is a mechanism providing generalized way to get data from kernel modules. This change integrates devcoredump into sde_dbg to get evtlog, register dump and dbg_bus when display failure happens. Change-Id: I4daf25443ccd2646de580314a0bfe08b84dbc282 Signed-off-by: Bruce Hoo <quic_bingchua@quicinc.com>
此提交包含在:

提交者
Gerrit - the friendly Code Review server

父節點
f5e8249fa7
當前提交
fae85fda94
@@ -1,5 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
@@ -10,6 +11,7 @@
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/list.h>
|
||||
#include <soc/qcom/minidump.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
/* select an uncommon hex value for the limiter */
|
||||
#define SDE_EVTLOG_DATA_LIMITER (0xC0DEBEEF)
|
||||
@@ -65,6 +67,7 @@ enum sde_dbg_dump_flag {
|
||||
SDE_DBG_DUMP_IN_LOG = BIT(0),
|
||||
SDE_DBG_DUMP_IN_MEM = BIT(1),
|
||||
SDE_DBG_DUMP_IN_LOG_LIMITED = BIT(2),
|
||||
SDE_DBG_DUMP_IN_COREDUMP = BIT(3),
|
||||
};
|
||||
|
||||
enum sde_dbg_dump_context {
|
||||
@@ -73,8 +76,13 @@ enum sde_dbg_dump_context {
|
||||
SDE_DBG_DUMP_CLK_ENABLED_CTX,
|
||||
};
|
||||
|
||||
/* default dump mode for eventlogs, reg-dump & debugbus-dump */
|
||||
#define SDE_DBG_DEFAULT_DUMP_MODE SDE_DBG_DUMP_IN_MEM
|
||||
/*
|
||||
* Set in_coredump as default mode. Any existing script which rely on
|
||||
* dump_mode to be in_mem should now explicitly run the cmd
|
||||
* "adb shell echo 2 > /sys/kernel/debug/dri/0/debug/reg_dump" before
|
||||
* doing the test cases.
|
||||
*/
|
||||
#define SDE_DBG_DEFAULT_DUMP_MODE SDE_DBG_DUMP_IN_COREDUMP
|
||||
|
||||
/*
|
||||
* Define blocks for register write logging.
|
||||
@@ -158,6 +166,8 @@ struct sde_dbg_evtlog {
|
||||
u32 next;
|
||||
u32 enable;
|
||||
u32 dump_mode;
|
||||
char *dumped_evtlog;
|
||||
u32 log_size;
|
||||
spinlock_t spin_lock;
|
||||
struct list_head filter_list;
|
||||
};
|
||||
@@ -338,11 +348,24 @@ void sde_evtlog_log(struct sde_dbg_evtlog *evtlog, const char *name, int line,
|
||||
void sde_reglog_log(u8 blk_id, u32 val, u32 addr);
|
||||
|
||||
/**
|
||||
* sde_evtlog_dump_all - print all entries in event log to kernel log
|
||||
* sde_evtlog_dump_to_buffer - parse one line of evtlog to a given buffer
|
||||
* @evtlog: pointer to evtlog
|
||||
* Returns: none
|
||||
* @evtlog_buf: buffer to store evtlog
|
||||
* @evtlog_buf_size: lenght of the buffer
|
||||
* @update_last_entry: whether update last dump marker
|
||||
* @full_dump: 1, print the whole evtlog captured; 0, print last 256 lines of log
|
||||
* Returns: log size
|
||||
*/
|
||||
void sde_evtlog_dump_all(struct sde_dbg_evtlog *evtlog);
|
||||
ssize_t sde_evtlog_dump_to_buffer(struct sde_dbg_evtlog *evtlog,
|
||||
char *evtlog_buf, ssize_t evtlog_buf_size,
|
||||
bool update_last_entry, bool full_dump);
|
||||
|
||||
/**
|
||||
* sde_evtlog_count - count the current log size for print
|
||||
* @evtlog: pointer to evtlog
|
||||
* Returns: log size
|
||||
*/
|
||||
u32 sde_evtlog_count(struct sde_dbg_evtlog *evtlog);
|
||||
|
||||
/**
|
||||
* sde_evtlog_is_enabled - check whether log collection is enabled for given
|
||||
|
新增問題並參考
封鎖使用者