Re: question on printk() spin_lock()/spin_unlock(): its proper usage

2008-03-31 Thread Rik van Riel
On Mon, 31 Mar 2008 00:53:32 +0800 Peter Teoh [EMAIL PROTECTED] wrote: Thanks Rik, On Mon, Mar 31, 2008 at 12:16 AM, Rik van Riel [EMAIL PROTECTED] wrote: On Sun, 30 Mar 2008 23:24:50 +0800 Peter Teoh [EMAIL PROTECTED] wrote: Is there any guidelines on when and where can we insert

Re: question on printk() spin_lock()/spin_unlock(): its proper usage

2008-03-31 Thread Peter Teoh
On Mon, Mar 31, 2008 at 11:53 PM, Rik van Riel [EMAIL PROTECTED] wrote: On Mon, 31 Mar 2008 00:53:32 +0800 thank you Rik for the answer :-). I have learned something. -- Regards, Peter Teoh -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to [EMAIL PROTECTED]

question on printk() spin_lock()/spin_unlock(): its proper usage

2008-03-30 Thread Peter Teoh
Is there any guidelines on when and where can we insert printk() to do debugging? From definition of printk() it calls vprintk(): kernel/printk.c: asmlinkage int vprintk(const char *fmt, va_list args) { static int log_level_unknown = 1; static char printk_buf[1024];

Re: question on printk() spin_lock()/spin_unlock(): its proper usage

2008-03-30 Thread Peter Teoh
Thanks Rik, On Mon, Mar 31, 2008 at 12:16 AM, Rik van Riel [EMAIL PROTECTED] wrote: On Sun, 30 Mar 2008 23:24:50 +0800 Peter Teoh [EMAIL PROTECTED] wrote: Is there any guidelines on when and where can we insert printk() to do debugging? You can use it pretty much anywhere. Ahso

Re: question on printk() spin_lock()/spin_unlock(): its proper usage

2008-03-30 Thread Peter Teoh
On Mon, Mar 31, 2008 at 12:53 AM, Peter Teoh [EMAIL PROTECTED] wrote: if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) return 0; Sorry, forgotten to explain the above - which is extracted from lock_acquire() - showing that irq must be disabled before it comes here - right? --