Thread (28 messages) flat view 28 messages, 2 authors, 2016-09-15

Re: [PATCHv3 03/11] crypto: omap-sham: implement context export/import APIs

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2016-09-01 03:33:31
Also in: linux-arm-kernel, linux-omap

On Mon, Aug 29, 2016 at 05:11:35PM +0300, Tero Kristo wrote:
quoted
quoted
+static int omap_sham_export(struct ahash_request *req, void *out)
+{
+	struct omap_sham_reqctx *rctx = ahash_request_ctx(req);
+
+	while (omap_sham_flush(req) == -EINPROGRESS)
+		msleep(10);
Do we really need this? You must not call export until the previous
operation has completed.

Cheers,
Sorry about a late reply, I was out on vacation.

For OMAP SHAM, this is actually needed, because the driver still has
a very large internal buffer for performance reasons, and the whole
buffer can't be exported. The flush functionality pushes out
sufficient amount of data to the hardware, so that the rest of the
buffer can be exported to the available space.
It doesn't matter whether you have a buffer or not.  The point
is that the completion function should not be called until the
operation is actually complete.  This is the whole point of the
async interface.

As the user must not call export until the completion function
has been called, there should be no need to wait in the export
function.

Cheers,
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help