[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20070425183349.c3f661f4.akpm@linux-foundation.org>
Date: Wed, 25 Apr 2007 18:33:49 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: pwarudkar@....com
Cc: Jiri Kosina <jikos@...os.cz>, dsk6@...t.edu,
linux-kernel@...r.kernel.org
Subject: Re: Sleep during spinlock in TPM driver
On Mon, 23 Apr 2007 08:14:03 -0400 (EDT) Parag Warudkar <pwarudkar@....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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists