net: ipa: don't use replenish_backlog
authorAlex Elder <elder@linaro.org>
Thu, 3 Feb 2022 17:09:23 +0000 (11:09 -0600)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Feb 2022 10:16:08 +0000 (10:16 +0000)
Rather than determining when to stop replenishing using the
replenish backlog, just stop when we have exhausted all available
transactions.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_endpoint.c

index f5367b9..fba8728 100644 (file)
@@ -1087,11 +1087,8 @@ static void ipa_endpoint_replenish(struct ipa_endpoint *endpoint)
        if (test_and_set_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags))
                return;
 
-       while (atomic_dec_not_zero(&endpoint->replenish_backlog)) {
-               trans = ipa_endpoint_trans_alloc(endpoint, 1);
-               if (!trans)
-                       break;
-
+       while ((trans = ipa_endpoint_trans_alloc(endpoint, 1))) {
+               WARN_ON(!atomic_dec_not_zero(&endpoint->replenish_backlog));
                if (ipa_endpoint_replenish_one(endpoint, trans))
                        goto try_again_later;