firmware: arm_ffa: Tear down driver during shutdown
Sudeep Holla
maintainerPATCH 1/1 firmware: arm_ffa: Tear down driver during shutdown
The platform core invokes a driver's shutdown callback, rather than its remove callback, while preparing devices for a normal kexec. Without a shutdown callback, the FF-A driver leaves notifications, partition devices, and the RX/TX mapping active before the replacement kernel is booted.
Use ffa_remove() for shutdown so the existing cleanup runs before a normal kexec and other orderly system shutdowns.
--- drivers/firmware/arm_ffa/driver.c | 1 + 1 file changed, 1 insertion(+)
drivers/firmware/arm_ffa/driver.c +1 -0
@@ -2271,6 +2271,7 @@ static void ffa_remove(struct platform_device *pdev)static struct platform_driver ffa_driver = { .probe = ffa_probe, .remove = ffa_remove, + .shutdown = ffa_remove, .driver = { .name =FFA_PLATFORM_NAME , },
Signature · 1 line
2.43.0
Quoted 24 lines · Sudeep Holla
The platform core invokes a driver's shutdown callback, rather than its remove callback, while preparing devices for a normal kexec. Without a shutdown callback, the FF-A driver leaves notifications, partition devices, and the RX/TX mapping active before the replacement kernel is booted.
Use
ffa_remove()for shutdown so the existing cleanup runs before a normal kexec and other orderly system shutdowns.Reported-by Nat Gurumoorthy <[email protected]>Reported-by Carol L Soto <[email protected]>Reported-by Maxi Saparov <[email protected]>Signed-off-by Sudeep Holla <[email protected]>--- drivers/firmware/arm_ffa/driver.c | 1 + 1 file changed, 1 insertion(+)drivers/firmware/arm_ffa/driver.c +0
-0
drivers/firmware/arm_ffa/driver.c static void ffa_remove(struct platform_device *pdev) · line 2277
Quoted 7 lines
drivers/firmware/arm_ffa/driver.c +1
-0@@ -2271,6 +2271,7 @@ static void ffa_remove(struct platform_device *pdev)static struct platform_driver ffa_driver = { .probe = ffa_probe, .remove = ffa_remove, + .shutdown = ffa_remove, .driver = { .name =FFA_PLATFORM_NAME , },
Thanks, I tested this solution and it works for me.
Quoted 9 lines · Sudeep Holla
The platform core invokes a driver's shutdown callback, rather than its remove callback, while preparing devices for a normal kexec. Without a shutdown callback, the FF-A driver leaves notifications, partition devices, and the RX/TX mapping active before the replacement kernel is booted.
Use
ffa_remove()for shutdown so the existing cleanup runs before a normal kexec and other orderly system shutdowns.[...]
Applied to sudeep.holla/linux (for-next/ffa/fixes), thanks!
[1/1] firmware: arm_ffa: Tear down driver during shutdown
https://git.kernel.org/sudeep.holla/c/3bb3e80faf21
Signature · 2 lines
Regards, Sudeep