mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
Merge "drivers: edac: Add panic notifier for kryo EDAC device"
This commit is contained in:
commit
6f029619c3
1 changed files with 23 additions and 1 deletions
|
|
@ -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 <linux/kernel.h>
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
#include <linux/cpu.h>
|
||||
#include <linux/cpu_pm.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/of_irq.h>
|
||||
|
||||
#include <asm/cputype.h>
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue