]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - include/linux/tpm.h
tpm: cmd_ready command can be issued only after granting locality
authorTomas Winkler <tomas.winkler@intel.com>
Mon, 5 Mar 2018 11:34:49 +0000 (13:34 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Tue, 12 Jun 2018 06:28:55 +0000 (02:28 -0400)
commit036551188fe0b3035e9e653dbff48e1d24357d09
tree7e03f512522aa429a5bdf86d44ba6ce354e15a62
parent1353536cdedc485061a0cda49aa6585b91ed0e74
tpm: cmd_ready command can be issued only after granting locality

BugLink: http://bugs.launchpad.net/bugs/1775483
commit 888d867df4417deffc33927e6fc2c6925736fe92 upstream.

The correct sequence is to first request locality and only after
that perform cmd_ready handshake, otherwise the hardware will drop
the subsequent message as from the device point of view the cmd_ready
handshake wasn't performed. Symmetrically locality has to be relinquished
only after going idle handshake has completed, this requires that
go_idle has to poll for the completion and as well locality
relinquish has to poll for completion so it is not overridden
in back to back commands flow.

Two wrapper functions are added (request_locality relinquish_locality)
to simplify the error handling.

The issue is only visible on devices that support multiple localities.

Fixes: 877c57d0d0ca ("tpm_crb: request and relinquish locality 0")
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkine@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkine@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkine@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/char/tpm/tpm-interface.c
drivers/char/tpm/tpm_crb.c
drivers/char/tpm/tpm_tis_core.c
include/linux/tpm.h