From eb922cd78bcc1d1895886552062c08b4d73c2614 Mon Sep 17 00:00:00 2001 From: Praveen Kurapati Date: Fri, 2 Aug 2019 19:00:06 +0530 Subject: [PATCH] msm: ipa3: Update channel start as success in flow control state Observing race condition when we are starting the channel and modem trying to offload flow_control on same channel. Add changes to retrun success if channel state is flow control when trying to start the channel. Change-Id: Id254cd0e3e17c74e931d27cb96577224559c091e Signed-off-by: Praveen Kurapati --- drivers/platform/msm/gsi/gsi.c | 6 ++++-- drivers/platform/msm/gsi/gsi.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/platform/msm/gsi/gsi.c b/drivers/platform/msm/gsi/gsi.c index 13de320287024..ca98c6e4cf9d9 100644 --- a/drivers/platform/msm/gsi/gsi.c +++ b/drivers/platform/msm/gsi/gsi.c @@ -175,7 +175,8 @@ static void gsi_channel_state_change_wait(unsigned long chan_hdl, } if (op == GSI_CH_START) { - if (curr_state == GSI_CHAN_STATE_STARTED) { + if (curr_state == GSI_CHAN_STATE_STARTED || + curr_state == GSI_CHAN_STATE_FLOW_CONTROL) { ctx->state = curr_state; return; } @@ -2697,7 +2698,8 @@ int gsi_start_channel(unsigned long chan_hdl) ctx, GSI_START_CMD_TIMEOUT_MS, op); - if (ctx->state != GSI_CHAN_STATE_STARTED) { + if (ctx->state != GSI_CHAN_STATE_STARTED && + ctx->state != GSI_CHAN_STATE_FLOW_CONTROL) { /* * Hardware returned unexpected status, unexpected * hardware state. diff --git a/drivers/platform/msm/gsi/gsi.h b/drivers/platform/msm/gsi/gsi.h index e4b524949967b..b1396626f37ac 100644 --- a/drivers/platform/msm/gsi/gsi.h +++ b/drivers/platform/msm/gsi/gsi.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2019, 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 @@ -90,6 +90,7 @@ enum gsi_chan_state { GSI_CHAN_STATE_STARTED = 0x2, GSI_CHAN_STATE_STOPPED = 0x3, GSI_CHAN_STATE_STOP_IN_PROC = 0x4, + GSI_CHAN_STATE_FLOW_CONTROL = 0x5, GSI_CHAN_STATE_ERROR = 0xf };