[PATCH] staging: android: check the return value of register_shrinker

2018-01-03 Thread Xiongwei Song
register_shrinker call is made in ashmem_init, it may return error code, so we need to check it. Signed-off-by: Xiongwei Song --- drivers/staging/android/ashmem.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/staging/android/ashmem.c

Re: [PATCH v3 00/27] kill devm_ioremap_nocache

2018-01-03 Thread Arnd Bergmann
On Sun, Dec 24, 2017 at 9:55 AM, christophe leroy wrote: > Le 23/12/2017 à 16:57, Guenter Roeck a écrit : >> >> On 12/23/2017 05:48 AM, Greg KH wrote: >>> >>> On Sat, Dec 23, 2017 at 06:55:25PM +0800, Yisheng Xie wrote: Hi all, When I tried to use

Re: [PATCH v2 01/27] staging: ccree: SPDXify driver

2018-01-03 Thread Philippe Ombredanne
Gilad, On Wed, Jan 3, 2018 at 2:35 PM, Gilad Ben-Yossef wrote: > Replace verbatim GPL v2 copy with SPDX tag. > > Signed-off-by: Gilad Ben-Yossef > --- a/drivers/staging/ccree/cc_crypto_ctx.h > +++ b/drivers/staging/ccree/cc_crypto_ctx.h > @@ -1,18

Re: [PATCH v2 0/7] x86/kvm/hyperv: stable clocksorce for L2 guests when running nested KVM on Hyper-V

2018-01-03 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Paolo Bonzini writes: >> >> Patches 5-7 are >> >> Acked-by: Paolo Bonzini >> >> I would appreciate if the Hyper-V folks can provide a topic branch to be >> merged in both HV and KVM trees. >> > > There's

[PATCH v2 27/27] staging: ccree: add missing include

2018-01-03 Thread Gilad Ben-Yossef
Add the missing include of include file with function declarations. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/ccree/cc_debugfs.c b/drivers/staging/ccree/cc_debugfs.c index

[PATCH v2 26/27] staging: ccree: update TODO

2018-01-03 Thread Gilad Ben-Yossef
Update TODO to reflect work done Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/TODO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/TODO b/drivers/staging/ccree/TODO index 6d8702b..b8e163d 100644 ---

[PATCH v2 25/27] staging: ccree: remove unneeded includes

2018-01-03 Thread Gilad Ben-Yossef
Remove include files not needed for compilation. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_aead.c| 7 --- drivers/staging/ccree/cc_buffer_mgr.c | 6 -- drivers/staging/ccree/cc_cipher.c | 4 drivers/staging/ccree/cc_driver.c

[PATCH v2 23/27] stating: ccree: fix allocation of void sized buf

2018-01-03 Thread Gilad Ben-Yossef
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: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_ivgen.c| 9 -

[PATCH v2 22/27] staging: ccree: put pointer next to var name

2018-01-03 Thread Gilad Ben-Yossef
Put pointer next to var name as per coding style. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c

[PATCH v2 21/27] staging: ccree: fold common code into service func

2018-01-03 Thread Gilad Ben-Yossef
Fold common code in hash call into service functions. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 339 ++- 1 file changed, 116 insertions(+), 223 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c

[PATCH v2 20/27] staging: ccree: fix indentation of func params

2018-01-03 Thread Gilad Ben-Yossef
Fix indentation of some function params in hash code for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 46 +--- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git

[PATCH v2 19/27] staging: ccree: do not map bufs in ahash_init

2018-01-03 Thread Gilad Ben-Yossef
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/linux-crypto@vger.kernel.org/msg30077.html) Fix it by moving all buffer mapping/unmapping or each Crypto

[PATCH v2 18/27] staging: ccree: allocate hash bufs inside req ctx

2018-01-03 Thread Gilad Ben-Yossef
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 --- drivers/staging/ccree/ssi_hash.c | 68

[PATCH v2 17/27] staging: ccree: use array for double buffer

2018-01-03 Thread Gilad Ben-Yossef
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

[PATCH v2 16/27] staging: ccree: remove unused field

2018-01-03 Thread Gilad Ben-Yossef
Remove unused struct field. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index e05c87d..4e11b5d 100644 ---

[PATCH v2 15/27] staging: ccree: use Makefile to include PM code

2018-01-03 Thread Gilad Ben-Yossef
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 --- drivers/staging/ccree/Makefile | 3 ++- drivers/staging/ccree/ssi_pm.c | 9

[PATCH v2 11/27] stating: ccree: revert "staging: ccree: fix leak of import() after init()"

2018-01-03 Thread Gilad Ben-Yossef
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.

[PATCH v2 13/27] staging: ccree: check DMA pool buf !NULL before free

2018-01-03 Thread Gilad Ben-Yossef
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: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 3 ++- 1 file changed,

[PATCH v2 14/27] staging: ccree: handle end of sg list gracefully

2018-01-03 Thread Gilad Ben-Yossef
If we are asked for number of entries of an offset bigger than the sg list we should not crash. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 10/27] staging: ccree: add backlog processing

2018-01-03 Thread Gilad Ben-Yossef
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 ---

[PATCH v2 12/27] staging: ccree: failing the suspend is not an error

2018-01-03 Thread Gilad Ben-Yossef
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 --- drivers/staging/ccree/ssi_request_mgr.c | 8 +--- 1 file changed, 1 insertion(+), 7

[PATCH v2 09/27] staging: ccree: break send_request and fix ret val

2018-01-03 Thread Gilad Ben-Yossef
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

[PATCH v2 07/27] staging: ccree: tag debugfs init/exit func properly

2018-01-03 Thread Gilad Ben-Yossef
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 --- drivers/staging/ccree/cc_debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v2 08/27] staging: ccree: remove unused leftover field

2018-01-03 Thread Gilad Ben-Yossef
Remove the unused monitor_desc field. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index ac6846f..18e2e1d

[PATCH v2 06/27] staging: ccree: copy larval digest from RAM

2018-01-03 Thread Gilad Ben-Yossef
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 --- drivers/staging/ccree/ssi_driver.c | 2 + drivers/staging/ccree/ssi_hash.c | 121

[PATCH v2 04/27] staging: ccree: remove GFP_DMA flag from mem allocs

2018-01-03 Thread Gilad Ben-Yossef
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 --- drivers/staging/ccree/ssi_cipher.c | 2 +- drivers/staging/ccree/ssi_hash.c | 15 ++- 2 files changed, 7

[PATCH v2 05/27] staging: ccree: pick alloc mem flags based on req flags

2018-01-03 Thread Gilad Ben-Yossef
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 --- drivers/staging/ccree/ssi_buffer_mgr.c | 19 +++--

[PATCH v2 02/27] staging: ccree: fold hash defs into queue defs

2018-01-03 Thread Gilad Ben-Yossef
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 --- drivers/staging/ccree/cc_hw_queue_defs.h | 13 + drivers/staging/ccree/hash_defs.h| 23

[PATCH v2 03/27] staging: ccree: fold reg common defines into driver

2018-01-03 Thread Gilad Ben-Yossef
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 --- drivers/staging/ccree/cc_crypto_ctx.h | 4 ++-- drivers/staging/ccree/dx_reg_common.h | 13 - drivers/staging/ccree/ssi_driver.h

[PATCH v2 01/27] staging: ccree: SPDXify driver

2018-01-03 Thread Gilad Ben-Yossef
Replace verbatim GPL v2 copy with SPDX tag. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Kconfig| 2 ++ drivers/staging/ccree/Makefile | 2 ++ drivers/staging/ccree/cc_crypto_ctx.h| 17 ++---

[PATCH v2 00/27] staging: ccree: fixes and cleanups

2018-01-03 Thread Gilad Ben-Yossef
The usual combo of code cleanups and fixes. The highlights are: - Use SPDX for all driver copyright/license - Make ccree compliant with crypto API handling of backlog requests - Make ccree compliant with Crypto API rules of resource alloc/release - Settle on a single coherent file naming

Re: [PATCH] Staging: greybus: audio_codec.c: Change uint32_t to u32

2018-01-03 Thread Vaibhav Agarwal
On Wed, Jan 3, 2018 at 3:09 PM, Sumit Pundir wrote: > This patch fixes the following checkpatch.pl issue at multiple lines: > > CHECK: Prefer kernel type 'u32' over 'uint32_t' > + uint32_t format, rate; > > Signed-off-by: Sumit Pundir > ---

Re: [PATCH 2/8] staging: greybus: audio_codec.c: Fix alignment should match open parenthesis

2018-01-03 Thread Vaibhav Agarwal
On Fri, Dec 22, 2017 at 4:50 PM, Kamal Heib wrote: > Cleanup "Alignment should match open parenthesis" checkpatch.pl errors. > > Cc: Vaibhav Agarwal > Signed-off-by: Kamal Heib Hi Kamal, Thanks for sharing cleanup patches.

Re: [PATCH] Staging: greybus: audio_codec.h: Change uint32_t to u32

2018-01-03 Thread Johan Hovold
On Wed, Jan 03, 2018 at 03:07:33PM +0530, Sumit Pundir wrote: > This patch fixes the following checkpatch.pl issues: > > CHECK: Prefer kernel type 'u32' over 'uint32_t' > + uint32_t format, rate; > > CHECK: Prefer kernel type 'u32' over 'uint32_t' > + uint32_t

Re: [PATCH] staging: ccree: mark debug_regs[] as static

2018-01-03 Thread Gilad Ben-Yossef
Hi On Wed, Jan 3, 2018 at 11:26 AM, Arnd Bergmann wrote: > 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 > >

[PATCH] Staging: greybus: audio_codec.c: Change uint32_t to u32

2018-01-03 Thread Sumit Pundir
This patch fixes the following checkpatch.pl issue at multiple lines: CHECK: Prefer kernel type 'u32' over 'uint32_t' + uint32_t format, rate; Signed-off-by: Sumit Pundir --- drivers/staging/greybus/audio_codec.c | 6 +++--- 1 file changed, 3 insertions(+), 3

[PATCH] Staging: greybus: audio_codec.h: Change uint32_t to u32

2018-01-03 Thread Sumit Pundir
This patch fixes the following checkpatch.pl issues: CHECK: Prefer kernel type 'u32' over 'uint32_t' + uint32_t format, rate; CHECK: Prefer kernel type 'u32' over 'uint32_t' + uint32_t *rate, u8 *channels, CHECK: Prefer kernel type 'u32' over 'uint32_t' +

[PATCH] staging: ccree: mark debug_regs[] as static

2018-01-03 Thread Arnd Bergmann
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