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

Commit 1f8440c4 authored by Rohit Vaswani's avatar Rohit Vaswani
Browse files

edac: arm64: Check for ECC errors on panic



Check for ecc errors on panic on all processors

Change-Id: I2a68644afb2730a69aca35abb1f10899a11514dd
Signed-off-by: default avatarRohit Vaswani <rvaswani@codeaurora.org>
parent fe65c3f4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -15,8 +15,10 @@

#ifdef CONFIG_EDAC_CORTEX_ARM64
void arm64_erp_local_dbe_handler(void);
void arm64_check_cache_ecc(void);
#else
static inline void arm64_erp_local_dbe_handler(void) { }
static inline void arm64_check_cache_ecc(void) { }
#endif

static inline void atomic_scrub(void *addr, int size)
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
#include <asm/sections.h>
#include <asm/tlbflush.h>
#include <asm/ptrace.h>
#include <asm/edac.h>

/*
 * as from 2.5, kernels no longer have an init_tasks structure
@@ -556,6 +557,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();
		arm64_check_cache_ecc();
		raw_spin_unlock(&stop_lock);
	}

+20 −1
Original line number Diff line number Diff line
@@ -113,11 +113,12 @@ struct erp_drvdata {
	u32 mem_perf_counter;
	struct notifier_block nb_pm;
	struct notifier_block nb_cpu;
	struct notifier_block nb_panic;
	struct work_struct work;
	int apply_cti_pmu_wa;
};

static struct erp_drvdata *abort_handler_drvdata;
static struct erp_drvdata *abort_handler_drvdata, *panic_handler_drvdata;

struct erp_local_data {
	struct erp_drvdata *drv;
@@ -785,6 +786,20 @@ static int msm_cti_pmu_wa_cpu_notify(struct notifier_block *self,
	return NOTIFY_OK;
}

void arm64_check_cache_ecc(void)
{
	if (panic_handler_drvdata)
		check_sbe_event(panic_handler_drvdata);
}

static int arm64_erp_panic_notify(struct notifier_block *this,
			      unsigned long event, void *ptr)
{
	arm64_check_cache_ecc();

	return NOTIFY_OK;
}

static int arm64_cpu_erp_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
@@ -879,6 +894,9 @@ static int arm64_cpu_erp_probe(struct platform_device *pdev)
	cpu_pm_register_notifier(&(drv->nb_pm));
	drv->nb_cpu.notifier_call = msm_cti_pmu_wa_cpu_notify;
	register_cpu_notifier(&drv->nb_cpu);
	drv->nb_panic.notifier_call = arm64_erp_panic_notify;
	atomic_notifier_chain_register(&panic_notifier_list,
				       &drv->nb_panic);
	arm64_pmu_irq_handled_externally();
	if (drv->apply_cti_pmu_wa) {
		schedule_on_each_cpu(msm_enable_cti_pmu_workaround);
@@ -902,6 +920,7 @@ out_irq:
	WARN_ON(abort_handler_drvdata);

	abort_handler_drvdata = drv;
	panic_handler_drvdata = drv;
	return 0;

out_dev: