mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
fs: pstore: register buffers to minidump
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com> Change-Id: I0c6feb839fe6a4d25bc0174659cba528ffef4975
This commit is contained in:
@@ -24,6 +24,10 @@
|
||||
#include <linux/of_reserved_mem.h>
|
||||
#include "internal.h"
|
||||
|
||||
#if IS_REACHABLE(CONFIG_ROCKCHIP_MINIDUMP)
|
||||
#include <soc/rockchip/rk_minidump.h>
|
||||
#endif
|
||||
|
||||
#define RAMOOPS_KERNMSG_HDR "===="
|
||||
#define MIN_MEM_SIZE 4096UL
|
||||
|
||||
@@ -775,6 +779,49 @@ static int ramoops_parse_dt(struct platform_device *pdev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if IS_REACHABLE(CONFIG_ROCKCHIP_MINIDUMP)
|
||||
static void _ramoops_register_ram_zone_info_to_minidump(struct persistent_ram_zone *prz)
|
||||
{
|
||||
struct md_region md_entry = {};
|
||||
|
||||
strscpy(md_entry.name, prz->label, sizeof(md_entry.name));
|
||||
|
||||
md_entry.virt_addr = (u64)prz->vaddr;
|
||||
md_entry.phys_addr = prz->paddr;
|
||||
md_entry.size = prz->size;
|
||||
|
||||
if (rk_minidump_add_region(&md_entry) < 0)
|
||||
pr_err("Failed to add %s in Minidump\n", prz->label);
|
||||
}
|
||||
|
||||
static void ramoops_register_ram_zone_info_to_minidump(struct ramoops_context *cxt)
|
||||
{
|
||||
int i = 0;
|
||||
struct persistent_ram_zone *prz = NULL;
|
||||
|
||||
for (i = 0; i < cxt->max_boot_log_cnt; i++) {
|
||||
prz = cxt->boot_przs[i];
|
||||
_ramoops_register_ram_zone_info_to_minidump(prz);
|
||||
}
|
||||
|
||||
for (i = 0; i < cxt->max_dump_cnt; i++) {
|
||||
prz = cxt->dprzs[i];
|
||||
_ramoops_register_ram_zone_info_to_minidump(prz);
|
||||
}
|
||||
|
||||
for (i = 0; i < cxt->max_ftrace_cnt; i++) {
|
||||
prz = cxt->fprzs[i];
|
||||
_ramoops_register_ram_zone_info_to_minidump(prz);
|
||||
}
|
||||
|
||||
prz = cxt->cprz;
|
||||
_ramoops_register_ram_zone_info_to_minidump(prz);
|
||||
|
||||
prz = cxt->mprz;
|
||||
_ramoops_register_ram_zone_info_to_minidump(prz);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int ramoops_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
@@ -962,7 +1009,9 @@ static int ramoops_probe(struct platform_device *pdev)
|
||||
ramoops_console_size = pdata->console_size;
|
||||
ramoops_pmsg_size = pdata->pmsg_size;
|
||||
ramoops_ftrace_size = pdata->ftrace_size;
|
||||
|
||||
#if IS_REACHABLE(CONFIG_ROCKCHIP_MINIDUMP)
|
||||
ramoops_register_ram_zone_info_to_minidump(cxt);
|
||||
#endif
|
||||
pr_info("using 0x%lx@0x%llx, ecc: %d\n",
|
||||
cxt->size, (unsigned long long)cxt->phys_addr,
|
||||
cxt->ecc_info.ecc_size);
|
||||
|
||||
Reference in New Issue
Block a user