[Cbe-oss-dev] [RFC] Cell: shutdown method for spu_sysdev_class

Geoff Levand geoffrey.levand at am.sony.com
Sun May 6 09:58:39 EST 2007


Add a shutdown method to spu_sysdev_class to allow proper spu resource
cleanup on system shutdown.  This is needed to support kexec on the PS3
platform.

Signed-off-by: Geoff Levand <geoffrey.levand at am.sony.com>

---

Arnd, I found I needed this to clean up the HV resources
during a kexec shutdown.  spu_destroy_spu() then calls
spu_management_ops->destroy_spu().


 arch/powerpc/platforms/cell/spu_base.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

--- ps3-linux-dev.orig/arch/powerpc/platforms/cell/spu_base.c
+++ ps3-linux-dev/arch/powerpc/platforms/cell/spu_base.c
@@ -463,8 +463,21 @@ void spu_free(struct spu *spu)
 }
 EXPORT_SYMBOL_GPL(spu_free);
 
+static int spu_shutdown(struct sys_device *sysdev)
+{
+	struct spu *spu = container_of(sysdev, struct spu, sysdev);
+
+	// what else here???
+
+	spu_free_irqs(spu);
+	spu_destroy_spu(spu);
+	kfree(spu);
+	return 0;
+}
+
 struct sysdev_class spu_sysdev_class = {
-	set_kset_name("spu")
+	set_kset_name("spu"),
+	.shutdown = spu_shutdown,
 };
 
 int spu_add_sysdev_attr(struct sysdev_attribute *attr)




More information about the cbe-oss-dev mailing list