mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 12:50:52 +07:00
net: ipa: always check for stopped channel
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: 650d160382
("soc: qcom: ipa: the generic software interface")
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f2ca673d2c
commit
5468cbcddf
@ -500,6 +500,13 @@ static int gsi_channel_stop_command(struct gsi_channel *channel)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
state = gsi_channel_state(channel);
|
state = gsi_channel_state(channel);
|
||||||
|
|
||||||
|
/* 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 &&
|
if (state != GSI_CHANNEL_STATE_STARTED &&
|
||||||
state != GSI_CHANNEL_STATE_STOP_IN_PROC)
|
state != GSI_CHANNEL_STATE_STOP_IN_PROC)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -789,20 +796,11 @@ int gsi_channel_start(struct gsi *gsi, u32 channel_id)
|
|||||||
int gsi_channel_stop(struct gsi *gsi, u32 channel_id)
|
int gsi_channel_stop(struct gsi *gsi, u32 channel_id)
|
||||||
{
|
{
|
||||||
struct gsi_channel *channel = &gsi->channel[channel_id];
|
struct gsi_channel *channel = &gsi->channel[channel_id];
|
||||||
enum gsi_channel_state state;
|
|
||||||
u32 retries;
|
u32 retries;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
gsi_channel_freeze(channel);
|
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).
|
|
||||||
*/
|
|
||||||
state = gsi_channel_state(channel);
|
|
||||||
if (state == GSI_CHANNEL_STATE_STOPPED)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* RX channels might require a little time to enter STOPPED state */
|
/* RX channels might require a little time to enter STOPPED state */
|
||||||
retries = channel->toward_ipa ? 0 : GSI_CHANNEL_STOP_RX_RETRIES;
|
retries = channel->toward_ipa ? 0 : GSI_CHANNEL_STOP_RX_RETRIES;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user