reboot: get corrent reboot reason in system panic [1/1]
authorHong Guo <hong.guo@amlogic.com>
Fri, 22 Feb 2019 09:18:35 +0000 (17:18 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 28 Feb 2019 03:04:18 +0000 (19:04 -0800)
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 <hong.guo@amlogic.com>
drivers/amlogic/reboot/reboot.c

index 6e5cd09..235d12d 100644 (file)
@@ -154,7 +154,21 @@ static int aml_restart_probe(struct platform_device *pdev)
        }
 
        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[] = {