[PATCH 1/5] TPM: update char dev BKL pushdown

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rajiv Andrade
Date: Friday, October 3, 2008 - 9:30 am

This patch removes the BKL calls from the TPM driver, which
were added in the overall misc-char-dev-BKL-pushdown.patch,
as they are not needed.

Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
---
 drivers/char/tpm/tpm.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index ae766d8..ceba608 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -954,13 +954,16 @@ EXPORT_SYMBOL_GPL(tpm_store_cancel);
 
 /*
  * Device file system interface to the TPM
+ *
+ * It's assured that the chip will be opened just once,
+ * by the check of is_open variable, which is protected
+ * by driver_lock.
  */
 int tpm_open(struct inode *inode, struct file *file)
 {
 	int rc = 0, minor = iminor(inode);
 	struct tpm_chip *chip = NULL, *pos;
 
-	lock_kernel();
 	spin_lock(&driver_lock);
 
 	list_for_each_entry(pos, &tpm_chip_list, list) {
@@ -990,19 +993,16 @@ int tpm_open(struct inode *inode, struct file *file)
 	if (chip->data_buffer == NULL) {
 		chip->num_opens--;
 		put_device(chip->dev);
-		unlock_kernel();
 		return -ENOMEM;
 	}
 
 	atomic_set(&chip->data_pending, 0);
 
 	file->private_data = chip;
-	unlock_kernel();
 	return 0;
 
 err_out:
 	spin_unlock(&driver_lock);
-	unlock_kernel();
 	return rc;
 }
 EXPORT_SYMBOL_GPL(tpm_open);
-- 
1.5.6.3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/5] TPM: Locking update, Rajiv Andrade, (Fri Oct 3, 9:30 am)
[PATCH 1/5] TPM: update char dev BKL pushdown, Rajiv Andrade, (Fri Oct 3, 9:30 am)
[PATCH 2/5] TPM: num_opens to is_open variable change, Rajiv Andrade, (Fri Oct 3, 9:30 am)
[PATCH 3/5] TPM rcu locking, Rajiv Andrade, (Fri Oct 3, 9:30 am)
[PATCH 4/5] TPM: addition of pnp_remove(), Rajiv Andrade, (Fri Oct 3, 9:30 am)
[PATCH 5/5] TPM: Fixed tpm_release() timing, Rajiv Andrade, (Fri Oct 3, 9:30 am)
Re: [PATCH 3/5] TPM rcu locking, Serge E. Hallyn, (Fri Oct 3, 9:57 am)
[PATCH 3/5][resubmit] TPM: rcu locking, Rajiv Andrade, (Fri Oct 3, 12:12 pm)
Re: [PATCH 3/5][resubmit] TPM: rcu locking, Serge E. Hallyn, (Fri Oct 3, 12:53 pm)
Re: [PATCH 4/5] TPM: addition of pnp_remove(), Serge E. Hallyn, (Fri Oct 3, 1:05 pm)
Re: [PATCH 3/5][resubmit][BUG] TPM: rcu locking, Rajiv Andrade, (Mon Oct 6, 7:21 am)
Re: [PATCH 3/5][resubmit][FIXED] TPM: rcu locking, Rajiv Andrade, (Mon Oct 6, 7:29 am)
Re: [PATCH 4/5] TPM: addition of pnp_remove(), Rajiv Andrade, (Fri Oct 10, 12:50 pm)
Re: [PATCH 4/5] TPM: addition of pnp_remove(), Marcel Selhorst, (Tue Nov 4, 7:24 am)