msm: subsystem_restart: Add support for ramdump notifications

When a subsystem crashes and userspace has enabled ramdumps
through the subsystem framework, a driver (which is not the
subsystem driver) might want to know about it so that it
can dump additional debug information. These drivers can't
use the existing "SUBSYS_AFTER_SHUTDOWN" notification since
they can't tell if the power down is due to a clean shutdown
or due to a crash. Also, having a notification that's always
sent out with a "ramdump enabled" flag would remove the
need for some of the drivers to maintain additional state.

So, add a new ramdump notification with an "enabled" flag
that's always sent out after a subsystem crashes to indicate
that the state of the system is conducive to dumping additional
debug information.

Change-Id: I6f5701f7003d1547e3dbf8cc7d9fbe09b230a7ed
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
diff --git a/arch/arm/mach-msm/subsystem_notif.c b/arch/arm/mach-msm/subsystem_notif.c
index afa7b48..f0db0e9 100644
--- a/arch/arm/mach-msm/subsystem_notif.c
+++ b/arch/arm/mach-msm/subsystem_notif.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011, 2013, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -147,7 +147,8 @@
 EXPORT_SYMBOL(subsys_notif_add_subsys);
 
 int subsys_notif_queue_notification(void *subsys_handle,
-					enum subsys_notif_type notif_type)
+					enum subsys_notif_type notif_type,
+					void *data)
 {
 	int ret = 0;
 	struct subsys_notif_info *subsys =
@@ -159,10 +160,9 @@
 	if (notif_type < 0 || notif_type >= SUBSYS_NOTIF_TYPE_COUNT)
 		return -EINVAL;
 
-	ret = srcu_notifier_call_chain(
-		&subsys->subsys_notif_rcvr_list, notif_type,
-		(void *)subsys);
-
+		ret = srcu_notifier_call_chain(
+			&subsys->subsys_notif_rcvr_list, notif_type,
+			data);
 	return ret;
 }
 EXPORT_SYMBOL(subsys_notif_queue_notification);