diff --git a/drivers/edac/kryo_arm64_edac.c b/drivers/edac/kryo_arm64_edac.c index 600609980a29..6515c712a591 100644 --- a/drivers/edac/kryo_arm64_edac.c +++ b/drivers/edac/kryo_arm64_edac.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */ #include @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -129,6 +130,7 @@ struct erp_drvdata { struct edac_device_ctl_info *edev_ctl; struct erp_drvdata __percpu *erp_cpu_drvdata; struct notifier_block nb_pm; + struct notifier_block nb_panic; int ppi; }; @@ -398,6 +400,23 @@ unlock: spin_unlock_irqrestore(&local_handler_lock, flags); } +static int kryo_cpu_panic_notify(struct notifier_block *this, + unsigned long event, void *ptr) +{ + struct edac_device_ctl_info *edev_ctl = + panic_handler_drvdata->edev_ctl; + +#ifdef CONFIG_EDAC_KRYO_ARM64_PANIC_ON_CE + edev_ctl->panic_on_ce = 0; +#endif + edev_ctl->panic_on_ue = 0; + + kryo_check_l3_scu_error(edev_ctl); + kryo_check_l1_l2_ecc(edev_ctl); + + return NOTIFY_OK; +} + static irqreturn_t kryo_l1_l2_handler(int irq, void *drvdata) { kryo_check_l1_l2_ecc(panic_handler_drvdata->edev_ctl); @@ -480,6 +499,9 @@ static int kryo_cpu_erp_probe(struct platform_device *pdev) #endif drv->edev_ctl->panic_on_ue = ARM64_ERP_PANIC_ON_UE; drv->nb_pm.notifier_call = kryo_pmu_cpu_pm_notify; + drv->nb_panic.notifier_call = kryo_cpu_panic_notify; + atomic_notifier_chain_register(&panic_notifier_list, + &drv->nb_panic); platform_set_drvdata(pdev, drv); rc = edac_device_add_device(drv->edev_ctl);