AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20090717191450.6f23e246@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:mail.onstor.net
NSV:
SSH:
R:<rendell.fong@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@exch1.onstor.net/INBOX	0	2779531E7C760D4491C96305019FEEB52AD1B85F0C@exch1.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Fri, 17 Jul 2009 19:15:38 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: Rendell Fong <rendell.fong@onstor.com>
Subject: Re: please review - 32712
Message-ID: <20090717191538.0677f8b3@ripper.onstor.net>
In-Reply-To: <2779531E7C760D4491C96305019FEEB52AD1B85F0C@exch1.onstor.net>
References: <2779531E7C760D4491C96305019FEEB52AD1B85F0C@exch1.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit


= Change 32712 by rendellf@rendellf-test on 2009/06/23 16:51:57
*pending* = 
= 	TED26961: [Sanger - 12690] filer rebooted but no crash file
saved = 	
= 	Changes to support save of SSC crashdump info when a crash
occurs due = 	to kernel panic or non-fatal die exception in
Cougar (Linux).  The = 	crashdump info is stored in boot PROM at
time of crash and then copied = 	to the crash file by crashsaved
after the system is rebooted. = 

linux/kernel/linux-mips-2.6/arch/mips/Kconfig


     looks good


linux/kernel/linux-mips-2.6/arch/mips/Makefile


     looks good


linux/kernel/linux-mips-2.6/arch/mips/kernel/traps.c


     looks good

linux/kernel/linux-mips-2.6/arch/mips/onstor/Kconfig


     looks good


linux/kernel/linux-mips-2.6/arch/mips/onstor/common/Makefile


     >>add linux/kernel/linux-mips-2.6/arch/mips/onstor/common/Makefile

     	looks good


linux/kernel/linux-mips-2.6/arch/mips/onstor/common/ons_crashdump.c

     >>add
     linux/kernel/linux-mips-2.6/arch/mips/onstor/common/ons_crashdump.c

     line 115 infinite loop?  if (nbytes <= 0) perhaps?

     line 206 this if confuses me.  what if it's ISA_2 or 4?
     or X86_mumble?

     line 213 hmm, i think i'd feel safer if you used something like
     save_stack_trace and then copied the values out of there into
     the cptr array.  the linux-mips stack can sometimes be a tricky
     thing to deal with, especially in some contexts.  let me know
     what you think.  then, if anything changes, we will be protected
     from having to know what changed.

     line 260 i think there's a kernel function that does this exact
     thing, no?

     line 294 uh, this seems to be doing much the same thing as
     the code at line 213? could we just use save_stack_trace() and
     print_stack_trace() instead?

linux/kernel/linux-mips-2.6/arch/mips/onstor/cougar/Makefile

     looks good

linux/kernel/linux-mips-2.6/arch/mips/onstor/cougar/version.c

     >>add linux/kernel/linux-mips-2.6/arch/mips/onstor/cougar/version.c

     I'm confused.  Why do we need the contents of /version?

linux/kernel/linux-mips-2.6/cougar-config


     looks good


linux/kernel/linux-mips-2.6/drivers/ssc-mgmt-bus/prom.c


     line 58 chrimmedie, i didn't even notice that there were two
     different debug macros in here.  would it be too much to ask to
     reduce it to just one?  again, i know it's not your mess....

     the rest looks good.



linux/kernel/linux-mips-2.6/include/linux/onstor/ons_crashdump.h

     >>add
     linux/kernel/linux-mips-2.6/include/linux/onstor/ons_crashdump.h

linux/kernel/linux-mips-2.6/kernel/panic.c



     looks good



nfx-tree/code/sm-except/crashdump.c



     ok




nfx-tree/code/sm-except/crashdump.h



     looks good



nfx-tree/code/ssc-crashsave/Makefile



     line 40 really?
     utils,authen,nfxnis,icucommon,icudata,acrypt,event,bsdcompat,genlib...this
     "package" needs these "packages?"

     wait, seriously, crashsave needs ldap,ssl,math,nsl and crypt
     libraries?





nfx-tree/code/ssc-crashsave/crashsave-int.h



     i'm more confused.  this is header file for code that will be
     running post-crash-boot-up time?



nfx-tree/code/ssc-crashsave/crashsave.c



     uhhh



nfx-tree/code/ssc-crashsave/linux.c



     hokay, if you say so ~:^)







On Fri, 17 Jul 2009 08:49:23 -0700 Rendell Fong
<rendell.fong@onstor.com> wrote:

> Just in case you have forgotten...
> 
> 
> -----Original Message-----
> From: Rendell Fong 
> Sent: Friday, July 10, 2009 6:36 PM
> To: Andy Sharp
> Subject: RE: please review - 32712
> 
> Comments inline.
> 
> Added files:
> ... //depot/dev/linux/kernel/linux-mips-2.6/arch/mips/onstor /cougar/version.c#1
> add
> 
> ... //depot/dev/linux/kernel/linux-mips-2.6/include/linux/onstor  /ons_crashdump.h#1
> add
> 
> 
> > -----Original Message-----
> > From: Andy Sharp
> > Sent: Friday, July 10, 2009 2:34 PM
> > To: Rendell Fong
> > Subject: Re: please review - 32712
> > 
> > On Mon, 6 Jul 2009 14:19:48 -0700 Rendell Fong
> > <rendell.fong@onstor.com> wrote:
> > 
> > > Updated change list as follows:
> > > Comments also included below.
> > >
> > > Affected files ...
> > >
> > > //depot/dev/linux/kernel/linux-mips-2.6/arch/mips/Kconfig#2 edit
> > > //depot/dev/linux/kernel/linux-mips-2.6/arch/mips/Makefile#2 edit
> > > //depot/dev/linux/kernel/linux-mips-2.6/arch/mips/kernel/traps.c#3
> > > edit //depot/dev/linux/kernel/linux-mips-2.6/arch/mips/onstor/Kconfig#2
> > > edit //depot/dev/linux/kernel/linux-mips-
> > 2.6/arch/mips/onstor/common/Makefile#1
> > > add //depot/dev/linux/kernel/linux-mips-
> > 2.6/arch/mips/onstor/common/cg_crashdump.c#1
> > > add //depot/dev/linux/kernel/linux-mips-
> > 2.6/arch/mips/onstor/common/cg_crashdump.h#1
> > > add //depot/dev/linux/kernel/linux-mips-2.6/cougar-config#5 edit
> > > //depot/dev/linux/kernel/linux-mips-2.6/drivers/ssc-mgmt-bus/prom.c#3
> > > edit //depot/dev/linux/kernel/linux-mips-2.6/kernel/panic.c#1 edit
> > > //depot/dev/nfx-tree/code/sm-except/crashdump.c#5 edit
> > > //depot/dev/nfx-tree/code/sm-except/crashdump.h#2 edit
> > > //depot/dev/nfx-tree/code/ssc-crashsave/Makefile#1 edit
> > > //depot/dev/nfx-tree/code/ssc-crashsave/crashsave-int.h#1 edit
> > > //depot/dev/nfx-tree/code/ssc-crashsave/crashsave.c#3 edit
> > > //depot/dev/nfx-tree/code/ssc-crashsave/linux.c#2 edit
> > 
> > 
> > 
> > = Change 32712 by rendellf@rendellf-test on 2009/06/23 16:51:57
> > *pending* =
> > = 	Changes to support save of SSC crashdump info when a
> > crash occurs due
> > = 	to kernel panic or non-fatal die exception in Cougar
> > (Linux).  The = 	crashdump info is stored in boot PROM at
> > time of crash and then copied
> > = 	to the crash file after the system is rebooted.
> > =
> > 
> > This is a great job, you're turning into a real Linux Kernel
> > programmer! linux/kernel/linux-mips-2.6/arch/mips/Kconfig
> > 
> >      looks good
> > 
> > linux/kernel/linux-mips-2.6/arch/mips/Makefile
> > 
> >      looks good
> > 
> > linux/kernel/linux-mips-2.6/arch/mips/kernel/traps.c
> > 
> > 
> >      well, the config variable looks good.  the include is broken,
> >      however, check later comments for more info
> > 
> Ok, path to include file updated.
> 
> > 
> > linux/kernel/linux-mips-2.6/arch/mips/onstor/Kconfig
> > 
> >      looks good
> > 
> > linux/kernel/linux-mips-2.6/arch/mips/onstor/common/Makefile
> > 
> >      >>add
> >      >>linux/kernel/linux-mips-2.6/arch/mips/onstor/common/Makefile
> > 
> >      	looks good
> > 
> > linux/kernel/linux-mips-2.6/arch/mips/onstor/common/cg_crashdump.c
> > 
> >      >>add
> >      linux/kernel/linux-mips-2.6/arch/mips/onstor/common/cg_crashdump.c
> > 
> >      line 98-126, make this a function that lives in the specific
> >      platform code for the specific arch, cougar(ssc) or tuxrx --
> >      no ifdef CONFIG_ needed
> 
> Ok, it's been moved to a new routine.
> 
> > 
> >      line 200 trailing ws
> 
> Ok
> 
> > 
> >      line 353 no studly caps ~:^) i think the mask is redundant
> > anyway, but that's ok
> > 
> >      line 389, might want to double check that these file methods
> > are required before just blindly referencing them.  for instance,
> >      i'm pretty sure that llseek isn't required, but as always,
> >      i could be wrong ~:^)  if this is for the /dev/promc file, then
> >      ignore this comment.
> 
> The llseek is for the prom driver and yes it is needed (to handle the
> large offset value).
> 
> > 
> > linux/kernel/linux-mips-2.6/arch/mips/onstor/common/cg_crashdump.h
> > 
> >      >>add
> >      linux/kernel/linux-mips-2.6/arch/mips/onstor/common/cg_crashdump.h
> > 
> >      i think i have it figured out, this should probably go in
> >      asm-mips/something or maybe just include/linux/onstor/
> > 
> Ok, I've moved it.
> 
> >      line 21, is this changeable?  ~:^)
> >
> Yes, as long as it's consistent with what crashsaved is looking for.
>  
> >      line 80 trailing ws
> > 
> Ok
> 
> > 
> > 
> > linux/kernel/linux-mips-2.6/cougar-config
> > 
> >      looks good
> > 
> > linux/kernel/linux-mips-2.6/drivers/ssc-mgmt-bus/prom.c
> > 
> > 
> >      line 71 hm, i think maybe the wrong macro is being checked
> > here, probably should be one that checks sibyte or r9k
> > 
> Ok
> 
> >      line 1419 could i impose upon you to fix this stupid debug
> > macro? i know you didn't write it to begin with, but..
> >
> ok.
>  
> >      line 1478 could i also impose upon you to add a check to the
> > return value of kmalloc() before it gets used and freed and so
> > forth? ditto the previous comment...
> Ok
> 
> > 
> > 
> > linux/kernel/linux-mips-2.6/kernel/panic.c
> > 
> > 
> >      line 24 this include needs fixin' like the other one
> > 
> Fixed
> 
> >      line 73 super ugly, but whatever, we don't have time for
> > anything better
> > 
> > nfx-tree/code/sm-except/crashdump.c
> > 
> > 
> >      ok
> > 
> > 
> > 
> > nfx-tree/code/sm-except/crashdump.h
> > 
> > 
> >      looks good
> > 
> > 
> > nfx-tree/code/ssc-crashsave/Makefile
> > 
> > 
> >      uhh, ok
> > 
> > 
> > nfx-tree/code/ssc-crashsave/crashsave-int.h
> > 
> > 
> >      looks good
> > 
> > 
> > nfx-tree/code/ssc-crashsave/crashsave.c
> > 
> > 
> >      looks good
> > 
> > 
> > nfx-tree/code/ssc-crashsave/linux.c
> > 
> > 
> >      what the !? is all this?  i thought linux didn't need any
> >      conversion code...?
> > 
> It's just formatting the crash data that the kernel stored in prom.
> The conversion puts the info in user friendly text form for final
> storage in the crash file.
> 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > > -----Original Message-----
> > > > From: Andy Sharp
> > > > Sent: Wednesday, July 01, 2009 4:50 PM
> > > > To: Rendell Fong
> > > > Subject: Re: please review - 32712
> > > >
> > > > Hi Rendell,
> > > >
> > > > Feel free to swing on by "The Pit" and chat about some of this
> > > > stuff....
> > > >
> > > >
> > > > linux/kernel/linux-mips-2.6/arch/mips/kernel/Makefile
> > > >
> > > >      uh, not really...
> > > Reverted.
> > >
> > > >
> > > > linux/kernel/linux-mips-2.6/arch/mips/kernel/nfx_crashdump.c
> > > >
> > > >      >>add
> > > >      >>linux/kernel/linux-mips-2.6/arch/mips/kernel/nfx_crashdump.c
> > > >
> > > >
> > > >      please don't use the letters "nfx".  they make me ill.  how
> > > > about cougar_  or cg_ ?
> > > Ok
> > >
> > > >
> > > >      line 20 if you're going to put the whole file inside an
> > > > ifdef, might as well put the whole file inside the ifdef.
> > >
> > > Ok, removed it. I'll deal with it in the makefile.
> > >
> > > >
> > > >      line 42 please don't use typedefs like this, it's verboten
> > > >      in linux.  more on this in cougar_crashdump.h
> > > >
> > > >      line 43 this should be static
> > >
> > > Ok
> > >
> > > >
> > > >      line 51, 62, please use standard kernel functions
> > >
> > > If I knew what they are, I'd use them.  Elaborate please.
> > > Why is the kernel got to be different?  Just to make life
> > > difficult?
> > >
> > > >
> > > >      line 87, what's up with the checksum?  can we use standard
> > > > kernel checksum function(s) instead?
> > > >
> > > Changed to use crc32().
> > >
> > > >      153, 156 trailing whitespace -- git should have mentioned
> > > > this. is this commited to your git tree?  multiple places.
> > > >
> > > Ok.  I don't normally check for those things since there so
> > > benign.
> > >
> > > >      205 not sure what this has to do with this function?  i
> > > > don't see any reading in this function
> > >
> > > Removed the bogus comments.
> > > >
> > > >      250 please fix bogus commenting style, multiple places
> > > >
> > > Ok.
> > >
> > > >
> > > >      316 are you sure about that?  i'm not positive that
> > > > KALLSYMS is required...
> > >
> > > This is roughly based on unwind_stack() which only exists when
> > > CONFIG_KALLSYMS is defined.  But if you aren't convinced it is
> > > needed then I'll remove the comment.
> > >
> > > >
> > > >      328 isn't there a stock kernel function that does this?
> > > > will it not work for us?
> > > >
> > > The kernel function only prints to stdout.  We need it stored in
> > > memory so we need our own version.
> > >
> > > >      348 this is the same description as the previous function.
> > > >
> > > Same response as previous.
> > >
> > > >      395 this is pretty ugly.  at the very least you should
> > > > explicitly mask the part you are throwing away.  not sure you
> > > > should be throwing away the upper 32-bits anyway.
> > >
> > > Added the masking.  The length should never exceed the buffer size
> > > which is actually less than 16 bits.
> > >
> > > >
> > > >      479 what is a "crashdump"?  this business about
> > > > CONFIG_PROM not being configured... i'm not sure i get it.
> > > > won't it always be configured?  should not CONFIG_COUGAR and
> > > > CONFIG_TUXRX depend on it?
> > >
> > > Removed the #ifdef.  The CR_CRASHDUMP feature depends on PROM in
> > > kconfig file.
> > >
> > > >
> > > >      505 not sure how well malloc will be working at this point.
> > > > can we allocate on the stack instead?  other places too.
> > > > actually, here might be fine.  check other uses of kmalloc for
> > > > this possibility.
> > > >
> > > >
> > > The crashdump clear/show functions removed since I only needed it
> > > for debugging purposes.  Changed prom data sector to be statically
> > > allocated.
> > >
> > > >
> > > >
> > > > linux/kernel/linux-mips-2.6/arch/mips/kernel/nfx_crashdump.h
> > > >
> > > >      >>add
> > > >      >>linux/kernel/linux-mips-2.6/arch/mips/kernel/nfx_crashdump.h
> > > >
> > > >      line 26 ix-nay on the typedefs-ay .  also, there should be
> > > > stock kernel thingies for these types.  See
> > > > Documentation/CodingStyle, line 255.
> > > Ok, changed it to use the std typedefs.
> > >
> > > >
> > > > linux/kernel/linux-mips-2.6/arch/mips/kernel/traps.c
> > > >
> > > >      line 46 there should be a single CONFIG variable for our
> > > > crashdump feature
> > > Ok
> > >
> > > >
> > > > linux/kernel/linux-mips-2.6/cougar-config
> > > >
> > > >      line 1202, uh no, you don't want that change
> > >
> > > Removed it.  Forgot to undo it.
> > >
> > > >
> > > > linux/kernel/linux-mips-2.6/drivers/char/sysrq.c
> > > >
> > > >      312 this looks like debugging stuff.  all these changes do.
> > >
> > > Removed from change list
> > >
> > > >
> > > > linux/kernel/linux-mips-2.6/drivers/ssc-mgmt-bus/prom.c
> > > >
> > > >      line 1419 you can use __func__.  does this now violate the
> > > > 80 column rule?  what is this debug(()) macro, anyway?  it looks
> > > >      broken to me.
> > >
> > > Huh?  What is __func__ needed for?
> > > The debug() macro works perfectly fine. It doesn't have to deal
> > > with var args since its using an extra set of parens (all args
> > > treated as single param).
> > >
> > > >
> > > >      1507 please use the return type, even though it's a dreaded
> > > > typedef
> > >
> > > Done.
> > >
> > > >
> > > > linux/kernel/linux-mips-2.6/kernel/panic.c
> > > >
> > > >      line 22 use your new crashdump config
> > >
> > > Ok
> > >
> > > >
> > > >      line 73, ditto, etc.
> > >
> > > Ok
> > >
> > > >
> > > > nfx-tree/code/sm-except/crashdump.c
> > > >
> > > >      line 6, might as well go ahead and update the copyright
> > > > years 2002-2009
> > >
> > > Updated
> > >
> > > >
> > > >
> > > > nfx-tree/code/sm-except/crashdump.h
> > > >
> > > >      looks good
> > > >
> > > > nfx-tree/code/ssc-crashsave/Makefile
> > > >
> > > >      uhh, ok
> > > >
> > > > nfx-tree/code/ssc-crashsave/crashsave-int.h
> > > >
> > > >      looks good
> > > >
> > > > nfx-tree/code/ssc-crashsave/crashsave.c
> > > >
> > > >      looks good
> > > >
> > > > nfx-tree/code/ssc-crashsave/linux.c
> > > >
> > > >      looks good
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Wed, 24 Jun 2009 18:45:43 -0700 Rendell Fong
> > > > <rendell.fong@onstor.com> wrote:
> > > >
> > > > > Finally got the code ported over and working...
> > > > >
> > > > > Change 32712 by rendellf@rendellf-test on 2009/06/23 16:51:57
> > > > > *pending*
> > > > >
> > > > >         Changes to support save of SSC crashdump info when a
> > > > > crash occurs due to kernel panic or non-fatal die exception
> > > > > in Cougar (Linux).  The crashdump info is stored in boot PROM
> > > > > at time of crash and then copied to the crash file after the
> > > > > system is rebooted.
> > > > >
> > > > > Affected files ...
> > > > >
> > > > > ... //depot/dev/linux/kernel/linux-mips-
> > 2.6/arch/mips/kernel/Makefile#1
> > > > > edit ... //depot/dev/linux/kernel/linux-mips-
> > > > 2.6/arch/mips/kernel/nfx_crashdump.c#1
> > > > > add ... //depot/dev/linux/kernel/linux-mips-
> > > > 2.6/arch/mips/kernel/nfx_crashdump.h#1
> > > > > add ... //depot/dev/linux/kernel/linux-mips-
> > > > 2.6/arch/mips/kernel/traps.c#3
> > > > > edit ... //depot/dev/linux/kernel/linux-mips-2.6/cougar-config#5
> > > > > edit ... //depot/dev/linux/kernel/linux-mips-
> > 2.6/drivers/char/sysrq.c#2
> > > > > edit ... //depot/dev/linux/kernel/linux-mips-2.6/drivers/ssc-mgmt-
> > > > bus/prom.c#3
> > > > > edit ... //depot/dev/linux/kernel/linux-mips-2.6/kernel/panic.c#1
> > > > > edit ... //depot/dev/nfx-tree/code/sm-except/crashdump.c#5
> > > > > edit ... //depot/dev/nfx-tree/code/sm-except/crashdump.h#2
> > > > > edit ... //depot/dev/nfx-tree/code/ssc-crashsave/Makefile#1
> > > > > edit ... //depot/dev/nfx-tree/code/ssc-crashsave/crashsave-int.h#1
> > > > > edit ... //depot/dev/nfx-tree/code/ssc-crashsave/crashsave.c#3
> > > > > edit ... //depot/dev/nfx-tree/code/ssc-crashsave/linux.c#2
> > > > > edit
> > > > >
