From: Sudeep Holla Date: Fri, 8 May 2026 17:54:18 +0000 (+0100) Subject: firmware: arm_ffa: Defer probe until pKVM is initialized X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3acc80a78e45246a87061cbdd46775baa132de83;p=thirdparty%2Fkernel%2Flinux.git firmware: arm_ffa: Defer probe until pKVM is initialized When protected KVM is enabled, the kernel includes a pKVM FF-A proxy that sits in front of the normal FF-A driver. The proxy has to perform its own FF-A version negotiation and setup first, so that it can mediate subsequent FF-A traffic correctly. Defer FF-A core probing until pKVM has completed initialization. This keeps the normal driver from negotiating the FF-A version or performing other transport setup before the pKVM proxy is ready, and lets the driver model retry probing once the protected KVM state required by the FF-A transport is available. Suggested-by: Yeoreum Yun Reviewed-by: Yeoreum Yun Link: https://patch.msgid.link/20260508-b4-ffa_plat_dev-v1-4-c5a30f8cf7b8@kernel.org Signed-off-by: Sudeep Holla --- diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index 4bb6b13849783..fb97b01c282aa 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -43,6 +43,8 @@ #include #include +#include + #include "common.h" #define FFA_DRIVER_VERSION FFA_VERSION_1_2 @@ -2096,6 +2098,10 @@ static int ffa_probe(struct platform_device *pdev) u32 buf_sz; size_t rxtx_bufsz = SZ_4K; + if (IS_BUILTIN(CONFIG_ARM_FFA_TRANSPORT) && + is_protected_kvm_enabled() && !is_pkvm_initialized()) + return -EPROBE_DEFER; + ret = ffa_transport_init(&invoke_ffa_fn); if (ret) return ret;