]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit7519f7d8eba036675501def30c2295fa7bbff9a4
tree7efedd3af105c818c9cfb68e32892eb19fd499fb
parent653669992e07e250543dbf3bd9744f06c8b6c98b
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