From a29d731c601b501cfce2a0345e1227fa979cedba Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 9 Apr 2012 13:10:01 -0700 Subject: [PATCH] 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 --- arch/arm/mach-msm/msm_rtb.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-msm/msm_rtb.c b/arch/arm/mach-msm/msm_rtb.c index 403c13d1a1f..9dbf9c1ebed 100644 --- a/arch/arm/mach-msm/msm_rtb.c +++ b/arch/arm/mach-msm/msm_rtb.c @@ -74,6 +74,17 @@ struct msm_rtb_state msm_rtb = { 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 @@ int msm_rtb_probe(struct platform_device *pdev) msm_rtb.step_size = 1; #endif - + atomic_notifier_chain_register(&panic_notifier_list, + &msm_rtb_panic_blk); msm_rtb.initialized = 1; return 0; }