Re: [PATCH 7/7] tpm: Driver for next generation TPM chips

Andrew Morton
2006-04-10T23:04:19Z

Kylene Jo Hall <kjhall@us.ibm.com> wrote:
>
> This patch contains the driver for the next generation of TPM chips
> version 1.2 including support for interrupts. The Trusted Computing
> Group has written the TPM Interface Specification (TIS) which defines a
> common interface for all manufacturer's 1.2 TPM's thus the name
> tpm_tis.
>
> This updated version of the patch uses the new sysfs files that came
> about from the comments and changes in patch 6/7. It replaces the 7/7
> patch from the original set.
>
> Signed-off-by: Leendert van Doorn <leendert@watson.ibm.com>
> Signed-off-by: Kylene Hall <kjhall@us.ibm.com>

I've assumed that Leendert is the author of this driver. If incorrect,
please let me know. If correct then the way in which we indicate that is
to put a From: line right at the top of the changelog.

> + interruptible_sleep_on_timeout(&chip->vendor.int_queue,
> + HZ *
> + chip->vendor.timeout_a /
> + 1000);
>
> ...
>
> + interruptible_sleep_on_timeout(queue, HZ * timeout / 1000);

Please don't use the sleep_on functions. They are racy unless (iirc) both
the waker and wakee are holding lock_kernel(). If the race hits, we miss a
wakeup.

These should be converted to the not-racy wait_event_interruptible().