| Age | Commit message (Collapse) | Author | Files | Lines |
|
The ccree driver is now in the cryptodev tree, so remove it from
drivers/staging as it's no longer needed here.
Based on a patch from Gilad, but the mailing list didn't like it :(
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The driver uses a mixture of signed and unsigned integer variables for
holding arrays lengths and indices, which gives rise to the following
sparse warnings when the addresses of signed variables are passed to
functions expecting pointers to unsigned integers:
drivers/staging/ccree/cc_buffer_mgr.c:1050:46: warning: incorrect type in argument 4 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1050:46: expected unsigned int [usertype] *lbytes
drivers/staging/ccree/cc_buffer_mgr.c:1050:46: got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1083:62: warning: incorrect type in argument 7 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1083:62: expected unsigned int [usertype] *lbytes
drivers/staging/ccree/cc_buffer_mgr.c:1083:62: got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1092:46: warning: incorrect type in argument 4 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1092:46: expected unsigned int [usertype] *lbytes
drivers/staging/ccree/cc_buffer_mgr.c:1092:46: got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1120:49: warning: incorrect type in argument 4 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1120:49: expected unsigned int [usertype] *src_last_bytes
drivers/staging/ccree/cc_buffer_mgr.c:1120:49: got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1121:49: warning: incorrect type in argument 5 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1121:49: expected unsigned int [usertype] *dst_last_bytes
drivers/staging/ccree/cc_buffer_mgr.c:1121:49: got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1124:49: warning: incorrect type in argument 2 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1124:49: expected unsigned int [usertype] *src_last_bytes
drivers/staging/ccree/cc_buffer_mgr.c:1124:49: got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1125:44: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1125:44: expected unsigned int [usertype] *dst_last_bytes
drivers/staging/ccree/cc_buffer_mgr.c:1125:44: got int *<noident>
drivers/staging/ccree/cc_cipher.c:697:67: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_cipher.c:697:67: expected unsigned int *seq_size
drivers/staging/ccree/cc_cipher.c:697:67: got int *<noident>
drivers/staging/ccree/cc_cipher.c:700:31: warning: incorrect type in argument 8 (different signedness)
drivers/staging/ccree/cc_cipher.c:700:31: expected unsigned int *seq_size
drivers/staging/ccree/cc_cipher.c:700:31: got int *<noident>
drivers/staging/ccree/cc_hash.c:480:57: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_hash.c:480:57: expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:480:57: got int *<noident>
drivers/staging/ccree/cc_hash.c:530:57: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_hash.c:530:57: expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:530:57: got int *<noident>
drivers/staging/ccree/cc_hash.c:1305:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1305:43: expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1305:43: got int *<noident>
drivers/staging/ccree/cc_hash.c:1307:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1307:43: expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1307:43: got int *<noident>
drivers/staging/ccree/cc_hash.c:1317:69: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_hash.c:1317:69: expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1317:69: got int *<noident>
drivers/staging/ccree/cc_hash.c:1390:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1390:43: expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1390:43: got int *<noident>
drivers/staging/ccree/cc_hash.c:1393:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1393:43: expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1393:43: got int *<noident>
drivers/staging/ccree/cc_hash.c:1404:69: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_hash.c:1404:69: expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1404:69: got int *<noident>
drivers/staging/ccree/cc_hash.c:1469:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1469:43: expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1469:43: got int *<noident>
drivers/staging/ccree/cc_hash.c:1472:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1472:43: expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1472:43: got int *<noident>
drivers/staging/ccree/cc_hash.c:1483:69: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_hash.c:1483:69: expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1483:69: got int *<noident>
drivers/staging/ccree/cc_aead.c:2011:37: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_aead.c:2011:37: expected unsigned int *seq_size
drivers/staging/ccree/cc_aead.c:2011:37: got int *<noident>
drivers/staging/ccree/cc_aead.c:2017:45: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_aead.c:2017:45: expected unsigned int *seq_size
drivers/staging/ccree/cc_aead.c:2017:45: got int *<noident>
drivers/staging/ccree/cc_aead.c:2020:45: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_aead.c:2020:45: expected unsigned int *seq_size
drivers/staging/ccree/cc_aead.c:2020:45: got int *<noident>
drivers/staging/ccree/cc_aead.c:2024:44: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_aead.c:2024:44: expected unsigned int *seq_size
drivers/staging/ccree/cc_aead.c:2024:44: got int *<noident>
drivers/staging/ccree/cc_aead.c:2026:44: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_aead.c:2026:44: expected unsigned int *seq_size
drivers/staging/ccree/cc_aead.c:2026:44: got int *<noident>
This patch fixes those warnings by converting those signed variables to
unsigned as follows:
* changed the types of a number of index and length variables from
signed to unsigned integer types.
* changed the return-types of a couple of functions that return length
values which are assigned to one of these variables from signed to
unsigned integer types.
Signed-off-by: Jeremy Sowden <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Fix the following warning found by checkpatch.pl
WARNING: Missing a blank line after declarations
+ struct cc_cipher_handle *blkcipher_handle = drvdata->blkcipher_handle;
+ if (blkcipher_handle) {
Signed-off-by: Kamal Heib <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The current error exit path in function cc_ivgen_init via label
'out' free's resources from the drvdata->ivgen_handle context.
However, drvdata->ivgen_handle has not been assigned to the
context ivgen_ctx at this point, so the resources are not freed.
Fix this by setting drvdata->ivgen_handle to ivgen_ctx as early
as possible so that the clean up error exit return path can free
the resources.
Detected by CoveritScan, CID#1463795 ("Resource leak")
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
These lines are less than 80 characters so we don't need to break them
up into chunks.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The dma mask var was defined as dma_addr_t but should be
u64. This showed as a sparse warning when building for 32 bit.
Fix it by changing type to u64 and drop the cast.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The debugfs interface defines stub function if debugfs is not
enabled, which were missing the 'static inline' qualifiers causing
sparse warnings.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Add the missing include of include file with function declarations.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Remove include files not needed for compilation.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The ccree driver source files were using an inconsistent
naming convention stemming from what the company was called
when they were added.
Move to a single consistent naming convention for better
code readability.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Update TODO to reflect work done
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
We were allocating buffers using sizeof(*struct->field) where field was
type void. Fix it by having a local variable with the real type.
Cc: [email protected]
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Put pointer next to var name as per coding style.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Fold common code in hash call into service functions.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Fix indentation of some function params in hash code for
better readability.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
hash_init was mapping DMA memory that were then being unmap in
hash_digest/final/finup callbacks, which is against the Crypto API
usage rules (see discussion at
https://www.mail-archive.com/[email protected]/msg30077.html)
Fix it by moving all buffer mapping/unmapping or each Crypto API op.
This also properly deals with hash_import() not knowing if
hash_init was called or not as it now no longer matters.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Move to allocating the buffers needed for requests as part of
the request structure instead of malloc'ing each one on it's
own, making for simpler (and more efficient) code.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The ccree hash code is using a double buffer to hold data
for processing but manages the buffers and their associated
data count in two separate fields and uses a predicate to
chose which to use.
Move to using a proper 2 members array for a much cleaner code.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Remove unused struct field.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Replace ugly ifdefs with some inline macros and Makefile magic
for optionally including power management related code for
better readability.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
If we are asked for number of entries of an offset bigger than the
sg list we should not crash.
Cc: [email protected]
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
If we ran out of DMA pool buffers, we get into the unmap
code path with a NULL before. Deal with this by checking
the virtual mapping is not NULL.
Cc: [email protected]
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
PM suspend returning a none zero value is not an error. It simply
indicates a suspend is not advised right now so don't treat it as
an error.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This reverts commit c5f39d07860c ("staging: ccree: fix leak of import()
after init()") and commit aece09024414 ("staging: ccree: Uninitialized
return in ssi_ahash_import()").
This is the wrong solution and ends up relying on uninitialized memory,
although it was not obvious to me at the time.
Cc: [email protected]
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Crypto API tfm providers are required to provide a backlog
service, if so indicated, that queues up requests in the case
of the provider being busy and processing them later.
The ccree driver did not provide this facility. Add it now.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The send_request() function was handling both synchronous
and asynchronous invocations, but were not handling
the asynchronous case, which may be called in an atomic
context, properly as it was sleeping.
Start to fix the problem by breaking up the two use
cases to separate functions calling a common internal
service function and return error instead of sleeping
for the asynchronous case.
The next patch will complete the fix by implementing
proper backlog handling.
Fixes: abefd6741d ("staging: ccree: introduce CryptoCell HW driver").
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Remove the unused monitor_desc field.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The debugfs global init and exit functions were missing
__init and __exit tags, potentially wasting memory.
Fix it by properly tagging them.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The ccree driver was using a DMA operation to copy larval digest
from the ccree SRAM to RAM. Replace it with a simple memcpy.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The ccree driver was allocating memory using GFP_KERNEL flag
always, ignoring the flags set in the crypto request. Fix it
by choosing gfp flags based on crypto request flags.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Remove bogus GFP_DMA flag from memory allocations. ccree driver
does not operate over an ISA or similar limited bus.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Fold the 2 macro defined in dx_reg_common.h into the file they
are used in and delete the file.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Fold the two remaining enum in hash defs into the queue defs
that are using them and delete the hash defs include file.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Replace verbatim GPL v2 copy with SPDX tag.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The global array clashes with an existing symbol of the same name:
drivers/staging/ccree/cc_debugfs.o:(.data+0x0): multiple definition of `debug_regs'
drivers/mmc/host/s3cmci.o:(.data+0x70): first defined here
We should fix both, this one addresses the ccree driver by removing
the symbol from the global namespace.
Fixes: 9bdd203b4dc8 ("s3cmci: add debugfs support for examining driver and hardware state")
Fixes: b3ec9a6736f2 ("staging: ccree: staging: ccree: replace sysfs by debugfs interface")
Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Fix declaration, implementation and wrapper function to use
the same size_t type we actually define the parameter to be.
Fixes: 3f268f5d6669 ("staging: ccree: turn compile time debug log to params")
Reported-by: kbuild test robot <[email protected]>
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This patch adds a blank line after declarations to
improve code readability.
Issue find by checkpatch.pl script.
WARNING: Missing a blank line after declarations
Signed-off-by: Kamal Heib <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Update TODO with handling on sysfs -> debugfs transition
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
When moving from internal for kernel FIPS infrastructure the FIPS event irq
handling code was left with the old ifdef by mistake. Fix it.
Fixes: b7e607bf33a2 ("staging: ccree: move FIPS support to kernel infrastructure")
Cc: [email protected]
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Now that the only thing left in ssi_config is the maximum
DMA mask length we get move that to ssi_driver.h and get
rid of the file.
All of ccree is now runtime configurable or under Kbuild control.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The ccree driver has some support to dump runtime data
to kernel log to assist in debugging. The code used to be
enabled by a build time flag. Refactor to enable it via
module/kernel parameters.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Remove a bunch of useless debug code ifdef'ed out
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Remove dead code from older version which is not supported in current
hardware.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The ccree driver has had a none standard sysfs interface for debugging.
Replace it with a proper debugfs interface.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
We need to do a module global scope init/exit operation to support
the debugfs interface we are about to introduce in the next patch,
so wean the module of the boiler plate saving macro as it will no
longer be sufficient.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Clean up power management registration.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
As we already depend on CONFIG_OF via Kconfig no need to
support conditional build without it.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
We want the staging fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The FIPS manager files were using a naming convention which was
inconsistent (ssi vs. cc) and often too long.
Make the code more readable by switching to a simpler, consistent naming
convention.
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|