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.

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