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

Commit 65fbc359 authored by Deepak Kumar Singh's avatar Deepak Kumar Singh Committed by Gerrit - the friendly Code Review server
Browse files

rpmsg: glink: reset read/write index after ssr



While system is going down fifo index are not reset which can
cause remote subsystem to read stale index.

Now resetting the index while system is going down.

CRs-Fixed: 2543040
Change-Id: Icb4010c120f4735da206a44a4eb1bcf06ae0a1b7
Signed-off-by: default avatarDeepak Kumar Singh <deesin@codeaurora.org>
parent aa7030af
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -47,6 +47,12 @@ struct glink_smem_pipe {

#define to_smem_pipe(p) container_of(p, struct glink_smem_pipe, native)

static void glink_smem_rx_reset(struct qcom_glink_pipe *np)
{
	struct glink_smem_pipe *pipe = to_smem_pipe(np);
	*pipe->tail = 0;
}

static size_t glink_smem_rx_avail(struct qcom_glink_pipe *np)
{
	struct glink_smem_pipe *pipe = to_smem_pipe(np);
@@ -123,6 +129,12 @@ static void glink_smem_rx_advance(struct qcom_glink_pipe *np,
	*pipe->tail = cpu_to_le32(tail);
}

static void glink_smem_tx_reset(struct qcom_glink_pipe *np)
{
	struct glink_smem_pipe *pipe = to_smem_pipe(np);
	*pipe->head = 0;
}

static size_t glink_smem_tx_avail(struct qcom_glink_pipe *np)
{
	struct glink_smem_pipe *pipe = to_smem_pipe(np);
@@ -282,11 +294,13 @@ struct qcom_glink *qcom_glink_smem_register(struct device *parent,
		goto err_put_dev;
	}

	rx_pipe->native.reset = glink_smem_rx_reset;
	rx_pipe->native.avail = glink_smem_rx_avail;
	rx_pipe->native.peak = glink_smem_rx_peak;
	rx_pipe->native.advance = glink_smem_rx_advance;
	rx_pipe->remote_pid = remote_pid;

	tx_pipe->native.reset = glink_smem_tx_reset;
	tx_pipe->native.avail = glink_smem_tx_avail;
	tx_pipe->native.write = glink_smem_tx_write;
	tx_pipe->remote_pid = remote_pid;