Re: Sleep during spinlock in TPM driver

2007-04-25 Thread Andrew Morton
On Mon, 23 Apr 2007 08:14:03 -0400 (EDT) Parag Warudkar <[EMAIL PROTECTED]> wrote: > --- linux-2.6-us/drivers/char/tpm/tpm.c 2007-04-21 14:55:03.134975360 > -0400 > +++ linux-2.6-wk/drivers/char/tpm/tpm.c 2007-04-22 14:58:51.95763 > -0400 > @@ -942,12 +942,12 @@ > { >

Re: Sleep during spinlock in TPM driver

2007-04-25 Thread Andrew Morton
On Mon, 23 Apr 2007 08:14:03 -0400 (EDT) Parag Warudkar [EMAIL PROTECTED] wrote: --- linux-2.6-us/drivers/char/tpm/tpm.c 2007-04-21 14:55:03.134975360 -0400 +++ linux-2.6-wk/drivers/char/tpm/tpm.c 2007-04-22 14:58:51.95763 -0400 @@ -942,12 +942,12 @@ { struct

Re: Sleep during spinlock in TPM driver

2007-04-23 Thread Jiri Slaby
Parag Warudkar napsal(a): > On Mon, 23 Apr 2007, Jiri Kosina wrote: > >> On Sun, 22 Apr 2007, Parag Warudkar wrote: >> >>> @@ -1097,8 +1097,13 @@ >>> >>> /* Driver specific per-device data */ >>> chip = kzalloc(sizeof(*chip), GFP_KERNEL); >>> - if (chip == NULL) >>> + devname =

Re: Sleep during spinlock in TPM driver

2007-04-23 Thread Parag Warudkar
G.. My email client was at it again. Sorry it messed up with the additonal + again. Do not use Alpine - This is the first email client (alphas and betas included) which is buggy enough to change what you write! Not taking chances this time - patch attached. Parag ---

Re: Sleep during spinlock in TPM driver

2007-04-23 Thread Parag Warudkar
On Mon, 23 Apr 2007, Jiri Kosina wrote: On Sun, 22 Apr 2007, Parag Warudkar wrote: @@ -1097,8 +1097,13 @@ /* Driver specific per-device data */ chip = kzalloc(sizeof(*chip), GFP_KERNEL); - if (chip == NULL) + devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL); + + if (chip == NULL

Re: Sleep during spinlock in TPM driver

2007-04-23 Thread Jiri Kosina
On Sun, 22 Apr 2007, Parag Warudkar wrote: > @@ -1097,8 +1097,13 @@ > > /* Driver specific per-device data */ > chip = kzalloc(sizeof(*chip), GFP_KERNEL); > - if (chip == NULL) > + devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL); > + + if (chip == NULL || devname == NULL) {

Re: Sleep during spinlock in TPM driver

2007-04-23 Thread Jiri Kosina
On Sun, 22 Apr 2007, Parag Warudkar wrote: @@ -1097,8 +1097,13 @@ /* Driver specific per-device data */ chip = kzalloc(sizeof(*chip), GFP_KERNEL); - if (chip == NULL) + devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL); + + if (chip == NULL || devname == NULL) { Hi, this

Re: Sleep during spinlock in TPM driver

2007-04-23 Thread Parag Warudkar
On Mon, 23 Apr 2007, Jiri Kosina wrote: On Sun, 22 Apr 2007, Parag Warudkar wrote: @@ -1097,8 +1097,13 @@ /* Driver specific per-device data */ chip = kzalloc(sizeof(*chip), GFP_KERNEL); - if (chip == NULL) + devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL); + + if (chip == NULL

Re: Sleep during spinlock in TPM driver

2007-04-23 Thread Parag Warudkar
G.. My email client was at it again. Sorry it messed up with the additonal + again. Do not use Alpine - This is the first email client (alphas and betas included) which is buggy enough to change what you write! Not taking chances this time - patch attached. Parag ---

Re: Sleep during spinlock in TPM driver

2007-04-23 Thread Jiri Slaby
Parag Warudkar napsal(a): On Mon, 23 Apr 2007, Jiri Kosina wrote: On Sun, 22 Apr 2007, Parag Warudkar wrote: @@ -1097,8 +1097,13 @@ /* Driver specific per-device data */ chip = kzalloc(sizeof(*chip), GFP_KERNEL); - if (chip == NULL) + devname = kmalloc(DEVNAME_SIZE,

Re: Sleep during spinlock in TPM driver

2007-04-22 Thread Parag Warudkar
Andrew Morton linux-foundation.org> writes: On Fri, 20 Apr 2007 18:11:10 -0400 "David Kyle" pitt.edu> wrote: > int tpm_release(struct inode *inode, struct file *file) > { > struct tpm_chip *chip = file->private_data; > spin_lock(_lock); > file->private_data =

Re: Sleep during spinlock in TPM driver

2007-04-22 Thread Parag Warudkar
Andrew Morton akpm at linux-foundation.org writes: On Fri, 20 Apr 2007 18:11:10 -0400 David Kyle dsk6 at pitt.edu wrote: int tpm_release(struct inode *inode, struct file *file) { struct tpm_chip *chip = file-private_data; spin_lock(driver_lock);

Re: Sleep during spinlock in TPM driver

2007-04-21 Thread Andrew Morton
On Fri, 20 Apr 2007 18:11:10 -0400 "David Kyle" <[EMAIL PROTECTED]> wrote: > I've been working with the TPM driver, and I found that if I opened, > used, then closed the TPM char device very frequently, I would get a > kernel BUG message saying that the kernel tried to sleep while holding > a

Re: Sleep during spinlock in TPM driver

2007-04-21 Thread Andrew Morton
On Fri, 20 Apr 2007 18:11:10 -0400 David Kyle [EMAIL PROTECTED] wrote: I've been working with the TPM driver, and I found that if I opened, used, then closed the TPM char device very frequently, I would get a kernel BUG message saying that the kernel tried to sleep while holding a spinlock.

Sleep during spinlock in TPM driver

2007-04-20 Thread David Kyle
I've been working with the TPM driver, and I found that if I opened, used, then closed the TPM char device very frequently, I would get a kernel BUG message saying that the kernel tried to sleep while holding a spinlock. I think I've isolated the problem to this function, in

Sleep during spinlock in TPM driver

2007-04-20 Thread David Kyle
I've been working with the TPM driver, and I found that if I opened, used, then closed the TPM char device very frequently, I would get a kernel BUG message saying that the kernel tried to sleep while holding a spinlock. I think I've isolated the problem to this function, in