Skip to content

Commit

Permalink
msm: ipa3: Update channel start as success in flow control state
Browse files Browse the repository at this point in the history
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 <pkurapat@codeaurora.org>
  • Loading branch information
Praveen Kurapati committed Aug 8, 2019
1 parent a92c2f5 commit eb922cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions drivers/platform/msm/gsi/gsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion drivers/platform/msm/gsi/gsi.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
};

Expand Down

4 comments on commit eb922cd

@kholk
Copy link
Contributor

@kholk kholk commented on eb922cd Jul 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one may fix or may spectacularly break the fragile Yoshino platform: please test it carefully!

@stefanhh0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It already runs on yoshino/lilac and I have not seen any regression so far. I will do more reboot tests and report back

So maybe it is the the last missing piece for fixing sonyxperiadev/bug_tracker#580?

@stefanhh0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After several reboots the issue is back, so sonyxperiadev/bug_tracker#580 has not been fixed implicitly by the commit.

@stefanhh0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As well not a real change, it has been cherry-picked earlier: 96c6d1b

Please sign in to comment.