Subject: Re: [PATCH 3/8] firmware: arm_ffa: Align RxTx buffer size before mapping

From: Sebastian Ene <[email-masked]>
Date: Mon, 27 Apr 2026 09:30:17 +0000

On Thu, Apr 23, 2026 at 06:22:53PM +0100, Sudeep Holla wrote:
> Commit 83210251fd70 ("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.

Hello Sudeep,

> 
> Align the size before storing it so that the allocation, validation and
> FFA_RXTX_MAP all use the same buffer size.
> 

Thanks for fixing this,
Reviewed-by: Sebastian Ene <[email-masked]>.

> Fixes: 83210251fd70 ("firmware: arm_ffa: Use the correct buffer size during RXTX_MAP")
> Cc: Sebastian Ene <[email-masked]>
> Link: https://sashiko.dev/#/patchset/[email-masked]
> Signed-off-by: Sudeep Holla <[email-masked]>
> ---
>  drivers/firmware/arm_ffa/driver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
> index e6a051b20cb7..4dec7ca52f8c 100644
> --- a/drivers/firmware/arm_ffa/driver.c
> +++ b/drivers/firmware/arm_ffa/driver.c
> @@ -2063,6 +2063,7 @@ static int __init ffa_init(void)
>  			rxtx_bufsz = SZ_4K;
>  	}
>  
> +	rxtx_bufsz = PAGE_ALIGN(rxtx_bufsz);
>  	drv_info->rxtx_bufsz = rxtx_bufsz;
>  	drv_info->rx_buffer = alloc_pages_exact(rxtx_bufsz, GFP_KERNEL);
>  	if (!drv_info->rx_buffer) {
> @@ -2078,7 +2079,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),
> -			   PAGE_ALIGN(rxtx_bufsz) / FFA_PAGE_SIZE);
> +			   rxtx_bufsz / FFA_PAGE_SIZE);
>  	if (ret) {
>  		pr_err("failed to register FFA RxTx buffers\n");
>  		goto free_pages;
> 
> -- 
> 2.43.0
>