msm: bam_dmux: move sps_disconnect calls to the reconnect case
The A2 BAM hardware may be powered off when disconnect_to_bam() is called.
If so, sps_disconnect() will cause L2 errors a possibly a watchdog crash.
Move the sps_disconnect() calls to the reconnect case where A2 BAM has
powered back up and it is safe to call sps_disconnect()
CRs-Fixed: 402645
Change-Id: I4a365a3a4b91255429cbc326f31ab29aacc273b6
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
diff --git a/arch/arm/mach-msm/bam_dmux.c b/arch/arm/mach-msm/bam_dmux.c
index 1a02fce..d5e4638 100644
--- a/arch/arm/mach-msm/bam_dmux.c
+++ b/arch/arm/mach-msm/bam_dmux.c
@@ -1809,6 +1809,10 @@
in_global_reset = 0;
vote_dfab();
if (!power_management_only_mode) {
+ sps_disconnect(bam_tx_pipe);
+ sps_disconnect(bam_rx_pipe);
+ __memzero(rx_desc_mem_buf.base, rx_desc_mem_buf.size);
+ __memzero(tx_desc_mem_buf.base, tx_desc_mem_buf.size);
i = sps_device_reset(a2_device_handle);
if (i)
pr_err("%s: device reset failed rc = %d\n", __func__,
@@ -1861,12 +1865,6 @@
/* tear down BAM connection */
INIT_COMPLETION(bam_connection_completion);
- if (!power_management_only_mode) {
- sps_disconnect(bam_tx_pipe);
- sps_disconnect(bam_rx_pipe);
- __memzero(rx_desc_mem_buf.base, rx_desc_mem_buf.size);
- __memzero(tx_desc_mem_buf.base, tx_desc_mem_buf.size);
- }
unvote_dfab();
mutex_lock(&bam_rx_pool_mutexlock);