lkml.org 
[lkml]   [2020]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.7 023/244] net: ipa: always check for stopped channel
    Date
    From: Alex Elder <elder@linaro.org>

    [ Upstream commit 5468cbcddf47f674829c6ada190283108a63d7b5 ]

    In gsi_channel_stop(), there's a check to see if the channel might
    have entered STOPPED state since a previous call, which might have
    timed out before stopping completed.

    That check actually belongs in gsi_channel_stop_command(), which is
    called repeatedly by gsi_channel_stop() for RX channels.

    Fixes: 650d1603825d ("soc: qcom: ipa: the generic software interface")
    Signed-off-by: Alex Elder <elder@linaro.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/ipa/gsi.c | 13 ++++++-------
    1 file changed, 6 insertions(+), 7 deletions(-)

    --- a/drivers/net/ipa/gsi.c
    +++ b/drivers/net/ipa/gsi.c
    @@ -490,6 +490,12 @@ static int gsi_channel_stop_command(stru
    enum gsi_channel_state state = channel->state;
    int ret;

    + /* Channel could have entered STOPPED state since last call
    + * if it timed out. If so, we're done.
    + */
    + if (state == GSI_CHANNEL_STATE_STOPPED)
    + return 0;
    +
    if (state != GSI_CHANNEL_STATE_STARTED &&
    state != GSI_CHANNEL_STATE_STOP_IN_PROC)
    return -EINVAL;
    @@ -773,13 +779,6 @@ int gsi_channel_stop(struct gsi *gsi, u3

    gsi_channel_freeze(channel);

    - /* Channel could have entered STOPPED state since last call if the
    - * STOP command timed out. We won't stop a channel if stopping it
    - * was successful previously (so we still want the freeze above).
    - */
    - if (channel->state == GSI_CHANNEL_STATE_STOPPED)
    - return 0;
    -
    /* RX channels might require a little time to enter STOPPED state */
    retries = channel->toward_ipa ? 0 : GSI_CHANNEL_STOP_RX_RETRIES;


    \
     
     \ /
      Last update: 2020-07-20 18:06    [W:4.043 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site