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

From: Arnd Bergmann
Date: Wed May 30 2007 - 07:03:52 EST


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@xxxxxxxxxx>
System devices are accessed after they are shut down, so
we must not free the data structures.

Signed-off-by: Arnd Bergmann <arnd.bergmann@xxxxxxxxxx>
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;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/