Commit 928002a5 authored by Arun Kumar Neelakantam's avatar Arun Kumar Neelakantam Committed by Bjorn Andersson

rpmsg: glink: smem: Support rx peak for size less than 4 bytes

The current rx peak function fails to read the data if size is
less than 4bytes.

Use memcpy_fromio to support data reads of size less than 4 bytes.

Cc: stable@vger.kernel.org
Fixes: f0beb4ba ("rpmsg: glink: Remove chunk size word align warning")
Signed-off-by: default avatarArun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 940c620d
...@@ -89,15 +89,11 @@ static void glink_smem_rx_peak(struct qcom_glink_pipe *np, ...@@ -89,15 +89,11 @@ static void glink_smem_rx_peak(struct qcom_glink_pipe *np,
tail -= pipe->native.length; tail -= pipe->native.length;
len = min_t(size_t, count, pipe->native.length - tail); len = min_t(size_t, count, pipe->native.length - tail);
if (len) { if (len)
__ioread32_copy(data, pipe->fifo + tail, memcpy_fromio(data, pipe->fifo + tail, len);
len / sizeof(u32));
}
if (len != count) { if (len != count)
__ioread32_copy(data + len, pipe->fifo, memcpy_fromio(data + len, pipe->fifo, (count - len));
(count - len) / sizeof(u32));
}
} }
static void glink_smem_rx_advance(struct qcom_glink_pipe *np, static void glink_smem_rx_advance(struct qcom_glink_pipe *np,
......
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