Skip to content

Commit

Permalink
remoteproc: mediatek: Zero out only remaining bytes of IPI buffer
Browse files Browse the repository at this point in the history
[ Upstream commit 9dbd996 ]

In scp_ipi_handler(), instead of zeroing out the entire shared
buffer, which may be as large as 600 bytes, overwrite it with the
received data, then zero out only the remaining bytes.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mathieu Poirier <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
AngeloGioacchino Del Regno authored and gregkh committed Sep 8, 2024
1 parent e965c63 commit bb65c7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/remoteproc/mtk_scp.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ static void scp_ipi_handler(struct mtk_scp *scp)
return;
}

memset(scp->share_buf, 0, scp_sizes->ipi_share_buffer_size);
memcpy_fromio(scp->share_buf, &rcv_obj->share_buf, len);
memset(&scp->share_buf[len], 0, scp_sizes->ipi_share_buffer_size - len);
handler(scp->share_buf, len, ipi_desc[id].priv);
scp_ipi_unlock(scp, id);

Expand Down

0 comments on commit bb65c7b

Please sign in to comment.