android_kernel_motorola_sm6225/drivers/char/tpm
Stefan Berger 6674ff145e tpm_ibmvtpm: properly handle interrupted packet receptions
When the TPM response reception is interrupted in the wait_event_interruptable
call, the TPM is still busy processing the command and will only deliver the
response later. So we have to wait for an outstanding response before sending
a new request to avoid trying to put a 2nd request into the CRQ. Also reset
the res_len before sending a command so we will end up in that
wait_event_interruptable() waiting for the response rather than reading the
command packet as a response.

The easiest way to trigger the problem is to run the following

cd /sys/device/vio/71000004

while :; cat pcrs >/dev/null; done

And press Ctrl-C. This will then display an error

tpm_ibmvtpm 71000004: tpm_transmit: tpm_recv: error -4

followed by several other errors once interaction with the TPM resumes.

tpm_ibmvtpm 71000004: A TPM error (101) occurred attempting to determine the number of PCRS.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: Hon Ching(Vicky) Lo <honclo@linux.vnet.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Ashley Lai <ashley@ashleylai.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
2015-12-20 15:27:12 +02:00
..
st33zp24 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2015-11-05 15:32:38 -08:00
Kconfig tpm: Update KConfig text to include TPM2.0 FIFO chips 2015-03-18 22:43:07 +01:00
Makefile tpm/tpm_i2c_stm_st33: Split tpm_i2c_tpm_st33 in 2 layers (core + phy) 2015-03-18 22:43:06 +01:00
tpm-chip.c tpm: fix compat 'ppi' link handling in tpm_chip_register() 2015-11-09 17:52:56 +02:00
tpm-dev.c tpm: device class for tpm 2015-01-17 14:00:10 +01:00
tpm-interface.c tpm: rework tpm_get_timeouts() 2015-12-20 15:23:46 +02:00
tpm-sysfs.c tpm: rename chip->dev to chip->pdev 2015-01-17 14:00:09 +01:00
tpm.h tpm_tis: Get rid of the duplicate IRQ probing code 2015-12-20 15:26:25 +02:00
tpm2-cmd.c tpm: fix missing migratable flag in sealing functionality for TPM2 2015-11-09 17:52:55 +02:00
tpm_acpi.c ACPI: Clean up acpi_os_map/unmap_memory() to eliminate __iomem. 2014-05-27 18:13:08 +02:00
tpm_atmel.c tpm: rename chip->dev to chip->pdev 2015-01-17 14:00:09 +01:00
tpm_atmel.h tpmdd maintainers 2007-08-22 19:52:44 -07:00
tpm_crb.c tpm: rework tpm_get_timeouts() 2015-12-20 15:23:46 +02:00
tpm_eventlog.c vTPM: support little endian guests 2015-10-19 01:09:30 +02:00
tpm_eventlog.h vTPM: support little endian guests 2015-10-19 01:09:30 +02:00
tpm_i2c_atmel.c char: Drop owner assignment from i2c_driver 2015-10-19 01:05:27 +02:00
tpm_i2c_infineon.c char: Drop owner assignment from i2c_driver 2015-10-19 01:05:27 +02:00
tpm_i2c_nuvoton.c char: Drop owner assignment from i2c_driver 2015-10-19 01:05:27 +02:00
tpm_ibmvtpm.c tpm_ibmvtpm: properly handle interrupted packet receptions 2015-12-20 15:27:12 +02:00
tpm_ibmvtpm.h tpm_ibmvtpm: properly handle interrupted packet receptions 2015-12-20 15:27:12 +02:00
tpm_infineon.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2015-04-15 11:08:27 -07:00
tpm_nsc.c tpm: rename chip->dev to chip->pdev 2015-01-17 14:00:09 +01:00
tpm_of.c TPM: Avoid reference to potentially freed memory 2015-11-09 17:52:55 +02:00
tpm_ppi.c tpm: move the PPI attributes to character device directory. 2015-10-19 01:01:20 +02:00
tpm_tis.c tpm_tis: Tighten IRQ auto-probing 2015-12-20 15:26:28 +02:00
xen-tpmfront.c xenbus_client: Extend interface to support multi-page ring 2015-04-15 10:56:47 +01:00