msm: rtb: Disable RTB on panic
By the time the panic notifiers have run, all the useful
information for debugging purposes has already been collected.
Stop logging during panic so useful information doesn't get
flooded out.
Change-Id: I7e23db3d6d3dfaf53cad86b2949a550d7cf218d1
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
diff --git a/arch/arm/mach-msm/msm_rtb.c b/arch/arm/mach-msm/msm_rtb.c
index 403c13d..9dbf9c1 100644
--- a/arch/arm/mach-msm/msm_rtb.c
+++ b/arch/arm/mach-msm/msm_rtb.c
@@ -74,6 +74,17 @@
module_param_named(filter, msm_rtb.filter, uint, 0644);
module_param_named(enable, msm_rtb.enabled, int, 0644);
+static int msm_rtb_panic_notifier(struct notifier_block *this,
+ unsigned long event, void *ptr)
+{
+ msm_rtb.enabled = 0;
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block msm_rtb_panic_blk = {
+ .notifier_call = msm_rtb_panic_notifier,
+};
+
int msm_rtb_event_should_log(enum logk_event_type log_type)
{
return msm_rtb.initialized && msm_rtb.enabled &&
@@ -258,7 +269,8 @@
msm_rtb.step_size = 1;
#endif
-
+ atomic_notifier_chain_register(&panic_notifier_list,
+ &msm_rtb_panic_blk);
msm_rtb.initialized = 1;
return 0;
}