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

Arnd Bergmann arnd at arndb.de
Wed May 30 21:03:09 EST 2007


On Wednesday 30 May 2007, Christoph Hellwig wrote:
> 
> > Is it documented or implied somewhere that ->shutdown must not free
> > the device? If not, the first option is probably the safer choice.
> 
> It's not documented anywhere, but implicitly assumed.  I don't know
> of any shutdown implementation that frees the device.

Right, I found the explanation now myself:

The ->shutdown method is called for system devices that are still
part of a linked linked list. Freeing the object would destroy that
list.

Geoff, please merge the patch below in your tree.

	Arnd <><
---

Subject: cell: don't free spu objects in sysdev shutdown

From: Arnd Bergmann <arnd.bergmann at de.ibm.com>
System devices are accessed after they are shut down, so
we must not free the data structures.

Signed-off-by: Arnd Bergmann <arnd.bergmann at de.ibm.com>
Index: linux-2.6/arch/powerpc/platforms/cell/spu_base.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/spu_base.c
+++ linux-2.6/arch/powerpc/platforms/cell/spu_base.c
@@ -517,7 +517,6 @@ static int spu_shutdown(struct sys_devic
 
 	spu_free_irqs(spu);
 	spu_destroy_spu(spu);
-	kfree(spu);
 	return 0;
 }
 



More information about the cbe-oss-dev mailing list