07 Sep, 2016
3 commits
-
This patch move the whole crypto engine API to its own header
crypto/engine.h.Signed-off-by: Corentin Labbe
Signed-off-by: Herbert Xu -
Fix incorrect value of ADF_C3XXX_ACCELERATORS_MASK.
Signed-off-by: Maksim Lukoshkov
Signed-off-by: Giovanni Cabiddu
Signed-off-by: Herbert Xu -
Check return value of of_iomap and handle errors correctly.
Signed-off-by: Arvind Yadav
Acked-by: Eric Anholt
Signed-off-by: Herbert Xu
31 Aug, 2016
14 commits
-
Copy const_tab array into DMA-able memory (accesible by qat hw).
Signed-off-by: Maksim Lukoshkov
Signed-off-by: Giovanni Cabiddu
Signed-off-by: Herbert Xu -
By using devm_hwrng_register instead of hwrng_register the .remove
callback in platform_driver can be removed. This reduces a few lines in
code.Signed-off-by: PrasannaKumar Muralidharan
Signed-off-by: Herbert Xu -
HW RNG core never asks for data less than 4 bytes. The check whether max
is less than 4 bytes is unnecessary. Remove the check.Signed-off-by: PrasannaKumar Muralidharan
Signed-off-by: Herbert Xu -
This patch convert the hwrng interface used by amd768-rng to its new API
by replacing data_read()/data_present() by read().Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
Instead of accessing hw directly via pmbase, it's better to
access after ioport_map() via ioread32/iowrite32.Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
Instead of having two global variable, it's better to use a
private struct. This will permit to remove amd_pdev variableSigned-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
The driver release the memory region before being sure that nobody use
it.This patch made hwrng_unregister ran before any release was done.
Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
checkpatch complains about used instead of linux/io.h.
In fact it is not needed.
This patch remove it, and in the process, alphabetize the other headers.Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
The driver name is displayed each time differently.
This patch make use of the same name everywhere.Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
This patch add usage of the BIT() macro
Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
Some blank line are unncessary, and one is missing after declaration.
This patch fix thoses style problems.Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
We get 1 warning when biuld kernel with W=1:
drivers/crypto/caam/ctrl.c:398:5: warning: no previous prototype for 'caam_get_era' [-Wmissing-prototypes]In fact, this function is declared in drivers/crypto/caam/ctrl.h,
so this patch add missing header dependencies.Signed-off-by: Baoyou Xie
Signed-off-by: Herbert Xu -
The Cavium ThunderX SoC has a hardware random number generator.
This driver provides support using the HWRNG framework.Signed-off-by: Omer Khaliq
Signed-off-by: Ananth Jasty
Acked-by: David Daney
Signed-off-by: Herbert Xu -
Cavium cn88xx hardware presents an incorrect SR-IOV Function
Dependency Link, add a fixup quirk for the affected devices.Acked-by: David Daney
Signed-off-by: Ananth Jasty
Signed-off-by: Omer Khaliq
Acked-by: Bjorn Helgaas
Signed-off-by: Herbert Xu
24 Aug, 2016
4 commits
-
If devm_add_action() fails we are explicitly calling the cleanup to free
the resources allocated. Lets use the helper devm_add_action_or_reset()
and return directly in case of error, as we know that the cleanup function
has been already called by the helper if there was any error.Signed-off-by: Sudip Mukherjee
Reviewed-by: Heiko Stuebner
Signed-off-by: Herbert Xu -
clk_prepare_enable() may fail, so we should better check its return
value and propagate it in the case of failure.Signed-off-by: Fabio Estevam
Signed-off-by: Herbert Xu -
Remove omap3_rom_rng_data_present method as it was returning 1 always.
Use .read callback instead of .data_read callback. This avoids use of
obsolete callbacks.This patch is not tested with hardware as I don't have access to it.
Signed-off-by: PrasannaKumar Muralidharan
Signed-off-by: Herbert Xu -
Add the missing unlock before return from function sun4i_hash()
in the error handling case.Fixes: 477d9b2e591b ("crypto: sun4i-ss - unify update/final function")
Signed-off-by: Wei Yongjun
Acked-by: Corentin LABBE
Signed-off-by: Herbert Xu
16 Aug, 2016
8 commits
-
The field "owner" is set by the core.
Thus delete an unneeded initialisation.Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
Signed-off-by: Markus Elfring
Signed-off-by: Herbert Xu -
Fixes the following sparse warning:
drivers/crypto/ccp/ccp-dev.c:62:14: warning:
symbol 'ccp_increment_unit_ordinal' was not declared. Should it be static?Signed-off-by: Wei Yongjun
Signed-off-by: Herbert Xu -
Two crypto alg are badly indented, this patch fix this style issue.
Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
The dev *ss is stored both in sun4i_tfm_ctx and sun4i_req_ctx.
Since this pointer will never be changed during tfm life, it is better
to remove it from sun4i_req_ctx.Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
Two words are badly spelled, this patch respell them.
Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
The ss variable is never used, remove it.
Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
The update and final functions have lots of common action.
This patch mix them in one function.
This will give some improvements:
- This will permit asynchronous support more easily
- This will permit to use finup/digest functions with some performance
improvementsSigned-off-by: LABBE Corentin
Signed-off-by: Herbert Xu -
The variable i is always checked against unsigned value and cannot be
negative.
This patch set it as unsigned.Signed-off-by: LABBE Corentin
Signed-off-by: Herbert Xu
09 Aug, 2016
11 commits
-
Don't use 64 'as is', as max block size in mv_cesa_ahash_cache_req. Use
CESA_MAX_HASH_BLOCK_SIZE instead, this is better for readability.Signed-off-by: Romain Perier
Signed-off-by: Herbert Xu -
Currently, in mv_cesa_{md5,sha1,sha256}_init creq->state is initialized
before the call to mv_cesa_ahash_init. This is wrong because this
function fills creq with zero by using memset, so its 'state' that
contains the default DIGEST is overwritten. This commit fixes the issue
by initializing creq->state just after the call to mv_cesa_ahash_init.Fixes: commit b0ef51067cb4 ("crypto: marvell/cesa - initialize hash...")
Signed-off-by: Romain Perier
Signed-off-by: Herbert Xu -
So far, sub part of mv_cesa_int was responsible of dequeuing complete
requests, then call the 'cleanup' operation on these reqs and call the
crypto api callback 'complete'. The problem is that the transformation
context 'ctx' is retrieved only once before the while loop. Which means
that the wrong 'cleanup' operation might be called on the wrong type of
cesa requests, it can lead to memory corruptions with this message:marvell-cesa f1090000.crypto: dma_pool_free cesa_padding, 5a5a5a5a/5a5a5a5a (bad dma)
This commit fixes the issue, by updating the transformation context for
each dequeued cesa request.Fixes: commit 85030c5168f1 ("crypto: marvell - Add support for chai...")
Signed-off-by: Romain Perier
Signed-off-by: Herbert Xu -
The mv_cesa_ahash_cache_req() function always returns 0, which makes
its return value pretty much useless. However, in addition to
returning a useless value, it also returns a boolean in a variable
passed by reference to indicate if the request was already cached.So, this commit changes mv_cesa_ahash_cache_req() to return this
boolean. It consequently simplifies the only call site of
mv_cesa_ahash_cache_req(), where the "ret" variable is no longer
needed.Signed-off-by: Thomas Petazzoni
Signed-off-by: Herbert Xu -
The mv_cesa_ahash_init() function always returns 0, and the return
value is anyway never checked. Turn it into a function returning void.Signed-off-by: Thomas Petazzoni
Signed-off-by: Herbert Xu -
The dma_iter parameter of mv_cesa_ahash_dma_add_cache() is never used,
so get rid of it.Signed-off-by: Thomas Petazzoni
Signed-off-by: Herbert Xu -
The mv_cesa_dma_add_op() function builds a mv_cesa_tdma_desc structure
to copy the operation description to the SRAM, but doesn't explicitly
initialize the destination of the copy. It works fine because the
operatin description must be copied at the beginning of the SRAM, and
the mv_cesa_tdma_desc structure is initialized to zero when
allocated. However, it is somewhat confusing to not have a destination
defined.Signed-off-by: Thomas Petazzoni
Signed-off-by: Herbert Xu -
While debugging setkey issues, the following warnings were found while
trying to reinsert the caam module. Fix this by avoiding the duplicated
cleanup in the probe path after caam_remove(), which has already cleaned
up the resources.------------[ cut here ]------------
WARNING: CPU: 0 PID: 2346 at /home/rmk/git/linux-rmk/mm/vmalloc.c:1490 __vunmap+0xcc/0xf4
Trying to vfree() nonexistent vm area (f2400000)
Modules linked in: caam(+) cbc rfcomm bnep bluetooth nfsd em28xx_rc si2157 si2168 em28xx_dvb uvcvideo snd_soc_imx_sgtl5000 em28xx snd_soc_imx_spdif tveeprom snd_soc_fsl_asoc_card snd_soc_imx_audmux snd_soc_sgtl5000 imx_sdma imx2_wdt coda v4l2_mem2mem videobuf2_dma_contig snd_soc_fsl_ssi rc_cec snd_soc_fsl_spdif imx_pcm_dma videobuf2_vmalloc videobuf2_memops imx_thermal dw_hdmi_ahb_audio dw_hdmi_cec etnaviv fuse rc_pinnacle_pctv_hd [last unloaded: caam]
CPU: 0 PID: 2346 Comm: modprobe Tainted: G W 4.8.0-rc1+ #2014
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
Backtrace:
[] (dump_backtrace) from [] (show_stack+0x18/0x1c)
[] (show_stack) from [] (dump_stack+0xa4/0xdc)
[] (dump_stack) from [] (__warn+0xdc/0x108)
[] (__warn) from [] (warn_slowpath_fmt+0x40/0x48)
[] (warn_slowpath_fmt) from [] (__vunmap+0xcc/0xf4)
[] (__vunmap) from [] (vunmap+0x4c/0x54)
[] (vunmap) from [] (__iounmap+0x2c/0x30)
[] (__iounmap) from [] (iounmap+0x1c/0x20)
[] (iounmap) from [] (caam_probe+0x3dc/0x1498 [caam])
[] (caam_probe [caam]) from [] (platform_drv_probe+0x58/0xb8)
[] (platform_drv_probe) from [] (driver_probe_device+0x1fc/0x2b8)
[] (driver_probe_device) from [] (__driver_attach+0xbc/0xc0) r10:00000000 r8:bf24b000 r7:00000000 r6:ef215844 r5:bf2490c4 r4:ef215810
[] (__driver_attach) from [] (bus_for_each_dev+0x5c/0x90)
[] (bus_for_each_dev) from [] (driver_attach+0x24/0x28)
[] (driver_attach) from [] (bus_add_driver+0xf4/0x200)
[] (bus_add_driver) from [] (driver_register+0x80/0xfc)
[] (driver_register) from [] (__platform_driver_register+0x48/0x4c)
[] (__platform_driver_register) from [] (caam_driver_init+0x18/0x24 [caam])
[] (caam_driver_init [caam]) from [] (do_one_initcall+0x44/0x178)
[] (do_one_initcall) from [] (do_init_module+0x68/0x1d8)
[] (do_init_module) from [] (load_module+0x1974/0x20b0)
[] (load_module) from [] (SyS_finit_module+0x94/0xa0)
[] (SyS_finit_module) from [] (ret_fast_syscall+0x0/0x1c)
---[ end trace 34e3370d88bb1786 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 2346 at /home/rmk/git/linux-rmk/drivers/clk/clk.c:594 clk_core_disable+0xe4/0x26c
Modules linked in: caam(+) cbc rfcomm bnep bluetooth nfsd em28xx_rc si2157 si2168 em28xx_dvb uvcvideo snd_soc_imx_sgtl5000 em28xx snd_soc_imx_spdif tveeprom snd_soc_fsl_asoc_card snd_soc_imx_audmux snd_soc_sgtl5000 imx_sdma imx2_wdt coda v4l2_mem2mem videobuf2_dma_contig snd_soc_fsl_ssi rc_cec snd_soc_fsl_spdif imx_pcm_dma videobuf2_vmalloc videobuf2_memops imx_thermal dw_hdmi_ahb_audio dw_hdmi_cec etnaviv fuse rc_pinnacle_pctv_hd [last unloaded: caam]
CPU: 0 PID: 2346 Comm: modprobe Tainted: G W 4.8.0-rc1+ #2014
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
Backtrace:
[] (dump_backtrace) from [] (show_stack+0x18/0x1c)
[] (show_stack) from [] (dump_stack+0xa4/0xdc)
[] (dump_stack) from [] (__warn+0xdc/0x108)
[] (__warn) from [] (warn_slowpath_null+0x28/0x30)
[] (warn_slowpath_null) from [] (clk_core_disable+0xe4/0x26c)
[] (clk_core_disable) from [] (clk_core_disable_lock+0x20/0x2c)
[] (clk_core_disable_lock) from [] (clk_disable+0x24/0x28)
[] (clk_disable) from [] (caam_probe+0x3fc/0x1498 [caam])
[] (caam_probe [caam]) from [] (platform_drv_probe+0x58/0xb8)
[] (platform_drv_probe) from [] (driver_probe_device+0x1fc/0x2b8)
[] (driver_probe_device) from [] (__driver_attach+0xbc/0xc0) r10:00000000 r8:bf24b000 r7:00000000 r6:ef215844 r5:bf2490c4 r4:ef215810
[] (__driver_attach) from [] (bus_for_each_dev+0x5c/0x90)
[] (bus_for_each_dev) from [] (driver_attach+0x24/0x28)
[] (driver_attach) from [] (bus_add_driver+0xf4/0x200)
[] (bus_add_driver) from [] (driver_register+0x80/0xfc)
[] (driver_register) from [] (__platform_driver_register+0x48/0x4c)
[] (__platform_driver_register) from [] (caam_driver_init+0x18/0x24 [caam])
[] (caam_driver_init [caam]) from [] (do_one_initcall+0x44/0x178)
[] (do_one_initcall) from [] (do_init_module+0x68/0x1d8)
[] (do_init_module) from [] (load_module+0x1974/0x20b0)
[] (load_module) from [] (SyS_finit_module+0x94/0xa0)
[] (SyS_finit_module) from [] (ret_fast_syscall+0x0/0x1c)
---[ end trace 34e3370d88bb1787 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 2346 at /home/rmk/git/linux-rmk/drivers/clk/clk.c:476 clk_core_unprepare+0x204/0x388
Modules linked in: caam(+) cbc rfcomm bnep bluetooth nfsd em28xx_rc si2157 si2168 em28xx_dvb uvcvideo snd_soc_imx_sgtl5000 em28xx snd_soc_imx_spdif tveeprom snd_soc_fsl_asoc_card snd_soc_imx_audmux snd_soc_sgtl5000 imx_sdma imx2_wdt coda v4l2_mem2mem videobuf2_dma_contig snd_soc_fsl_ssi rc_cec snd_soc_fsl_spdif imx_pcm_dma videobuf2_vmalloc videobuf2_memops imx_thermal dw_hdmi_ahb_audio dw_hdmi_cec etnaviv fuse rc_pinnacle_pctv_hd [last unloaded: caam]
CPU: 0 PID: 2346 Comm: modprobe Tainted: G W 4.8.0-rc1+ #2014
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
Backtrace:
[] (dump_backtrace) from [] (show_stack+0x18/0x1c)
[] (show_stack) from [] (dump_stack+0xa4/0xdc)
[] (dump_stack) from [] (__warn+0xdc/0x108)
[] (__warn) from [] (warn_slowpath_null+0x28/0x30)
[] (warn_slowpath_null) from [] (clk_core_unprepare+0x204/0x388)
[] (clk_core_unprepare) from [] (clk_unprepare+0x2c/0x34)
[] (clk_unprepare) from [] (caam_probe+0x404/0x1498 [caam])
[] (caam_probe [caam]) from [] (platform_drv_probe+0x58/0xb8)
[] (platform_drv_probe) from [] (driver_probe_device+0x1fc/0x2b8)
[] (driver_probe_device) from [] (__driver_attach+0xbc/0xc0) r10:00000000 r8:bf24b000 r7:00000000 r6:ef215844 r5:bf2490c4 r4:ef215810
[] (__driver_attach) from [] (bus_for_each_dev+0x5c/0x90)
[] (bus_for_each_dev) from [] (driver_attach+0x24/0x28)
[] (driver_attach) from [] (bus_add_driver+0xf4/0x200)
[] (bus_add_driver) from [] (driver_register+0x80/0xfc)
[] (driver_register) from [] (__platform_driver_register+0x48/0x4c)
[] (__platform_driver_register) from [] (caam_driver_init+0x18/0x24 [caam])
[] (caam_driver_init [caam]) from [] (do_one_initcall+0x44/0x178)
[] (do_one_initcall) from [] (do_init_module+0x68/0x1d8)
[] (do_init_module) from [] (load_module+0x1974/0x20b0)
[] (load_module) from [] (SyS_finit_module+0x94/0xa0)
[] (SyS_finit_module) from [] (ret_fast_syscall+0x0/0x1c)
---[ end trace 34e3370d88bb1788 ]---Signed-off-by: Russell King
Signed-off-by: Herbert Xu -
Threaded interrupts can perform the function of the tasklet, and much
more safely too - without races when trying to take the tasklet and
interrupt down on device removal.With the old code, there is a window where we call tasklet_kill(). If
the interrupt handler happens to be running on a different CPU, and
subsequently calls tasklet_schedule(), the tasklet will be re-scheduled
for execution.Switching to a hardirq/threadirq combination implementation avoids this,
and it also means generic code deals with the teardown sequencing of the
threaded and non-threaded parts.Signed-off-by: Russell King
Signed-off-by: Herbert Xu -
Add a helper to map the source scatterlist into the descriptor.
Signed-off-by: Russell King
Signed-off-by: Herbert Xu -
Signed-off-by: Russell King
Signed-off-by: Herbert Xu