net: ipa: simplify endpoint transaction completion
authorAlex Elder <elder@linaro.org>
Fri, 10 Jun 2022 15:46:13 +0000 (10:46 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Jun 2022 11:01:58 +0000 (12:01 +0100)
When a GSI transaction completes, ipa_endpoint_trans_complete() is
eventually called.  That handles TX and RX completions separately,
but ipa_endpoint_tx_complete() is a no-op.

Instead, have ipa_endpoint_trans_complete() return immediately for a
TX transaction, and incorporate code from ipa_endpoint_rx_complete()
to handle RX 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 86ef91f83eb6841e54d2c92ccef121fbcfbd4112..66d2bfdf9e423e1c89c27a449db90ba5cd0d5181 100644 (file)
@@ -1368,18 +1368,14 @@ static void ipa_endpoint_status_parse(struct ipa_endpoint *endpoint,
        }
 }
 
-/* Complete a TX transaction, command or from ipa_endpoint_skb_tx() */
-static void ipa_endpoint_tx_complete(struct ipa_endpoint *endpoint,
-                                    struct gsi_trans *trans)
-{
-}
-
-/* Complete transaction initiated in ipa_endpoint_replenish_one() */
-static void ipa_endpoint_rx_complete(struct ipa_endpoint *endpoint,
-                                    struct gsi_trans *trans)
+void ipa_endpoint_trans_complete(struct ipa_endpoint *endpoint,
+                                struct gsi_trans *trans)
 {
        struct page *page;
 
+       if (endpoint->toward_ipa)
+               return;
+
        if (trans->cancelled)
                goto done;
 
@@ -1393,15 +1389,6 @@ done:
        ipa_endpoint_replenish(endpoint);
 }
 
-void ipa_endpoint_trans_complete(struct ipa_endpoint *endpoint,
-                                struct gsi_trans *trans)
-{
-       if (endpoint->toward_ipa)
-               ipa_endpoint_tx_complete(endpoint, trans);
-       else
-               ipa_endpoint_rx_complete(endpoint, trans);
-}
-
 void ipa_endpoint_trans_release(struct ipa_endpoint *endpoint,
                                struct gsi_trans *trans)
 {