Re: [PATCH] powerpc/nvram: Add spinlock to oops_to_nvram to prevent oops in compression code.

2011-12-01 Thread Jim Keniston
On Thu, 2011-12-01 at 12:46 +1100, Anton Blanchard wrote: When issuing a system reset we almost always oops in the oops_to_nvram code because multiple CPUs are using the deflate work area. Add a spinlock to protect it. To play it safe I'm using trylock to avoid locking up if the NVRAM code

[PATCH] powerpc/nvram: Add spinlock to oops_to_nvram to prevent oops in compression code.

2011-11-30 Thread Anton Blanchard
When issuing a system reset we almost always oops in the oops_to_nvram code because multiple CPUs are using the deflate work area. Add a spinlock to protect it. To play it safe I'm using trylock to avoid locking up if the NVRAM code oopses. This means we might miss multiple CPUs oopsing at

Re: [PATCH] powerpc/nvram: Add spinlock to oops_to_nvram to prevent oops in compression code.

2011-11-30 Thread Benjamin Herrenschmidt
On Thu, 2011-12-01 at 12:46 +1100, Anton Blanchard wrote: When issuing a system reset we almost always oops in the oops_to_nvram code because multiple CPUs are using the deflate work area. Add a spinlock to protect it. To play it safe I'm using trylock to avoid locking up if the NVRAM code

Re: [PATCH] powerpc/nvram: Add spinlock to oops_to_nvram to prevent oops in compression code.

2011-11-30 Thread Anton Blanchard
Hi Ben, How would we miss ? trylock does loop on stwcx. failure, it doesn't loop if the lock is -taken-, so if the lock is only used for actually dealing with the oops the only miss is because somebody already got it... or am I missing something ? I'm thinking of two CPUs that enter at