msm: bam_dmux: abort ul wakeups in the middle of SSR
Abort any uplonk wakeups that happen to occur in the middle of subsystem
restart. This may occur as a small race condition window exists where
bam_dmux knows SSR has occured, but hadn't yet sent that info to the
clients. During this small window, a client may try to send some data,
triggering a ul_wakeup()
CRs-Fixed: 392604
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
(cherry picked from commit 00424ff7ef1b7ca6ddb0499a559d1693f6ae5c6a)
Change-Id: Iabdc89528fd7a20eee56c96a3dfbe3b5fc1bf514
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
diff --git a/arch/arm/mach-msm/bam_dmux.c b/arch/arm/mach-msm/bam_dmux.c
index 04e751a..96ad756 100644
--- a/arch/arm/mach-msm/bam_dmux.c
+++ b/arch/arm/mach-msm/bam_dmux.c
@@ -1702,6 +1702,20 @@
}
/*
+ * if this gets hit, that means restart_notifier_cb() has started
+ * but probably not finished, thus we know SSR has happened, but
+ * haven't been able to send that info to our clients yet.
+ * in that case, abort the ul_wakeup() so that we don't undo any
+ * work restart_notifier_cb() has done. The clients will be notified
+ * shortly. No cleanup necessary (reschedule the wakeup) as our and
+ * their SSR handling will cover it
+ */
+ if (unlikely(in_global_reset == 1)) {
+ mutex_unlock(&wakeup_lock);
+ return;
+ }
+
+ /*
* if someone is voting for UL before bam is inited (modem up first
* time), set flag for init to kickoff ul wakeup once bam is inited
*/