[PATCHv3 03/11] crypto: omap-sham: implement context export/import APIs
Herbert Xu
herbert at gondor.apana.org.au
Wed Aug 31 20:33:20 PDT 2016
On Mon, Aug 29, 2016 at 05:11:35PM +0300, Tero Kristo wrote:
>
> >>+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 <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
More information about the linux-arm-kernel
mailing list