tpm: expose spaces via a device link /dev/tpmrm<n>
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Tue, 3 Jan 2017 17:07:32 +0000 (09:07 -0800)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Mon, 3 Apr 2017 19:46:02 +0000 (22:46 +0300)
commitfdc915f7f71939ad5a3dda3389b8d2d7a7c5ee66
treeef6a2c935e96f15082832fda56cf4f10be9a97fd
parentecb38e2f521b01f0fd0b0a3261921b0bcc002dd0
tpm: expose spaces via a device link /dev/tpmrm<n>

Currently the tpm spaces are not exposed to userspace.  Make this
exposure via a separate device, which can now be opened multiple times
because each read/write transaction goes separately via the space.

Concurrency is protected by the chip->tpm_mutex for each read/write
transaction separately.  The TPM is cleared of all transient objects
by the time the mutex is dropped, so there should be no interference
between the kernel and userspace.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/Makefile
drivers/char/tpm/tpm-chip.c
drivers/char/tpm/tpm-interface.c
drivers/char/tpm/tpm.h
drivers/char/tpm/tpmrm-dev.c [new file with mode: 0644]