mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
rpmsg: glink: smem: Support rx peak for size less than 4 bytes
[ Upstream commit928002a5e9
] 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:f0beb4ba9b
("rpmsg: glink: Remove chunk size word align warning") Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ec9fc981de
commit
674b223d7a
1 changed files with 4 additions and 8 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue