staging: ccree: break send_request and fix ret val
authorGilad Ben-Yossef <gilad@benyossef.com>
Sun, 7 Jan 2018 12:14:20 +0000 (12:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jan 2018 15:27:22 +0000 (16:27 +0100)
commit0f70db70339df1966ba3058cf594e2fddbaa133c
treeec8ade888d5dced9e697f1e7f02b1b4530abc84e
parent266844f13edd969bbf4681152112bdd51de88c16
staging: ccree: break send_request and fix ret val

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 <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ccree/ssi_aead.c
drivers/staging/ccree/ssi_cipher.c
drivers/staging/ccree/ssi_hash.c
drivers/staging/ccree/ssi_request_mgr.c
drivers/staging/ccree/ssi_request_mgr.h