aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2007-06-15 17:17:32 -0400
committerPaul Mackerras <paulus@samba.org>2007-06-28 05:16:32 -0400
commit6deac06612d2935b917550db2bc8a8b3f7c7aeb5 (patch)
tree6b239b8566474cfa6c8d510c3a4f5b4a76c629cb
parentb7abc5c53e3c65b8e931bd96db2d08ba670e111a (diff)
[POWERPC] cell: Add spu shutdown method
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: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index a7f5a7653c62..cadcc64a8657 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -462,8 +462,18 @@ void spu_free(struct spu *spu)
462} 462}
463EXPORT_SYMBOL_GPL(spu_free); 463EXPORT_SYMBOL_GPL(spu_free);
464 464
465static int spu_shutdown(struct sys_device *sysdev)
466{
467 struct spu *spu = container_of(sysdev, struct spu, sysdev);
468
469 spu_free_irqs(spu);
470 spu_destroy_spu(spu);
471 return 0;
472}
473
465struct sysdev_class spu_sysdev_class = { 474struct sysdev_class spu_sysdev_class = {
466 set_kset_name("spu") 475 set_kset_name("spu"),
476 .shutdown = spu_shutdown,
467}; 477};
468 478
469int spu_add_sysdev_attr(struct sysdev_attribute *attr) 479int spu_add_sysdev_attr(struct sysdev_attribute *attr)