From 3b674db6357a40d4471d2cc36a6b43aaf36cdaa4 Mon Sep 17 00:00:00 2001 From: Hong Guo Date: Fri, 22 Feb 2019 17:18:35 +0800 Subject: [PATCH] reboot: get corrent reboot reason in system panic [1/1] PD#TV-2272 Problem: can't get corrent reboot reason in system panic Solution: get corrent reboot reason in system panic Verify: test pass on T962x2_x301 Change-Id: If0fc95c2807d89542b4ccbc8e3709be20f17b03b Signed-off-by: Hong Guo --- drivers/amlogic/reboot/reboot.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/reboot/reboot.c b/drivers/amlogic/reboot/reboot.c index d520cf36a9de..fe00eeccb16b 100644 --- a/drivers/amlogic/reboot/reboot.c +++ b/drivers/amlogic/reboot/reboot.c @@ -250,7 +250,21 @@ static int aml_restart_probe(struct platform_device *pdev) } #endif ret = register_die_notifier(&panic_notifier); - return ret; + if (ret != 0) { + pr_err("%s,register die notifier failed,ret =%d!\n", + __func__, ret); + return ret; + } + + /* Register a call for panic conditions. */ + ret = atomic_notifier_chain_register(&panic_notifier_list, + &panic_notifier); + if (ret != 0) { + pr_err("%s,register panic notifier failed,ret =%d!\n", + __func__, ret); + return ret; + } + return 0; } static const struct of_device_id of_aml_restart_match[] = {