Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* firmware: arm_ffa: Align RxTx buffer size before mapping
@ 2026-06-01  9:29 Gyokhan Kochmarla
  2026-06-01  9:41 ` Sudeep Holla
  0 siblings, 1 reply; 2+ messages in thread
From: Gyokhan Kochmarla @ 2026-06-01  9:29 UTC (permalink / raw)
  To: stable
  Cc: gregkh, sudeep.holla, sebastianene, linux-arm-kernel,
	Sudeep Holla, Gyokhan Kochmarla

From: Sudeep Holla <sudeep.holla@kernel.org>

commit 0399e3f872ca3d78044bb715a73ea645806d2c7b upstream.

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.

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

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
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>
Signed-off-by: Gyokhan Kochmarla <gyokhan@amazon.de>

diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -2059,6 +2059,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) {
@@ -2074,7 +2075,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;



Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christof Hellmis, Andreas Stieger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: firmware: arm_ffa: Align RxTx buffer size before mapping
  2026-06-01  9:29 firmware: arm_ffa: Align RxTx buffer size before mapping Gyokhan Kochmarla
@ 2026-06-01  9:41 ` Sudeep Holla
  0 siblings, 0 replies; 2+ messages in thread
From: Sudeep Holla @ 2026-06-01  9:41 UTC (permalink / raw)
  To: Gyokhan Kochmarla
  Cc: stable, gregkh, Sudeep Holla, sebastianene, linux-arm-kernel

On Mon, Jun 01, 2026 at 09:29:18AM +0000, Gyokhan Kochmarla wrote:
> From: Sudeep Holla <sudeep.holla@kernel.org>
> 
> commit 0399e3f872ca3d78044bb715a73ea645806d2c7b upstream.
> 
> 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.
> 
> Align the size before storing it so that the allocation, validation and
> FFA_RXTX_MAP all use the same buffer size.
> 
> Fixes: 83210251fd70 ("firmware: arm_ffa: Use the correct buffer size during RXTX_MAP")

Because of the fixes tag, it was already backported/queued to v7.0, v6.18
and v6.12. May I ask what was the intention of posting ?

-- 
Regards,
Sudeep


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-01  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-01  9:29 firmware: arm_ffa: Align RxTx buffer size before mapping Gyokhan Kochmarla
2026-06-01  9:41 ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox