public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Sebastian Ene <sebastianene@google.com>
To: Sudeep Holla <sudeep.holla@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Jens Wiklander <jens.wiklander@linaro.org>
Subject: Re: [PATCH 3/8] firmware: arm_ffa: Align RxTx buffer size before mapping
Date: Mon, 27 Apr 2026 09:30:17 +0000	[thread overview]
Message-ID: <ae8sqehR7yQFheuj@google.com> (raw)
In-Reply-To: <20260423-ffa_fixes-v1-3-61189661affe@kernel.org>

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 <sebastianene@google.com>.

> Fixes: 83210251fd70 ("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
> Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
> ---
>  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
> 


  reply	other threads:[~2026-04-27  9:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 17:22 [PATCH 0/8] firmware: arm_ffa: Fix cleanup, notification, and discovery paths Sudeep Holla
2026-04-23 17:22 ` [PATCH 1/8] firmware: arm_ffa: Check for NULL FF-A ID table while driver registration Sudeep Holla
2026-04-23 17:22 ` [PATCH 2/8] firmware: arm_ffa: Skip free_pages on RX buffer alloc failure Sudeep Holla
2026-04-23 17:22 ` [PATCH 3/8] firmware: arm_ffa: Align RxTx buffer size before mapping Sudeep Holla
2026-04-27  9:30   ` Sebastian Ene [this message]
2026-04-27 12:42     ` Sudeep Holla
2026-04-23 17:22 ` [PATCH 4/8] firmware: arm_ffa: Fix Rx buffer release in fwk notification handler Sudeep Holla
2026-04-23 17:22 ` [PATCH 5/8] firmware: arm_ffa: Validate framework notification payload bounds Sudeep Holla
2026-04-23 17:22 ` [PATCH 6/8] firmware: arm_ffa: Unregister v1.0 bus notifier on teardown Sudeep Holla
2026-04-23 17:22 ` [PATCH 7/8] firmware: arm_ffa: Fix sched-recv callback partition lookup Sudeep Holla
2026-04-23 17:22 ` [PATCH 8/8] firmware: arm_ffa: Bound PARTITION_INFO_GET_REGS copies Sudeep Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae8sqehR7yQFheuj@google.com \
    --to=sebastianene@google.com \
    --cc=jens.wiklander@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudeep.holla@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox