net: ipa: skip some cleanup for unused transactions
authorAlex Elder <elder@linaro.org>
Tue, 19 Jul 2022 18:10:18 +0000 (13:10 -0500)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 Jul 2022 04:04:36 +0000 (21:04 -0700)
In gsi_trans_free(), there's no point in ipa_gsi_trans_release() if
a transaction is unused.  No used TREs means no IPA layer resources
to clean up.  So only call ipa_gsi_trans_release() if at least one
TRE was used.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/gsi_trans.c

index 3f52932..55987e3 100644 (file)
@@ -404,7 +404,8 @@ void gsi_trans_free(struct gsi_trans *trans)
        if (!last)
                return;
 
-       ipa_gsi_trans_release(trans);
+       if (trans->used_count)
+               ipa_gsi_trans_release(trans);
 
        /* Releasing the reserved TREs implicitly frees the sgl[] and
         * (if present) info[] arrays, plus the transaction itself.