Skip to contentSkip to conversation

firmware: arm_ffa: Tear down driver during shutdown

PATCH Applied Sudeep Holla 2 participants 3 messages Sep 1 – Sep 4 Firmware framework for ARMV8-a

lore
Share & tools
lore

Sudeep Holla

author maintainer
#0 lore raw

PATCH 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
index 0121bd0a7e01..7f42ffe79f22 100644
@@ -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
Tested-by on v1 1/1
#1 lore raw
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.

---
  drivers/firmware/arm_ffa/driver.c | 1 +
  1 file changed, 1 insertion(+)
drivers/firmware/arm_ffa/driver.c +0 -0
index 0121bd0a7e01..7f42ffe79f22 100644

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.

author maintainer Applied
#2 lore raw
In reply to Sudeep Holla
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