|
@@ -43,6 +43,13 @@ static void user_reader_timeout(unsigned long ptr)
|
|
{
|
|
{
|
|
struct tpm_chip *chip = (struct tpm_chip *) ptr;
|
|
struct tpm_chip *chip = (struct tpm_chip *) ptr;
|
|
|
|
|
|
|
|
+ schedule_work(&chip->work);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void timeout_work(void * ptr)
|
|
|
|
+{
|
|
|
|
+ struct tpm_chip *chip = ptr;
|
|
|
|
+
|
|
down(&chip->buffer_mutex);
|
|
down(&chip->buffer_mutex);
|
|
atomic_set(&chip->data_pending, 0);
|
|
atomic_set(&chip->data_pending, 0);
|
|
memset(chip->data_buffer, 0, TPM_BUFSIZE);
|
|
memset(chip->data_buffer, 0, TPM_BUFSIZE);
|
|
@@ -527,6 +534,8 @@ int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry)
|
|
init_MUTEX(&chip->tpm_mutex);
|
|
init_MUTEX(&chip->tpm_mutex);
|
|
INIT_LIST_HEAD(&chip->list);
|
|
INIT_LIST_HEAD(&chip->list);
|
|
|
|
|
|
|
|
+ INIT_WORK(&chip->work, timeout_work, chip);
|
|
|
|
+
|
|
init_timer(&chip->user_read_timer);
|
|
init_timer(&chip->user_read_timer);
|
|
chip->user_read_timer.function = user_reader_timeout;
|
|
chip->user_read_timer.function = user_reader_timeout;
|
|
chip->user_read_timer.data = (unsigned long) chip;
|
|
chip->user_read_timer.data = (unsigned long) chip;
|