soc: qcom: bam_dmux: Skip disconnect call on bootup

Added a flag to skip disconnect_to_bam call on modem
bootup. This would happen in scenarios when we haven't
received a powerdown request after the previous
reconnect_to_bam call or if the previous
reconnect_to_bam call has been skipped due to SSR.

Change-Id: Ia6f87be7a3a92c1b2d24b948e7012e3a128feb99
Signed-off-by: Vivek Golani <vgolani@codeaurora.org>
This commit is contained in:
Vivek Golani 2021-06-23 11:27:18 +05:30
parent 3dc0765c59
commit bf2924fd64

View File

@ -299,6 +299,8 @@ static struct notifier_block restart_notifier = {
static int in_global_reset;
/* end subsystem restart */
static int ssr_skipped_reconnect;
#define bam_ch_is_open(x) \
(bam_ch[(x)].status == (BAM_CH_LOCAL_OPEN | BAM_CH_REMOTE_OPEN))
@ -2007,6 +2009,7 @@ static void reconnect_to_bam(void)
int i;
if (in_global_reset) {
ssr_skipped_reconnect = 1;
BAM_DMUX_LOG("%s: skipping due to SSR\n", __func__);
return;
}
@ -2060,7 +2063,7 @@ static void disconnect_to_bam(void)
unsigned long flags;
unsigned long time_remaining;
if (!in_global_reset) {
if (!in_global_reset && !ssr_skipped_reconnect) {
time_remaining = wait_for_completion_timeout(
&shutdown_completion,
msecs_to_jiffies(SHUTDOWN_TIMEOUT_MS));
@ -2115,6 +2118,7 @@ static void disconnect_to_bam(void)
mutex_unlock(&bam_rx_pool_mutexlock);
toggle_apps_ack();
verify_tx_queue_is_empty(__func__);
ssr_skipped_reconnect = 0;
}
static void vote_dfab(void)
@ -2252,6 +2256,8 @@ static int restart_notifier_cb(struct notifier_block *this,
process_dynamic_mtu(false);
set_ul_mtu(0, true);
dynamic_mtu_enabled = false;
if (bam_connection_is_active)
ssr_skipped_reconnect = 1;
/* Cleanup Channel States */
mutex_lock(&bam_pdev_mutexlock);
@ -2477,7 +2483,7 @@ static void toggle_apps_ack(void)
{
static unsigned int clear_bit; /* 0 = set the bit, else clear bit */
if (in_global_reset) {
if (in_global_reset || ssr_skipped_reconnect) {
BAM_DMUX_LOG("%s: skipped due to SSR\n", __func__);
return;
}