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

Commit c22ea64a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: edac: Add PM notifier to check ECC during CPU_EXIT_PM"

parents 3f8fbb94 73fd1701
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include <linux/platform_device.h>
#include <linux/smp.h>
#include <linux/cpu.h>
#include <linux/cpu_pm.h>
#include <linux/interrupt.h>
#include <linux/of_irq.h>

@@ -125,6 +126,7 @@ static const struct errors_edac errors[] = {
struct erp_drvdata {
	struct edac_device_ctl_info *edev_ctl;
	struct erp_drvdata __percpu **erp_cpu_drvdata;
	struct notifier_block nb_pm;
	int ppi;
};

@@ -358,6 +360,19 @@ static irqreturn_t kryo3xx_l3_scu_handler(int irq, void *drvdata)
	return IRQ_HANDLED;
}

static int kryo3xx_pmu_cpu_pm_notify(struct notifier_block *self,
				unsigned long action, void *v)
{
	switch (action) {
	case CPU_PM_EXIT:
		kryo3xx_check_l3_scu_error(panic_handler_drvdata->edev_ctl);
		kryo3xx_check_l1_l2_ecc(panic_handler_drvdata->edev_ctl);
		break;
	}

	return NOTIFY_OK;
}

static void initialize_registers(void *info)
{
	set_errxctlr_el1();
@@ -400,6 +415,7 @@ static int kryo3xx_cpu_erp_probe(struct platform_device *pdev)
	drv->edev_ctl->ctl_name = "cache";
	drv->edev_ctl->panic_on_ce = ARM64_ERP_PANIC_ON_CE;
	drv->edev_ctl->panic_on_ue = ARM64_ERP_PANIC_ON_UE;
	drv->nb_pm.notifier_call = kryo3xx_pmu_cpu_pm_notify;
	platform_set_drvdata(pdev, drv);

	rc = edac_device_add_device(drv->edev_ctl);
@@ -424,6 +440,8 @@ static int kryo3xx_cpu_erp_probe(struct platform_device *pdev)
		goto out_dev;
	}

	cpu_pm_register_notifier(&(drv->nb_pm));

	return 0;

out_dev: