net: ipa: prevent concurrent replenish
authorAlex Elder <elder@linaro.org>
Wed, 12 Jan 2022 13:30:12 +0000 (07:30 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Feb 2022 11:38:56 +0000 (12:38 +0100)
commitdffeeca9268b221063c7a5a75719299b324c1acf
treeb71889d97df067fa420e475fda2dd39509cde120
parent5f4ed9829617466fd960c25a4d34f19a912911c4
net: ipa: prevent concurrent replenish

commit 998c0bd2b3715244da7639cc4e6a2062cb79c3f4 upstream.

We have seen cases where an endpoint RX completion interrupt arrives
while replenishing for the endpoint is underway.  This causes another
instance of replenishing to begin as part of completing the receive
transaction.  If this occurs it can lead to transaction corruption.

Use a new flag to ensure only one replenish instance for an endpoint
executes at a time.

Fixes: 84f9bd12d46db ("soc: qcom: ipa: IPA endpoints")
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/ipa_endpoint.c
drivers/net/ipa/ipa_endpoint.h