[PATCH v3 05/28] crypto: mediatek: use -EIOCBQUEUED for backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API. Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. drivers/crypto/mediatek/mtk-aes.c | 2 +- drivers/crypto/mediatek/mtk-sha.c | 2 +- 2 files ch

[PATCH v3 04/28] crypto: marvell/cesa: use -EIOCBQUEUED for backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API. Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. drivers/crypto/marvell/cesa.c | 2 +- drivers/crypto/marvell/cesa.h | 2 +- 2 files changed, 2

[PATCH v3 18/28] crypto: move gcm to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
gcm is starting an async. crypto op and waiting for it complete. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- crypto/gcm.c | 32 ++-- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/crypto/gcm.c b/crypto/gcm.c index f

[PATCH v3 10/28] fscrypt: use -EIOCBQUEUED for backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API. Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. fs/crypto/crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cryp

[PATCH v3 27/28] crypto: mediatek: move to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
The mediatek driver starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/mediatek/mtk-aes.c | 31 +-- 1 file changed, 5 insertions(+), 26 deletions(-) diff --g

[PATCH v3 23/28] ima: move to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
ima starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef Acked-by: Mimi Zohar --- security/integrity/ima/ima_crypto.c | 56 +++-- 1 file changed, 17 insertions(+), 39 deleti

[PATCH v3 20/28] dm: move dm-verity to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
dm-verity is starting async. crypto ops and waiting for them to complete. Move it over to generic code doing the same. This also fixes a possible data coruption bug created by the use of wait_for_completion_interruptible() without dealing correctly with an interrupt aborting the wait prior to the

[PATCH v3 28/28] crypto: adapt api sample to use async. op wait

2017-07-02 Thread Gilad Ben-Yossef
The code sample is waiting for an async. crypto op completion. Adapt sample to use the new generic infrastructure to do the same. This also fixes a possible data coruption bug created by the use of wait_for_completion_interruptible() without dealing correctly with an interrupt aborting the wait pr

[PATCH v3 26/28] crypto: qce: move to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
The qce driver starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/qce/sha.c | 30 -- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/drivers/c

[PATCH v3 25/28] crypto: talitos: move to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
The talitos driver starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/talitos.c | 39 +-- 1 file changed, 5 insertions(+), 34 deletions(-) diff --gi

[PATCH v3 24/28] crypto: tcrypt: move to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
tcrypt starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- crypto/tcrypt.c | 84 + 1 file changed, 25 insertions(+), 59 deletions(-) diff --git

[PATCH v3 21/28] fscrypt: move to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
fscrypt starts several async. crypto ops and waiting for them to complete. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- fs/crypto/crypto.c | 29 + fs/crypto/fname.c | 36 ++-- fs/cr

[PATCH v3 22/28] cifs: move to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
cifs starts an async. crypto op and waits for their completion. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef Acked-by: Pavel Shilovsky --- fs/cifs/smb2ops.c | 30 -- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/fs/cif

[PATCH v3 19/28] crypto: move testmgr to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
testmgr is starting async. crypto ops and waiting for them to complete. Move it over to generic code doing the same. This also provides a test of the generic crypto async. wait code. Signed-off-by: Gilad Ben-Yossef --- crypto/testmgr.c | 204 ++---

[PATCH v3 15/28] crypto: move algif to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
algif starts several async crypto ops and waits for their completion. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- crypto/af_alg.c | 27 --- crypto/algif_aead.c | 14 +++--- crypto/algif_hash.c | 29 +

[PATCH v3 16/28] crypto: move pub key to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
public_key_verify_signature() is starting an async crypto op and waiting for it to complete. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef --- crypto/asymmetric_keys/public_key.c | 28 1 file changed, 4 insertions(+), 24 deletions(-) d

[PATCH v3 17/28] crypto: move drbg to generic async completion

2017-07-02 Thread Gilad Ben-Yossef
DRBG is starting an async. crypto op and waiting for it complete. Move it over to generic code doing the same. The code now also passes CRYPTO_TFM_REQ_MAY_SLEEP flag indicating crypto request memory allocation may use GFP_KERNEL which should be perfectly fine as the code is obviously sleeping for

[PATCH v3 13/28] crypto: adapt api sample to -EIOCBQUEUED as backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API. Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. Documentation/crypto/api-samples.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH v3 14/28] crypto: introduce crypto wait for async op

2017-07-02 Thread Gilad Ben-Yossef
Invoking a possibly async. crypto op and waiting for completion while correctly handling backlog processing is a common task in the crypto API implementation and outside users of it. This patch adds a generic implementation for doing so in preparation for using it across the board instead of hand

[PATCH v3 08/28] crypto: talitos: use -EIOCBQUEUED for backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API. Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. drivers/crypto/talitos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d

[PATCH v3 11/28] cifs: use -EIOCBQUEUED for backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API. Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. fs/cifs/smb2ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/

[PATCH v3 12/28] ima: use -EIOCBQUEUED for backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API. Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. security/integrity/ima/ima_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

[PATCH v3 06/28] crypto: omap: use -EIOCBQUEUED for backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API. Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. drivers/crypto/omap-sham.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH v3 07/28] crypto: qce: use -EIOCBQUEUED for backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API. Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. drivers/crypto/qce/sha.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d

[PATCH v3 09/28] dm: verity: use -EIOCBQUEUED for backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API. Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. drivers/md/dm-verity-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --gi

[PATCH v3 03/28] crypto: ccm: use -EIOCBQUEUED for backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. drivers/crypto/ccp/ccp-crypto-main.c | 10 +- drivers/crypto/ccp/ccp-dev.c | 8

[PATCH v3 02/28] crypto: atmel: use -EIOCBQUEUED for backlog indication

2017-07-02 Thread Gilad Ben-Yossef
Replace -EBUSY with -EIOCBQUEUED for backlog queueing indication as part of new API Signed-off-by: Gilad Ben-Yossef --- This patch should be squashed with the first patch in the series when applied. drivers/crypto/atmel-sha.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

[PATCH v3 01/28] crypto: change backlog return code to -EIOCBQUEUED

2017-07-02 Thread Gilad Ben-Yossef
The crypto API was using the -EBUSY return value to indicate both a hard failure to submit a crypto operation into a transformation provider when the latter was busy and the backlog mechanism was not enabled as well as a notification that the operation was queued into the backlog when the backlog m

[PATCH v3 00/28] simplify crypto wait for async op

2017-07-02 Thread Gilad Ben-Yossef
Many users of kernel async. crypto services have a pattern of starting an async. crypto op and than using a completion to wait for it to end. This patch set simplifies this common use case in two ways: First, by giving the case where a request was queued to the backlog a separate return code (-EI