net: ipa: synchronize NAPI only for suspend
When stopping a channel, gsi_channel_stop() will ensure NAPI polling is complete when it calls napi_disable(). So there is no need to call napi_synchronize() in that case. Move the call to napi_synchronize() out of __gsi_channel_stop() and into gsi_channel_suspend(), so it's only used where needed. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
63ec9be133
commit
b1750723c9
@@ -939,13 +939,7 @@ static int __gsi_channel_stop(struct gsi_channel *channel, bool stop)
|
|||||||
|
|
||||||
mutex_unlock(&gsi->mutex);
|
mutex_unlock(&gsi->mutex);
|
||||||
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* Ensure NAPI polling has finished. */
|
|
||||||
napi_synchronize(&channel->napi);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stop a started channel */
|
/* Stop a started channel */
|
||||||
@@ -987,8 +981,16 @@ void gsi_channel_reset(struct gsi *gsi, u32 channel_id, bool doorbell)
|
|||||||
int gsi_channel_suspend(struct gsi *gsi, u32 channel_id, bool stop)
|
int gsi_channel_suspend(struct gsi *gsi, u32 channel_id, bool stop)
|
||||||
{
|
{
|
||||||
struct gsi_channel *channel = &gsi->channel[channel_id];
|
struct gsi_channel *channel = &gsi->channel[channel_id];
|
||||||
|
int ret;
|
||||||
|
|
||||||
return __gsi_channel_stop(channel, stop);
|
ret = __gsi_channel_stop(channel, stop);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
/* Ensure NAPI polling has finished. */
|
||||||
|
napi_synchronize(&channel->napi);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Resume a suspended channel (starting will be requested if STOPPED) */
|
/* Resume a suspended channel (starting will be requested if STOPPED) */
|
||||||
|
|||||||
Reference in New Issue
Block a user