All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: pwarudkar@aol.com
Cc: Jiri Kosina <jikos@jikos.cz>,
	dsk6@pitt.edu, linux-kernel@vger.kernel.org
Subject: Re: Sleep during spinlock in TPM driver
Date: Wed, 25 Apr 2007 18:33:49 -0700	[thread overview]
Message-ID: <20070425183349.c3f661f4.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0704230809080.6722@paragw-desktop>

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.

  reply	other threads:[~2007-04-26  1:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-22 19:06 Sleep during spinlock in TPM driver Parag Warudkar
2007-04-23  7:42 ` Jiri Kosina
2007-04-23 12:04   ` Parag Warudkar
2007-04-23 12:14     ` Parag Warudkar
2007-04-26  1:33       ` Andrew Morton [this message]
2007-04-23 12:42     ` Jiri Slaby
  -- strict thread matches above, loose matches on Subject: below --
2007-04-20 22:11 David Kyle
2007-04-21 22:50 ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070425183349.c3f661f4.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dsk6@pitt.edu \
    --cc=jikos@jikos.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pwarudkar@aol.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.