OSDN Git Service

crypto: ccp - fix the SEV probe in kexec boot path
authorSingh, Brijesh <brijesh.singh@amd.com>
Wed, 30 Jan 2019 20:57:52 +0000 (20:57 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 Feb 2019 07:29:48 +0000 (15:29 +0800)
commitf8903b3ead5191d450f21c7388ddc245f76cec0f
treeebb558ad9faf526d90356641fbd5a80931632e05
parente3d90e52ea5fe58d39297df1c825db6e131fb04f
crypto: ccp - fix the SEV probe in kexec boot path

A kexec reboot may leave the firmware in INIT or WORKING state.
Currently, we issue PLATFORM_INIT command during the probe without
checking the current state. The PLATFORM_INIT command fails if the
FW is already in INIT state. Lets check the current state, if FW
is not in UNINIT state then transition it to UNINIT before
initializing or upgrading the FW.

Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Gary Hook <gary.hook@amd.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/psp-dev.c