Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfc6c5e8 authored by Jeff Hugo's avatar Jeff Hugo
Browse files

soc: qcom: glink_smem_native_xprt: Fake tx_done for intentless



Intentless transports do not support the tx_done command over the wire, but
the core still expects a tx_done signal.  The core may leak memory if this
signal is not generated.

Fake the tx_done signal when needed to meet the core's expectations.

Change-Id: Ia16bffb0065e63850c790ca85075bde9ee43566c
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
parent 3e5d75b2
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -2678,6 +2678,7 @@ static int glink_tx_common(void *handle, void *pkt_priv,
	tx_info->pkt_priv = pkt_priv;
	tx_info->pkt_priv = pkt_priv;
	tx_info->data = data;
	tx_info->data = data;
	tx_info->riid = riid;
	tx_info->riid = riid;
	tx_info->rcid = ctx->rcid;
	tx_info->size = size;
	tx_info->size = size;
	tx_info->size_remaining = size;
	tx_info->size_remaining = size;
	tx_info->tracer_pkt = tx_flags & GLINK_TX_TRACER_PKT ? true : false;
	tx_info->tracer_pkt = tx_flags & GLINK_TX_TRACER_PKT ? true : false;
+9 −0
Original line number Original line Diff line number Diff line
@@ -1892,6 +1892,15 @@ static int tx_data(struct glink_transport_if *if_ptr, uint16_t cmd_id,
		cmd.size_left);
		cmd.size_left);
	spin_unlock_irqrestore(&einfo->write_lock, flags);
	spin_unlock_irqrestore(&einfo->write_lock, flags);


	/* Fake tx_done for intentless since its not supported over the wire */
	if (einfo->intentless) {
		spin_lock_irqsave(&einfo->rx_lock, flags);
		cmd.id = RX_DONE_CMD;
		cmd.lcid = pctx->rcid;
		queue_cmd(einfo, &cmd, NULL);
		spin_unlock_irqrestore(&einfo->rx_lock, flags);
	}

	srcu_read_unlock(&einfo->use_ref, rcu_id);
	srcu_read_unlock(&einfo->use_ref, rcu_id);
	return cmd.size;
	return cmd.size;
}
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -46,6 +46,7 @@ enum xprt_ids {
 * @pkt_priv:		Private information specific to the packet.
 * @pkt_priv:		Private information specific to the packet.
 * @data:		Pointer to the buffer containing the data.
 * @data:		Pointer to the buffer containing the data.
 * @riid:		Remote receive intent used to transmit the packet.
 * @riid:		Remote receive intent used to transmit the packet.
 * @rcid:		Remote channel receiving the packet.
 * @size:		Total size of the data in the packet.
 * @size:		Total size of the data in the packet.
 * @tx_len:		Data length to transmit in the current transmit slot.
 * @tx_len:		Data length to transmit in the current transmit slot.
 * @size_remaining:	Remaining size of the data in the packet.
 * @size_remaining:	Remaining size of the data in the packet.
@@ -61,6 +62,7 @@ struct glink_core_tx_pkt {
	const void *pkt_priv;
	const void *pkt_priv;
	const void *data;
	const void *data;
	uint32_t riid;
	uint32_t riid;
	uint32_t rcid;
	uint32_t size;
	uint32_t size;
	uint32_t tx_len;
	uint32_t tx_len;
	uint32_t size_remaining;
	uint32_t size_remaining;