AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20090710143326.092d9664@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	2779531E7C760D4491C96305019FEEB52AD1B85F04@exch1.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Fri, 10 Jul 2009 14:34:07 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: Rendell Fong <rendell.fong@onstor.com>
Subject: Re: please review - 32712
Message-ID: <20090710143407.21a0c7c3@ripper.onstor.net>
In-Reply-To: <2779531E7C760D4491C96305019FEEB52AD1B85F04@exch1.onstor.net>
References: <20090701164948.37b36804@ripper.onstor.net>
	<2779531E7C760D4491C96305019FEEB52AD1B85F04@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

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


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

     line 200 trailing ws

     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.

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/

     line 21, is this changeable?  ~:^)

     line 80 trailing ws



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

     line 1419 could i impose upon you to fix this stupid debug macro?
     i know you didn't write it to begin with, but..

     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...


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


     line 24 this include needs fixin' like the other one

     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...?














> > -----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
> > >
