lkml.org 
[lkml]   [2007]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateWed, 25 Apr 2007 18:33:49 -0700
FromAndrew Morton <>
SubjectRe: Sleep during spinlock in TPM driver
On Mon, 23 Apr 2007 08:14:03 -0400 (EDT) Parag Warudkar <pwarudkar@aol.com> 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.957999963 -0400
> @@ -942,12 +942,12 @@
> {
> struct tpm_chip *chip = file->private_data;
>
> + flush_scheduled_work();
> spin_lock(&driver_lock);
> file->private_data = NULL;
> - chip->num_opens--;
> del_singleshot_timer_sync(&chip->user_read_timer);
> - flush_scheduled_work();
> atomic_set(&chip->data_pending, 0);

btw, this driver has a timer handler which does:

static void user_reader_timeout(unsigned long ptr)
{
struct tpm_chip *chip = (struct tpm_chip *) ptr;
schedule_work(&chip->work);
}
which appears to duplicate schedule_delayed_work()'s functionality.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-26 03:37    [from the cache]
©2003-2010