Commit c15f950d authored by Alex Elder's avatar Alex Elder Committed by David S. Miller

net: ipa: drop an unneeded transaction reference

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: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 805cb5aa
...@@ -1492,12 +1492,8 @@ static struct gsi_trans *gsi_channel_update(struct gsi_channel *channel) ...@@ -1492,12 +1492,8 @@ static struct gsi_trans *gsi_channel_update(struct gsi_channel *channel)
if (index == ring->index % ring->count) if (index == ring->index % ring->count)
return NULL; return NULL;
/* Get the transaction for the latest completed event. Take a /* Get the transaction for the latest completed event. */
* reference to keep it from completing before we give the events
* for this and previous transactions back to the hardware.
*/
trans = gsi_event_trans(channel, gsi_ring_virt(ring, index - 1)); 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 /* For RX channels, update each completed transaction with the number
* of bytes that were actually received. For TX channels, report * of bytes that were actually received. For TX channels, report
...@@ -1512,9 +1508,7 @@ static struct gsi_trans *gsi_channel_update(struct gsi_channel *channel) ...@@ -1512,9 +1508,7 @@ static struct gsi_trans *gsi_channel_update(struct gsi_channel *channel)
gsi_trans_move_complete(trans); gsi_trans_move_complete(trans);
/* Tell the hardware we've handled these events */ /* Tell the hardware we've handled these events */
gsi_evt_ring_doorbell(channel->gsi, channel->evt_ring_id, index); gsi_evt_ring_doorbell(gsi, evt_ring_id, index);
gsi_trans_free(trans);
return gsi_channel_trans_complete(channel); return gsi_channel_trans_complete(channel);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment