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

Commit be48b076 authored by Lingutla Chandrasekhar's avatar Lingutla Chandrasekhar
Browse files

soc: qcom: Register default dump entries to minidump table



Add below common dump entries to minidump table:
All memory dump table entries, kernel data/bss sections,
percpu static sections, rtb, logbuf, wdogdata, lpm_debug,
stackpointer, and current task struct.
Also add name for memory dump table entries to accommodate
Minidump support.

Change-Id: I45d121bc36b40332cfd0a0f5142572c6ce8f8a26
Signed-off-by: default avatarLingutla Chandrasekhar <clingutla@codeaurora.org>
parent 5d4442b4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@
#include <asm/tlbflush.h>
#include <asm/ptrace.h>
#include <asm/virt.h>
#include <soc/qcom/minidump.h>

#define CREATE_TRACE_POINTS
#include <trace/events/ipi.h>
@@ -844,6 +845,7 @@ static void ipi_cpu_stop(unsigned int cpu, struct pt_regs *regs)
		pr_crit("CPU%u: stopping\n", cpu);
		show_regs(regs);
		dump_stack();
		dump_stack_minidump(regs->sp);
		raw_spin_unlock(&stop_lock);
	}

+10 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#include <soc/qcom/event_timer.h>
#include <soc/qcom/lpm-stats.h>
#include <soc/qcom/system_pm.h>
#include <soc/qcom/minidump.h>
#include <asm/arch_timer.h>
#include <asm/suspend.h>
#include <asm/cpuidle.h>
@@ -1642,6 +1643,7 @@ static int lpm_probe(struct platform_device *pdev)
	int ret;
	int size;
	struct kobject *module_kobj = NULL;
	struct md_region md_entry;

	get_online_cpus();
	lpm_root_node = lpm_of_parse_cluster(pdev);
@@ -1698,6 +1700,14 @@ static int lpm_probe(struct platform_device *pdev)
		goto failed;
	}

	/* Add lpm_debug to Minidump*/
	strlcpy(md_entry.name, "KLPMDEBUG", sizeof(md_entry.name));
	md_entry.virt_addr = (uintptr_t)lpm_debug;
	md_entry.phys_addr = lpm_debug_phys;
	md_entry.size = size;
	if (msm_minidump_add_region(&md_entry))
		pr_info("Failed to add lpm_debug in Minidump\n");

	return 0;
failed:
	free_cluster_node(lpm_root_node);
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ obj-$(CONFIG_MSM_GLADIATOR_ERP) += gladiator_erp.o
obj-$(CONFIG_QCOM_EUD) += eud.o
obj-$(CONFIG_QCOM_WATCHDOG_V2) += watchdog_v2.o
obj-$(CONFIG_QCOM_MEMORY_DUMP_V2) += memory_dump_v2.o
obj-$(CONFIG_QCOM_MINIDUMP) += msm_minidump.o
obj-$(CONFIG_QCOM_MINIDUMP) += msm_minidump.o minidump_log.o
obj-$(CONFIG_QCOM_RUN_QUEUE_STATS) += rq_stats.o
obj-$(CONFIG_QCOM_SECURE_BUFFER) += secure_buffer.o
obj-$(CONFIG_MSM_SMEM) += msm_smem.o smem_debug.o
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -74,6 +74,8 @@ static int cpuss_dump_probe(struct platform_device *pdev)

		dump_data->addr = dump_addr;
		dump_data->len = size;
		scnprintf(dump_data->name, sizeof(dump_data->name),
			"KCPUSS%X", id);
		dump_entry.id = id;
		dump_entry.addr = virt_to_phys(dump_data);
		ret = msm_dump_data_register(MSM_DUMP_TABLE_APPS, &dump_entry);
+35 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <soc/qcom/memory_dump.h>
#include <soc/qcom/minidump.h>
#include <soc/qcom/scm.h>
#include <linux/of_device.h>
#include <linux/dma-mapping.h>
@@ -89,6 +90,33 @@ static struct msm_dump_table *msm_dump_get_table(enum msm_dump_table_ids id)
	return table;
}

static int msm_dump_data_add_minidump(struct msm_dump_entry *entry)
{
	struct msm_dump_data *data;
	struct md_region md_entry;

	data = (struct msm_dump_data *)(phys_to_virt(entry->addr));

	if (!data->addr || !data->len)
		return -EINVAL;

	if (!strcmp(data->name, "")) {
		pr_debug("Entry name is NULL, Use ID %d for minidump\n",
			 entry->id);
		snprintf(md_entry.name, sizeof(md_entry.name), "KMDT0x%X",
			 entry->id);
	} else {
		strlcpy(md_entry.name, data->name, sizeof(md_entry.name));
	}

	md_entry.phys_addr = data->addr;
	md_entry.virt_addr = (uintptr_t)phys_to_virt(data->addr);
	md_entry.size = data->len;
	md_entry.id = entry->id;

	return msm_minidump_add_region(&md_entry);
}

int msm_dump_data_register(enum msm_dump_table_ids id,
			   struct msm_dump_entry *entry)
{
@@ -109,6 +137,10 @@ int msm_dump_data_register(enum msm_dump_table_ids id,
	table->num_entries++;

	dmac_flush_range(table, (void *)table + sizeof(struct msm_dump_table));

	if (msm_dump_data_add_minidump(entry))
		pr_err("Failed to add entry in Minidump table\n");

	return 0;
}
EXPORT_SYMBOL(msm_dump_data_register);
@@ -245,6 +277,9 @@ static int mem_dump_probe(struct platform_device *pdev)

		dump_data->addr = dump_addr;
		dump_data->len = size;
		strlcpy(dump_data->name, child_node->name,
			strlen(child_node->name) + 1);

		dump_entry.id = id;
		dump_entry.addr = virt_to_phys(dump_data);
		ret = msm_dump_data_register(MSM_DUMP_TABLE_APPS, &dump_entry);
Loading