From: Geoff Levand Date: Fri, 15 Jun 2007 21:17:32 +0000 (+1000) Subject: [POWERPC] cell: Add spu shutdown method X-Git-Tag: v2.6.23-rc1~767^2^2~145 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=6deac06612d2935b917550db2bc8a8b3f7c7aeb5;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Geoff Levand Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index a7f5a7653c6..cadcc64a865 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)