[PATCH] firmware: arm_ffa: Unmap RxTx buffers on device shutdown
From: Maxi Saparov
Date: Wed Aug 26 2026 - 18:24:55 EST
From: Maxi Saparov <masaparov@xxxxxxxxxxxxx>
The SPMC retains the RxTx buffer registration of the current kernel
across kexec. FFA_RXTX_MAP from the kexec'ed kernel is then denied
because the buffers of the previous kernel are still registered, and
the driver fails to probe:
ARM FF-A: Driver version 1.2
ARM FF-A: Firmware version 1.1 found
ARM FF-A: failed to register FFA RxTx buffers
The notification bitmap, when one was created, is retained in the
same way and a later FFA_NOTIFICATION_BITMAP_CREATE is denied.
Add a shutdown callback that releases the notification resources and
unmaps the RxTx buffers. device_shutdown() runs on the kexec path, so
the next kernel finds the SPMC in a clean state and can register its
own buffers. On a regular reboot or power off the extra teardown is
harmless.
Observed on NVIDIA GB200 systems when kexec'ing between kernels with
the FF-A driver active.
Signed-off-by: Maxi Saparov <masaparov@xxxxxxxxxxxxx>
---
drivers/firmware/arm_ffa/driver.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index 8654b3365c9b..04948be13b08 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -2222,9 +2222,16 @@ static void ffa_remove(struct platform_device *pdev)
drv_info = NULL;
}
+static void ffa_shutdown(struct platform_device *pdev)
+{
+ ffa_notifications_cleanup();
+ ffa_rxtx_unmap();
+}
+
static struct platform_driver ffa_driver = {
.probe = ffa_probe,
.remove = ffa_remove,
+ .shutdown = ffa_shutdown,
.driver = {
.name = FFA_PLATFORM_NAME,
},
base-commit: 3b5f4b83c4abc0c9b0a7b9e2b44e816611b7f2ec
--
2.55.0