Skip to content

Commit 0399e3f

Browse files
author
Sudeep Holla
committed
firmware: arm_ffa: Align RxTx buffer size before mapping
Commit 8321025 ("firmware: arm_ffa: Use the correct buffer size during RXTX_MAP") advertises PAGE_ALIGN(rxtx_bufsz) to firmware when mapping the buffers but the driver continues to stores the minimum FF-A buffer size in drv_info->rxtx_bufsz which is used elsewhere in the driver. Align the size before storing it so that the allocation, validation and FFA_RXTX_MAP all use the same buffer size. Fixes: 8321025 ("firmware: arm_ffa: Use the correct buffer size during RXTX_MAP") Cc: Sebastian Ene <sebastianene@google.com> Link: https://sashiko.dev/#/patchset/20260402113939.930221-1-sebastianene@google.com Reviewed-by: Sebastian Ene <sebastianene@google.com> Link: https://patch.msgid.link/20260428-ffa_fixes-v2-9-8595ae450034@kernel.org Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
1 parent 4a1cc9e commit 0399e3f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/firmware/arm_ffa/driver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2109,6 +2109,7 @@ static int __init ffa_init(void)
21092109
rxtx_bufsz = SZ_4K;
21102110
}
21112111

2112+
rxtx_bufsz = PAGE_ALIGN(rxtx_bufsz);
21122113
drv_info->rxtx_bufsz = rxtx_bufsz;
21132114
drv_info->rx_buffer = alloc_pages_exact(rxtx_bufsz, GFP_KERNEL);
21142115
if (!drv_info->rx_buffer) {
@@ -2124,7 +2125,7 @@ static int __init ffa_init(void)
21242125

21252126
ret = ffa_rxtx_map(virt_to_phys(drv_info->tx_buffer),
21262127
virt_to_phys(drv_info->rx_buffer),
2127-
PAGE_ALIGN(rxtx_bufsz) / FFA_PAGE_SIZE);
2128+
rxtx_bufsz / FFA_PAGE_SIZE);
21282129
if (ret) {
21292130
pr_err("failed to register FFA RxTx buffers\n");
21302131
goto free_pages;

0 commit comments

Comments
 (0)