[PATCH] PPC64: EEH Recovery

Linas Vepstas linas at austin.ibm.com
Tue Nov 23 11:57:11 EST 2004


On Tue, Nov 23, 2004 at 09:12:36AM +1100, Benjamin Herrenschmidt was heard to remark:
> 
> "nasty habit" ... I there anything in linux you won't qualify of "nasty
> habits" one day ? :) 

Yikes!  Have I really been that cranky, that often?  Bad weather 
must have put me in a bad mood :).  That, or lack of fresh air.

> I hate braces for one lines. they are ugly.

Ahh, I occasionally have to debug code that looks like

   if(a)
     if (b)
        x=y;
   else
        x=z;

so I get cranky when I don't see braces. That, and the fact that I've
helped other people debug code that had started life as

     if (b)
        x=y;

and had been changed to

     if (b)
        f(y);
        x=y;

and so I have come to enjoy braces as a way of avoiding
stupid-error-prone-human-errors.  So what if its ugly, as long as 
it saves you time and trouble later?

> > ? Don't understand the question. PCI devices are arranged in a tree. 
> > One of the cards I test with has a bridge and several devices under it. 
> > So one has to walk the whole tree, which might be arbitrarily deep, to
> > get to all of the devices.
> 
> Then attach your structures to the device-tree instead. No need to
> duplicate the structure.

Heh :)  Removing the pci device also causes all of the pointers in the 
device tree for that device to be nulled out, and so one looses the
topology. So I had three bad choices:

1) Change the device-remove code to not null-out the pointers.
   This seemed potentially dangerous, and might have unexpected
   side-effects.  And worse: if someone, one day in the future, 
   changed the code back to null out the pointers, my code would 
   break.  So I didn't do this.

2) Add pointers to the device tree which point to exactly the same
   things as other pointers in the device tree, but which aren't 
   null'ed out during device delete.  This seemed to lead to confusion: 
   someday, someone will wonder why there are two sets of identical 
   pointers in the struct, and "fix it". 

3) create the structs I needed.  Simple, easy, limited in scope to just
   that one file, doesn't have to be exposed externally ... seemed like 
   such an easy idea.  So that's what I did.

--linas




More information about the Linuxppc64-dev mailing list