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:37:55 +0000 (12:37 +0100)
commit42fdbf8b7dab0328554899455a5b0a58526f8a63
treeae18b88dc960319111990c3a23300f17dbea4a45
parentad81380d3a48f0d2f39ce5188d383897276c9c37
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