aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2017-08-04crypto: ccp - Add XTS-AES-256 support for CCP version 5Gary R Hook3-5/+25
Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-04crypto: ccp - Rework the unit-size check for XTS-AESGary R Hook1-37/+20
The CCP supports a limited set of unit-size values. Change the check for this parameter such that acceptable values match the enumeration. Then clarify the conditions under which we must use the fallback implementation. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-04crypto: ccp - Add a call to xts_check_key()Gary R Hook1-1/+8
Vet the key using the available standard function Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-04crypto: ccp - Fix XTS-AES-128 support on v5 CCPsGary R Hook4-10/+41
Version 5 CCPs have some new requirements for XTS-AES: the type field must be specified, and the key requires 512 bits, with each part occupying 256 bits and padded with zeroes. cc: <[email protected]> # 4.9.x+ Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-04crypto: algapi - make crypto_xor() take separate dst and src argumentsArd Biesheuvel2-8/+6
There are quite a number of occurrences in the kernel of the pattern if (dst != src) memcpy(dst, src, walk.total % AES_BLOCK_SIZE); crypto_xor(dst, final, walk.total % AES_BLOCK_SIZE); or crypto_xor(keystream, src, nbytes); memcpy(dst, keystream, nbytes); where crypto_xor() is preceded or followed by a memcpy() invocation that is only there because crypto_xor() uses its output parameter as one of the inputs. To avoid having to add new instances of this pattern in the arm64 code, which will be refactored to implement non-SIMD fallbacks, add an alternative implementation called crypto_xor_cpy(), taking separate input and output arguments. This removes the need for the separate memcpy(). Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03crypto: rockchip - return the err code when unable dequeue the crypto requestZain Wang3-19/+29
Sometime we would unable to dequeue the crypto request, in this case, we should finish crypto and return the err code. Signed-off-by: zain wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03crypto: rockchip - move the crypto completion from interrupt contextZain Wang4-14/+33
It's illegal to call the completion function from hardirq context, it will cause runtime tests to fail. Let's build a new task (done_task) for moving update operation from hardirq context. Signed-off-by: zain wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03hwrng: mx-rngc - add a driver for Freescale RNGCMartin Kaiser3-0/+346
The driver is ported from Freescale's Linux git and can be found in the vendor/freescale/imx_2.6.35_maintain branch. The driver supports both RNG version C that's part of some Freescale i.MX3 SoCs and version B that is available on i.MX2x chipsets. Signed-off-by: Steffen Trumtrar <[email protected]> Signed-off-by: Martin Kaiser <[email protected]> Reviewed-by: PrasannaKumar Muralidharan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03hwrng: Kconfig - Correct help text about feeding entropy poolPrasannaKumar Muralidharan1-4/+2
Modify Kconfig help text to reflect the fact that random data from hwrng is fed into kernel random number generator's entropy pool. Signed-off-by: PrasannaKumar Muralidharan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03crypto: brcm - Support more FlexRM rings than SPU engines.raveendra padasalagi2-66/+56
Enhance code to generically support cases where DMA rings are greater than or equal to number of SPU engines. New hardware has underlying DMA engine-FlexRM with 32 rings which can be used to communicate to any of the available 10 SPU engines. Signed-off-by: Raveendra Padasalagi <[email protected]> Reviewed-by: Scott Branden <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03crypto: atmel-ecc - fix signed integer to u8 assignmentTudor-Dan Ambarus1-5/+5
static checker warning: drivers/crypto/atmel-ecc.c:281 atmel_ecdh_done() warn: assigning (-22) to unsigned variable 'status' Similar warning can be raised in atmel_ecc_work_handler() when atmel_ecc_send_receive() returns an error. Fix this too. Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Tudor Ambarus <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03crypto: ccp - remove duplicate module version and author entryBrijesh Singh1-7/+0
commit 720419f01832 ("crypto: ccp - Introduce the AMD Secure Processor device") moved the module registeration from ccp-dev.c to sp-dev.c but patch missed removing the module version and author entry from ccp-dev.c. It causes the below warning during boot when CONFIG_CRYPTO_DEV_SP_CCP=y and CONFIG_CRYPTO_DEV_CCP_CRYPTO=y is set. [ 0.187825] sysfs: cannot create duplicate filename '/module/ccp/version' [ 0.187825] sysfs: cannot create duplicate filename '/module/ccp/version' Cc: Tom Lendacky <[email protected]> Cc: Gary R Hook <[email protected]> Cc: Herbert Xu <[email protected]> Cc: David S. Miller <[email protected]> Signed-off-by: Brijesh Singh <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03Crypto: atmel-ecc: Make a couple of local functions staticColin Ian King1-2/+2
Functions atmel_ecc_i2c_client_alloc and atmel_ecc_i2c_client_free are local to the source and no not need to be in the global scope. Make them static. Cleans up sparse warnings: symbol 'atmel_ecc_i2c_client_alloc' was not declared. Should it be static? symbol 'atmel_ecc_i2c_client_free' was not declared. Should it be static? Signed-off-by: Colin Ian King <[email protected]> Acked-by: Tudor Ambarus <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03crypto: img-hash - remove unnecessary static in img_hash_remove()Gustavo A. R. Silva1-1/+1
Remove unnecessary static on local variable hdev. Such variable is initialized before being used, on every execution path throughout the function. The static has no benefit and, removing it reduces the object file size. This issue was detected using Coccinelle and the following semantic patch: https://github.com/GustavoARSilva/coccinelle/blob/master/static/static_unused.cocci In the following log you can see a significant difference in the object file size. This log is the output of the size command, before and after the code change: before: text data bss dec hex filename 14842 6464 128 21434 53ba drivers/crypto/img-hash.o after: text data bss dec hex filename 14789 6376 64 21229 52ed drivers/crypto/img-hash.o Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03crypto: atmel-tdes - remove unnecessary static in atmel_tdes_remove()Gustavo A. R. Silva1-1/+1
Remove unnecessary static on local variable tdes_dd. Such variable is initialized before being used, on every execution path throughout the function. The static has no benefit and, removing it reduces the object file size. This issue was detected using Coccinelle and the following semantic patch: https://github.com/GustavoARSilva/coccinelle/blob/master/static/static_unused.cocci In the following log you can see a significant difference in the object file size. This log is the output of the size command, before and after the code change: before: text data bss dec hex filename 17079 8704 128 25911 6537 drivers/crypto/atmel-tdes.o after: text data bss dec hex filename 17039 8616 64 25719 6477 drivers/crypto/atmel-tdes.o Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03crypto: atmel-sha - remove unnecessary static in atmel_sha_remove()Gustavo A. R. Silva1-1/+1
Remove unnecessary static on local variable sha_dd. Such variable is initialized before being used, on every execution path throughout the function. The static has no benefit and, removing it reduces the object file size. This issue was detected using Coccinelle and the following semantic patch: https://github.com/GustavoARSilva/coccinelle/blob/master/static/static_unused.cocci In the following log you can see a significant difference in the object file size. This log is the output of the size command, before and after the code change: before: text data bss dec hex filename 30005 10264 128 40397 9dcd drivers/crypto/atmel-sha.o after: text data bss dec hex filename 29934 10208 64 40206 9d0e drivers/crypto/atmel-sha.o Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03crypto: omap-sham - remove unnecessary static in omap_sham_remove()Gustavo A. R. Silva1-1/+1
Remove unnecessary static on local variable dd. Such variable is initialized before being used, on every execution path throughout the function. The static has no benefit and, removing it reduces the object file size. This issue was detected using Coccinelle and the following semantic patch: https://github.com/GustavoARSilva/coccinelle/blob/master/static/static_unused.cocci In the following log you can see a difference in the object file size. This log is the output of the size command, before and after the code change: before: text data bss dec hex filename 26135 11944 128 38207 953f drivers/crypto/omap-sham.o after: text data bss dec hex filename 26084 11856 64 38004 9474 drivers/crypto/omap-sham.o Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-08-03crypto: n2 - Convert to using %pOF instead of full_nameRob Herring1-32/+28
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <[email protected]> Cc: Herbert Xu <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: [email protected] Signed-off-by: Herbert Xu <[email protected]>
2017-08-03crypto: caam/jr - add support for DPAA2 partsHoria Geantă7-25/+148
Add support for using the caam/jr backend on DPAA2-based SoCs. These have some particularities we have to account for: -HW S/G format is different -Management Complex (MC) firmware initializes / manages (partially) the CAAM block: MCFGR, QI enablement in QICTL, RNG Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-28csrypto: ccp - Expand RSA support for a v5 ccpGary R Hook7-2/+12
A version 5 CCP can handle an RSA modulus up to 16k bits. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-28crypto: ccp - Add support for RSA on the CCPGary R Hook4-0/+347
Wire up the CCP as an RSA cipher provider. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-28crypto: ccp - Fix base RSA function for version 5 CCPsGary R Hook2-34/+54
Version 5 devices have requirements for buffer lengths, as well as parameter format (e.g. bits vs. bytes). Fix the base CCP driver code to meet requirements all supported versions. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-28crypto: ccp - Update copyright dates for 2017.Gary R Hook11-11/+11
Some updates this year have not had copyright dates changed in modified files. Correct this for 2017. Signed-off-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-28crypto: stm32 - Support for STM32 HASH module[email protected]3-0/+1589
This module register a HASH module that support multiples algorithms: MD5, SHA1, SHA224, SHA256. It includes the support of HMAC hardware processing corresponding to the supported algorithms. DMA or IRQ mode are used depending on data length. Signed-off-by: Lionel Debieve <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-28crypto: stm32 - Rename module to use generic crypto[email protected]3-6/+5
The complete stm32 module is rename as crypto in order to use generic naming Signed-off-by: Lionel Debieve <[email protected]> Reviewed-by: Fabien Dessenne <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-28crypto: stm32 - solve crc issue during unbind[email protected]1-1/+1
Use the correct unregister_shashes function to to remove the registered algo Signed-off-by: Lionel Debieve <[email protected]> Reviewed-by: Fabien Dessenne <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-28crypto: stm32 - CRC use relaxed function[email protected]1-7/+8
In case of arm soc support, readl and writel will be optimized using relaxed functions Signed-off-by: Lionel Debieve <[email protected]> Reviewed-by: Fabien Dessenne <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-28crypto: caam - free qman_fq after kill_fqXulin Sun1-6/+4
kill_fq removes a complete frame queue, it needs to free the qman_fq in the last. Else kmemleak will report the below warning: unreferenced object 0xffff800073085c80 (size 128): comm "cryptomgr_test", pid 199, jiffies 4294937850 (age 67.840s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 a0 80 7e 00 00 80 ff ff 00 00 00 00 00 00 00 00 04 00 04 00 5c 01 00 00 backtrace: [<ffff8000001e5760>] create_object+0xf8/0x258 [<ffff800000994e38>] kmemleak_alloc+0x58/0xa0 [<ffff8000001d5f18>] kmem_cache_alloc_trace+0x2c8/0x358 [<ffff8000007e8410>] create_caam_req_fq+0x40/0x170 [<ffff8000007e870c>] caam_drv_ctx_update+0x54/0x248 [<ffff8000007fca54>] aead_setkey+0x154/0x300 [<ffff800000452120>] setkey+0x50/0xf0 [<ffff80000045b144>] __test_aead+0x5ec/0x1028 [<ffff80000045c28c>] test_aead+0x44/0xc8 [<ffff80000045c368>] alg_test_aead+0x58/0xd0 [<ffff80000045bdb4>] alg_test+0x14c/0x308 [<ffff8000004588e8>] cryptomgr_test+0x50/0x58 [<ffff8000000c3b2c>] kthread+0xdc/0xf0 [<ffff800000083c00>] ret_from_fork+0x10/0x50 And check where the function kill_fq() is called to remove the additional kfree to qman_fq and avoid re-calling the released qman_fq. Signed-off-by: Xulin Sun <[email protected]> Acked-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18hwrng: remember rng chosen by userHarald Freudenberger1-2/+19
When a user chooses a rng source via sysfs attribute this rng should be sticky, even when other sources with better quality to register. This patch introduces a simple way to remember the user's choice. This is reflected by a new sysfs attribute file 'rng_selected' which shows if the current rng has been chosen by userspace. The new attribute file shows '1' for user selected rng and '0' otherwise. Signed-off-by: Harald Freudenberger <[email protected]> Reviewed-by: PrasannaKumar Muralidharan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18hwrng: use rng source with best qualityHarald Freudenberger1-6/+19
This patch rewoks the hwrng to always use the rng source with best entropy quality. On registation and unregistration the hwrng now tries to choose the best (= highest quality value) rng source. The handling of the internal list of registered rng sources is now always sorted by quality and the top most rng chosen. Signed-off-by: Harald Freudenberger <[email protected]> Reviewed-by: PrasannaKumar Muralidharan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam - fix condition for the jump over key(s) commandTudor Ambarus1-3/+2
SELF condition has no meaning for the SERIAL sharing since the jobs are executed in the same DECO. Signed-off-by: Tudor Ambarus <[email protected]> Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam - clean-up in caam_init_rng()Horia Geantă1-5/+1
Clean up the code, as indicated by Coccinelle. Cc: Julia Lawall <[email protected]> Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam - remove unused variables in caam_drv_privateTudor Ambarus2-4/+0
Signed-off-by: Tudor Ambarus <[email protected]> Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam - remove unused sg_to_sec4_sg_len()Horia Geantă1-15/+0
sg_to_sec4_sg_len() is no longer used since commit 479bcc7c5b9e ("crypto: caam - Convert authenc to new AEAD interface") Its functionality has been superseded by the usage of sg_nents_for_len() returning the number of S/G entries corresponding to the provided length. Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam/qi - lower driver verbosityHoria Geantă1-4/+4
Change log level for some prints from dev_info() to dev_dbg(), low-level details are needed only when debugging. Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam/qi - remove unused header sg_sw_sec4.hHoria Geantă1-1/+0
sg_sw_sec4.h header is not used by caam/qi, thus remove its inclusion. Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam/qi - explicitly set dma_opsHoria Geantă1-0/+1
Since ARM64 commit 1dccb598df549 ("arm64: simplify dma_get_ops"), dma_ops no longer default to swiotlb_dma_ops, but to dummy_dma_ops. dma_ops have to be explicitly set in the driver - at least for ARM64. Fixes: 67c2315def06 ("crypto: caam - add Queue Interface (QI) backend support") Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam/qi - fix AD length endianness in S/G entryHoria Geantă1-1/+4
Associated data (AD) length is read by CAAM from an S/G entry that is initially filled by the GPP. Accordingly, AD length has to be stored in CAAM endianness. Fixes: b189817cf789 ("crypto: caam/qi - add ablkcipher and authenc algorithms") Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam/qi - handle large number of S/Gs caseHoria Geantă3-4/+34
For more than 16 S/G entries, driver currently corrupts memory on ARMv8, see below KASAN log. Note: this does not reproduce on PowerPC due to different (smaller) cache line size - 64 bytes on PPC vs. 128 bytes on ARMv8. One such use case is one of the cbc(aes) test vectors - with 8 S/G entries and src != dst. Driver needs 1 (IV) + 2 x 8 = 17 entries, which goes over the 16 S/G entries limit: (CAAM_QI_MEMCACHE_SIZE - offsetof(struct ablkcipher_edesc, sgt)) / sizeof(struct qm_sg_entry) = 256 / 16 = 16 S/Gs Fix this by: -increasing object size in caamqicache pool from 512 to 768; this means the maximum number of S/G entries grows from (at least) 16 to 32 (again, for ARMv8 case of 128-byte cache line) -add checks in the driver to fail gracefully (ENOMEM) in case the 32 S/G entries limit is exceeded ================================================================== BUG: KASAN: slab-out-of-bounds in ablkcipher_edesc_alloc+0x4ec/0xf60 Write of size 1 at addr ffff800021cb6003 by task cryptomgr_test/1394 CPU: 3 PID: 1394 Comm: cryptomgr_test Not tainted 4.12.0-rc7-next-20170703-00023-g72badbcc1ea7-dirty #26 Hardware name: LS1046A RDB Board (DT) Call trace: [<ffff20000808ac6c>] dump_backtrace+0x0/0x290 [<ffff20000808b014>] show_stack+0x14/0x1c [<ffff200008d62c00>] dump_stack+0xa4/0xc8 [<ffff200008264e40>] print_address_description+0x110/0x26c [<ffff200008265224>] kasan_report+0x1d0/0x2fc [<ffff2000082637b8>] __asan_store1+0x4c/0x54 [<ffff200008b4884c>] ablkcipher_edesc_alloc+0x4ec/0xf60 [<ffff200008b49304>] ablkcipher_encrypt+0x44/0xcc [<ffff20000848a61c>] skcipher_encrypt_ablkcipher+0x120/0x138 [<ffff200008495014>] __test_skcipher+0xaec/0xe30 [<ffff200008497088>] test_skcipher+0x6c/0xd8 [<ffff200008497154>] alg_test_skcipher+0x60/0xe4 [<ffff2000084974c4>] alg_test.part.13+0x130/0x304 [<ffff2000084976d4>] alg_test+0x3c/0x68 [<ffff2000084938ac>] cryptomgr_test+0x54/0x5c [<ffff20000810276c>] kthread+0x188/0x1c8 [<ffff2000080836c0>] ret_from_fork+0x10/0x50 Allocated by task 1394: save_stack_trace_tsk+0x0/0x1ac save_stack_trace+0x18/0x20 kasan_kmalloc.part.5+0x48/0x110 kasan_kmalloc+0x84/0xa0 kasan_slab_alloc+0x14/0x1c kmem_cache_alloc+0x124/0x1e8 qi_cache_alloc+0x28/0x58 ablkcipher_edesc_alloc+0x244/0xf60 ablkcipher_encrypt+0x44/0xcc skcipher_encrypt_ablkcipher+0x120/0x138 __test_skcipher+0xaec/0xe30 test_skcipher+0x6c/0xd8 alg_test_skcipher+0x60/0xe4 alg_test.part.13+0x130/0x304 alg_test+0x3c/0x68 cryptomgr_test+0x54/0x5c kthread+0x188/0x1c8 ret_from_fork+0x10/0x50 Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff800021cb5e00 which belongs to the cache caamqicache of size 512 The buggy address is located 3 bytes to the right of 512-byte region [ffff800021cb5e00, ffff800021cb6000) The buggy address belongs to the page: page:ffff7e0000872d00 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0xfffc00000008100(slab|head) raw: 0fffc00000008100 0000000000000000 0000000000000000 0000000180190019 raw: dead000000000100 dead000000000200 ffff800931268200 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff800021cb5f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff800021cb5f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff800021cb6000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff800021cb6080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff800021cb6100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== Fixes: b189817cf789 ("crypto: caam/qi - add ablkcipher and authenc algorithms") Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam/qi - properly set IV after {en,de}cryptHoria Geantă1-1/+8
caam/qi needs a fix similar to what was done for caam/jr in commit "crypto: caam/qi - properly set IV after {en,de}crypt", to allow for ablkcipher/skcipher chunking/streaming. Cc: <[email protected]> Fixes: b189817cf789 ("crypto: caam/qi - add ablkcipher and authenc algorithms") Suggested-by: David Gstir <[email protected]> Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam/qi - fix compilation with CONFIG_DEBUG_FORCE_WEAK_PER_CPU=yHoria Geantă1-1/+1
caam/qi driver fails to compile when CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y. Fix it by making the offending local per_cpu variable global. Cc: <[email protected]> Fixes: 67c2315def06c ("crypto: caam - add Queue Interface (QI) backend support") Reported-by: kbuild test robot <[email protected]> Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam/qi - fix compilation with DEBUG enabledHoria Geantă4-54/+62
caam/qi driver does not compile when DEBUG is enabled (CRYPTO_DEV_FSL_CAAM_DEBUG=y): drivers/crypto/caam/caamalg_qi.c: In function 'ablkcipher_done': drivers/crypto/caam/caamalg_qi.c:794:2: error: implicit declaration of function 'dbg_dump_sg' [-Werror=implicit-function-declaration] dbg_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", Since dbg_dump_sg() is shared between caam/jr and caam/qi, move it in a shared location and export it. At the same time: -reduce ifdeferry by providing a no-op implementation for !DEBUG case -rename it to caam_dump_sg() to be consistent in terms of exported symbols namespace (caam_*) Cc: <[email protected]> Fixes: b189817cf789 ("crypto: caam/qi - add ablkcipher and authenc algorithms") Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: caam/qi - fix typo in authenc alg driver nameHoria Geantă1-1/+1
s/desi/des for echainiv(authenc(hmac(sha256),cbc(des))) alg. Cc: <[email protected]> Fixes: b189817cf7894 ("crypto: caam/qi - add ablkcipher and authenc algorithms") Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: brcm - add NULL check on of_match_device() return valueGustavo A. R. Silva1-0/+5
Check return value from call to of_match_device() in order to prevent a NULL pointer dereference. In case of NULL print error message and return -ENODEV Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: geode-aes - fixed coding style warnings and errorChris Gorman1-7/+10
fixed WARNING: Block comments should align the * on each line fixed WARNINGs: Missing a blank line after declarations fixed ERROR: space prohibited before that ',' (ctx:WxE) Signed-off-by: Chris Gorman <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: ccp - remove ccp_present() check from device initializeBrijesh Singh1-12/+0
Since SP device driver supports multiples devices (e.g CCP, PSP), we should not fail the driver init just because CCP device is not found. Signed-off-by: Brijesh Singh <[email protected]> Acked-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: ccp - rename ccp driver initialize files as sp deviceBrijesh Singh5-93/+87
CCP device initializes is now integerated into higher level SP device, to avoid the confusion lets rename the ccp driver initialization files (ccp-platform.c->sp-platform.c, ccp-pci.c->sp-pci.c). The patch does not make any functional changes other than renaming file and structures Signed-off-by: Brijesh Singh <[email protected]> Acked-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: ccp - Abstract interrupt registerationBrijesh Singh8-115/+188
The CCP and PSP devices part of AMD Secure Procesor may share the same interrupt. Hence we expand the SP device to register a common interrupt handler and provide functions to CCP and PSP devices to register their interrupt callback which will be invoked upon interrupt. Signed-off-by: Brijesh Singh <[email protected]> Acked-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: ccp - Introduce the AMD Secure Processor deviceBrijesh Singh11-160/+460
The CCP device is part of the AMD Secure Processor. In order to expand the usage of the AMD Secure Processor, create a framework that allows functional components of the AMD Secure Processor to be initialized and handled appropriately. Signed-off-by: Brijesh Singh <[email protected]> Acked-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2017-07-18crypto: ccp - Use devres interface to allocate PCI/iomap and cleanupBrijesh Singh5-138/+106
Update pci and platform files to use devres interface to allocate the PCI and iomap resources. Also add helper functions to consolicate module init, exit and power mangagement code duplication. Signed-off-by: Brijesh Singh <[email protected]> Acked-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>