diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2007-06-16 07:17:32 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-06-28 19:16:32 +1000 |
commit | 6deac06612d2935b917550db2bc8a8b3f7c7aeb5 (patch) | |
tree | 6b239b8566474cfa6c8d510c3a4f5b4a76c629cb /arch/powerpc/platforms/cell/spu_base.c | |
parent | b7abc5c53e3c65b8e931bd96db2d08ba670e111a (diff) | |
download | linux-6deac06612d2935b917550db2bc8a8b3f7c7aeb5.tar.gz linux-6deac06612d2935b917550db2bc8a8b3f7c7aeb5.tar.bz2 linux-6deac06612d2935b917550db2bc8a8b3f7c7aeb5.zip |
[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>
Diffstat (limited to 'arch/powerpc/platforms/cell/spu_base.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 12 |
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) } EXPORT_SYMBOL_GPL(spu_free); +static int spu_shutdown(struct sys_device *sysdev) +{ + struct spu *spu = container_of(sysdev, struct spu, sysdev); + + spu_free_irqs(spu); + spu_destroy_spu(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) |