]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: arm_ffa: Use the correct buffer size during RXTX_MAP
authorSebastian Ene <sebastianene@google.com>
Thu, 2 Apr 2026 11:39:39 +0000 (11:39 +0000)
committerSudeep Holla <sudeep.holla@kernel.org>
Tue, 7 Apr 2026 09:47:42 +0000 (10:47 +0100)
Don't use the discovered buffer size from an FFA_FEATURES call directly
since we can run on a system that has the PAGE_SIZE larger than the
returned size which makes the alloc_pages_exact for the buffer to be
rounded up.

Fixes: 61824feae5c0 ("firmware: arm_ffa: Fetch the Rx/Tx buffer size using ffa_features()")
Signed-off-by: Sebastian Ene <sebastianene@google.com>
Link: https://patch.msgid.link/20260402113939.930221-1-sebastianene@google.com
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
drivers/firmware/arm_ffa/driver.c

index 12a625387d6e6ba3e870d86276f81cfcaf979b93..83b8b47938b25dfc09e94912821ff1ff6ccd471b 100644 (file)
@@ -2078,7 +2078,7 @@ static int __init ffa_init(void)
 
        ret = ffa_rxtx_map(virt_to_phys(drv_info->tx_buffer),
                           virt_to_phys(drv_info->rx_buffer),
-                          rxtx_bufsz / FFA_PAGE_SIZE);
+                          PAGE_ALIGN(rxtx_bufsz) / FFA_PAGE_SIZE);
        if (ret) {
                pr_err("failed to register FFA RxTx buffers\n");
                goto free_pages;