tpm: Fix cancellation of TPM commands (polling mode)
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Tue, 22 Jan 2013 19:52:35 +0000 (13:52 -0600)
committerKent Yoder <key@linux.vnet.ibm.com>
Tue, 5 Feb 2013 15:38:24 +0000 (09:38 -0600)
commit1f866057291fc00f14e4962473bd7724ffa8f578
treeea780b029f24530a32913fa983a60f1a01a4d0d4
parent3e3a5e906998b090ad929010a5f5082ac0dbbdfb
tpm: Fix cancellation of TPM commands (polling mode)

On one of my machines the cancellation of TPM commands does not work.
The reason is that by writing into sysfs 'cancel' the tpm_tis_ready
call causes the status flag TPM_STS_VALID to be set in the statusregister.
However, the TIS driver seems to wait for TPM_STS_COMMAND_READY.
Once a 2nd time sysfs 'cancel' is written to, the TPM_STS_COMMAND_READY flag
also gets set, resulting in TPM_STS_VALID|TPM_STS_COMMAND_READY to be
read from the status register.

This patch now converts req_canceled into a function to enable more complex
comparisons against possible cancellation status codes.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
drivers/char/tpm/tpm.c
drivers/char/tpm/tpm.h
drivers/char/tpm/tpm_atmel.c
drivers/char/tpm/tpm_i2c_infineon.c
drivers/char/tpm/tpm_i2c_stm_st33.c
drivers/char/tpm/tpm_ibmvtpm.c
drivers/char/tpm/tpm_nsc.c
drivers/char/tpm/tpm_tis.c