OSDN Git Service

crypto: ccp - Verify access to device registers before initializing
authorHook, Gary <Gary.Hook@amd.com>
Mon, 21 Oct 2019 13:44:44 +0000 (13:44 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 25 Oct 2019 15:09:59 +0000 (02:09 +1100)
commit03f008c52b76114b83483de2cf15ed36fc34930c
tree7efedd3af105c818c9cfb68e32892eb19fd499fb
parent0d3c6781d8d80090509ebb0c72587e6c44da4736
crypto: ccp - Verify access to device registers before initializing

Check early whether device registers can be accessed. Some BIOSes have
a broken security policy that prevents access to the device registers,
and return values from ioread() can be misinterpreted. If a read of
a feature register returns a -1, we may not be able to access
any device register, so report the problem and suggestion, and return.

For the PSP, the feature register is checked. For the CCP, the queue
register is checked.

Signed-off-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/ccp-dev-v5.c
drivers/crypto/ccp/psp-dev.c