Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3062
b: refs/heads/master
c: fe3fd48
h: refs/heads/master
v: v3
  • Loading branch information
Kylene Hall authored and Linus Torvalds committed Jun 24, 2005
1 parent 388264d commit 750ab02
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2df7111fc6b0e050b06123379821ece2f8dd5bbc
refs/heads/master: fe3fd48384af79e7619d3c6b0a020f801ef63c3b
24 changes: 6 additions & 18 deletions trunk/drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,16 +434,7 @@ int tpm_release(struct inode *inode, struct file *file)

spin_lock(&driver_lock);
chip->num_opens--;
spin_unlock(&driver_lock);

down(&chip->timer_manipulation_mutex);
if (timer_pending(&chip->user_read_timer))
del_singleshot_timer_sync(&chip->user_read_timer);
else if (timer_pending(&chip->device_timer))
del_singleshot_timer_sync(&chip->device_timer);
up(&chip->timer_manipulation_mutex);

kfree(chip->data_buffer);
del_singleshot_timer_sync(&chip->user_read_timer);
atomic_set(&chip->data_pending, 0);

pci_dev_put(chip->pci_dev);
Expand Down Expand Up @@ -481,13 +472,7 @@ ssize_t tpm_write(struct file * file, const char __user * buf,
up(&chip->buffer_mutex);

/* Set a timeout by which the reader must come claim the result */
down(&chip->timer_manipulation_mutex);
init_timer(&chip->user_read_timer);
chip->user_read_timer.function = user_reader_timeout;
chip->user_read_timer.data = (unsigned long) chip;
chip->user_read_timer.expires = jiffies + (60 * HZ);
add_timer(&chip->user_read_timer);
up(&chip->timer_manipulation_mutex);
mod_timer(&chip->user_read_timer, jiffies + (60 * HZ));

return in_size;
}
Expand Down Expand Up @@ -617,9 +602,12 @@ int tpm_register_hardware(struct pci_dev *pci_dev,

init_MUTEX(&chip->buffer_mutex);
init_MUTEX(&chip->tpm_mutex);
init_MUTEX(&chip->timer_manipulation_mutex);
INIT_LIST_HEAD(&chip->list);

init_timer(&chip->user_read_timer);
chip->user_read_timer.function = user_reader_timeout;
chip->user_read_timer.data = (unsigned long) chip;

chip->vendor = entry;

chip->dev_num = -1;
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/char/tpm/tpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ struct tpm_chip {

struct timer_list user_read_timer; /* user needs to claim result */
struct semaphore tpm_mutex; /* tpm is processing */
struct timer_list device_timer; /* tpm is processing */
struct semaphore timer_manipulation_mutex;

struct tpm_vendor_specific *vendor;

Expand Down

0 comments on commit 750ab02

Please sign in to comment.