From: Kylene Jo Hall <kjhall@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Marcel Selhorst <selhorst@crypto.rub.de>,
linux-kernel@vger.kernel.org, castet.matthieu@free.fr
Subject: Re: [PATCH] TPM: cleanups
Date: Wed, 16 Nov 2005 16:48:15 -0600 [thread overview]
Message-ID: <1132181295.4872.11.camel@localhost.localdomain> (raw)
In-Reply-To: <20051112134844.7f177e07.akpm@osdl.org>
Patch to add the necessary flush_schedule_work calls when canceling the
timer.
Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
On Sat, 2005-11-12 at 13:48 -0800, Andrew Morton wrote:
> Kylene Jo Hall <kjhall@us.ibm.com> wrote:
> >
> > + schedule_work(&chip->work);
> > +}
> > +
> > +static void timeout_work(void * ptr)
> > +{
> > + struct tpm_chip *chip = (struct tpm_chip*) ptr;
> > +
>
> I cannot see where the tpm driver stops that timer which it has running on
> device close or on module unload.
>
> Wherever it is, we'll now also need a flush_scheduled_work() to avoid a race
> wherein the work handler is still executing while the module gets
> unloaded.
>
---
diff -uprN --exclude='.*' --exclude='*~' --exclude='*.o' --exclude='*.ko' --exclude='*.rej' --exclude='*.orig' --exclude='*infineon*' --exclude='*nsc*' --exclude='*mod*' linux-2.6.14/drivers/char/tpm/tpm.c linux-2.6.14-rc4-tpm/drivers/char/tpm/tpm.c
--- linux-2.6.14/drivers/char/tpm/tpm.c 2005-11-15 15:42:10.000000000 -0600
+++ linux-2.6.14-rc4-tpm/drivers/char/tpm/tpm.c 2005-11-15 14:11:20.000000000 -0600
@@ -377,6 +377,7 @@ int tpm_release(struct inode *inode, str
file->private_data = NULL;
chip->num_opens--;
del_singleshot_timer_sync(&chip->user_read_timer);
+ flush_scheduled_work();
atomic_set(&chip->data_pending, 0);
put_device(chip->dev);
kfree(chip->data_buffer);
@@ -428,6 +429,7 @@ ssize_t tpm_read(struct file * file, cha
int ret_size;
del_singleshot_timer_sync(&chip->user_read_timer);
+ flush_scheduled_work();
ret_size = atomic_read(&chip->data_pending);
atomic_set(&chip->data_pending, 0);
if (ret_size > 0) { /* relay data */
next prev parent reply other threads:[~2005-11-16 22:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-26 17:11 [PATCH] Infineon TPM: move infineon driver off pci_dev Marcel Selhorst
2005-10-26 17:23 ` Kylene Jo Hall
2005-10-26 17:41 ` matthieu castet
2005-10-26 19:53 ` Marcel Selhorst
2005-10-27 11:22 ` Marcel Selhorst
2005-10-27 14:07 ` Kylene Jo Hall
2005-10-27 21:55 ` Andrew Morton
2005-10-27 22:03 ` Roland Dreier
2005-10-27 22:26 ` Andrew Morton
2005-10-28 14:22 ` Kylene Jo Hall
2005-11-11 20:11 ` [PATCH] TPM: cleanups Kylene Jo Hall
2005-11-11 23:08 ` Kylene Jo Hall
2005-11-12 21:48 ` Andrew Morton
2005-11-16 22:48 ` Kylene Jo Hall [this message]
2005-10-27 21:33 ` [PATCH] Infineon TPM: move infineon driver off pci_dev Andrew Morton
2005-10-28 5:23 ` Marcel Selhorst
2005-10-27 21:42 ` matthieu castet
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=1132181295.4872.11.camel@localhost.localdomain \
--to=kjhall@us.ibm.com \
--cc=akpm@osdl.org \
--cc=castet.matthieu@free.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=selhorst@crypto.rub.de \
/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.