[Cbe-oss-dev] struct spu.stop_callback might be NULL

Michael Ellerman michael at ellerman.id.au
Wed Aug 23 14:49:58 EST 2006


Hi guys,

We've got a reproducible case where we land in spu_irq_class_0() with a
struct spu that has a NULL stop_callback().

Presumably the spu has been unbound from any context by unbind_context()
in spufs/sched.c.

We can "fix" it with a simple patch:

--- to-merge.orig/arch/powerpc/platforms/cell/spu_base.c        2006-08-22 13:35:53.000000000 +1000
+++ to-merge/arch/powerpc/platforms/cell/spu_base.c     2006-08-23 14:41:51.000000000 +1000
@@ -150,8 +150,11 @@ spu_irq_class_0(int irq, void *data, str
        struct spu *spu;

        spu = data;
-       spu->class_0_pending = 1;
-       spu->stop_callback(spu);
+
+       if (spu->stop_callback) {
+               spu->class_0_pending = 1;
+               spu->stop_callback(spu);
+       }

        return IRQ_HANDLED;
 }


The question is, is that a valid fix? Without a callback we can't do
much, but is it ok to just drop the irq?

Is there some higher-level logic that should be catching this? 

And there's also several other places that call the callbacks without
checking for NULL, we should check them also.

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/cbe-oss-dev/attachments/20060823/c375b403/attachment.pgp>


More information about the cbe-oss-dev mailing list