From: Alex Elder <elder@linaro.org>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: mka@chromium.org, evgreen@chromium.org,
bjorn.andersson@linaro.org, quic_cpratapa@quicinc.com,
quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com,
quic_subashab@quicinc.com, elder@kernel.org,
netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next 1/7] net: ipa: drop an unneeded transaction reference
Date: Thu, 19 May 2022 10:12:11 -0500 [thread overview]
Message-ID: <20220519151217.654890-2-elder@linaro.org> (raw)
In-Reply-To: <20220519151217.654890-1-elder@linaro.org>
In gsi_channel_update(), a reference count is taken on the last
completed transaction "to keep it from completing" before we give
the event back to the hardware. Completion processing for that
transaction (and any other "new" ones) will not occur until after
this function returns, so there's no risk it completing early. So
there's no need to take and drop the additional transaction
reference.
Use local variables in the call to gsi_evt_ring_doorbell().
Signed-off-by: Alex Elder <elder@linaro.org>
---
drivers/net/ipa/gsi.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index db4cb2de218c0..5eb30113974cd 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -1490,12 +1490,8 @@ static struct gsi_trans *gsi_channel_update(struct gsi_channel *channel)
if (index == ring->index % ring->count)
return NULL;
- /* Get the transaction for the latest completed event. Take a
- * reference to keep it from completing before we give the events
- * for this and previous transactions back to the hardware.
- */
+ /* Get the transaction for the latest completed event. */
trans = gsi_event_trans(channel, gsi_ring_virt(ring, index - 1));
- refcount_inc(&trans->refcount);
/* For RX channels, update each completed transaction with the number
* of bytes that were actually received. For TX channels, report
@@ -1510,9 +1506,7 @@ static struct gsi_trans *gsi_channel_update(struct gsi_channel *channel)
gsi_trans_move_complete(trans);
/* Tell the hardware we've handled these events */
- gsi_evt_ring_doorbell(channel->gsi, channel->evt_ring_id, index);
-
- gsi_trans_free(trans);
+ gsi_evt_ring_doorbell(gsi, evt_ring_id, index);
return gsi_channel_trans_complete(channel);
}
--
2.32.0
next prev parent reply other threads:[~2022-05-19 15:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-19 15:12 [PATCH net-next 0/7] net: ipa: a mix of patches Alex Elder
2022-05-19 15:12 ` Alex Elder [this message]
2022-05-19 15:12 ` [PATCH net-next 2/7] net: ipa: rename a GSI error code Alex Elder
2022-05-19 15:12 ` [PATCH net-next 3/7] net: ipa: ignore endianness if there is no header Alex Elder
2022-05-19 15:12 ` [PATCH net-next 4/7] net: ipa: open-code ether_setup() Alex Elder
2022-05-19 15:12 ` [PATCH net-next 5/7] net: ipa: move endpoint configuration data definitions Alex Elder
2022-05-19 15:12 ` [PATCH net-next 6/7] net: ipa: rename a few endpoint config data types Alex Elder
2022-05-19 15:12 ` [PATCH net-next 7/7] net: ipa: save a copy of endpoint default config Alex Elder
2022-05-20 10:40 ` [PATCH net-next 0/7] net: ipa: a mix of patches patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220519151217.654890-2-elder@linaro.org \
--to=elder@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=elder@kernel.org \
--cc=evgreen@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mka@chromium.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_avuyyuru@quicinc.com \
--cc=quic_cpratapa@quicinc.com \
--cc=quic_jponduru@quicinc.com \
--cc=quic_subashab@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®