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

2016-09-07 Thread Herbert Xu
On Mon, Sep 05, 2016 at 03:06:05PM +0300, Tero Kristo wrote: > > Additional request, would it be possible for you to check the rest > of the series and just ignore patches #2 and #3 for now, the rest > don't have any dependencies against these and can be applied cleanly > without. > > I would like

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

2016-09-05 Thread Tero Kristo
On 01/09/16 10:46, Tero Kristo wrote: On 01/09/16 10:31, Herbert Xu wrote: On Thu, Sep 01, 2016 at 10:28:47AM +0300, Tero Kristo wrote: Yeah, the flush should do the trick now. Kind of a chicken-egg problem here. :P How do you see the situation with the above explanation? The export function

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

2016-09-01 Thread Tero Kristo
On 01/09/16 10:31, Herbert Xu wrote: On Thu, Sep 01, 2016 at 10:28:47AM +0300, Tero Kristo wrote: Yeah, the flush should do the trick now. Kind of a chicken-egg problem here. :P How do you see the situation with the above explanation? The export function is not allowed to sleep so you must no

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

2016-09-01 Thread Herbert Xu
On Thu, Sep 01, 2016 at 10:28:47AM +0300, Tero Kristo wrote: > > Yeah, the flush should do the trick now. Kind of a chicken-egg > problem here. :P How do you see the situation with the above > explanation? The export function is not allowed to sleep so you must not wait for the hardware to complet

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

2016-09-01 Thread Tero Kristo
On 01/09/16 10:19, Herbert Xu wrote: On Thu, Sep 01, 2016 at 09:56:06AM +0300, Tero Kristo wrote: Hmm, looking at the driver, sham_update returns 0 immediately if it just caches data. In a sense, the update is not completed at this point. Are you saying this is illegal and can't be done? Once

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

2016-09-01 Thread Herbert Xu
On Thu, Sep 01, 2016 at 09:56:06AM +0300, Tero Kristo wrote: > > Hmm, looking at the driver, sham_update returns 0 immediately if it > just caches data. In a sense, the update is not completed at this > point. Are you saying this is illegal and can't be done? Once you call the completion function

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

2016-08-31 Thread Tero Kristo
On 01/09/16 09:16, Herbert Xu wrote: On Thu, Sep 01, 2016 at 09:12:59AM +0300, Tero Kristo wrote: Well, but the driver doesn't flush its buffers automatically, it caches data until it has sufficient amount available. So, assuming you want to do this: sham_init sham_update 256 bytes sham_up

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

2016-08-31 Thread Herbert Xu
On Thu, Sep 01, 2016 at 09:12:59AM +0300, Tero Kristo wrote: > > Well, but the driver doesn't flush its buffers automatically, it > caches data until it has sufficient amount available. So, assuming > you want to do this: > > sham_init > sham_update 256 bytes > sham_update 256 bytes > wait

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

2016-08-31 Thread Tero Kristo
On 01/09/16 06:33, Herbert Xu wrote: 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) +

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

2016-08-31 Thread Herbert Xu
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); > > > >

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

2016-08-29 Thread Tero Kristo
On 09/08/16 13:06, Herbert Xu wrote: On Thu, Aug 04, 2016 at 01:28:38PM +0300, Tero Kristo wrote: Context export/import are now required for ahash algorithms due to required support in algif_hash. Implement these for OMAP SHA driver, saving and restoring the internal state of the driver. Signed

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

2016-08-09 Thread Herbert Xu
On Thu, Aug 04, 2016 at 01:28:38PM +0300, Tero Kristo wrote: > Context export/import are now required for ahash algorithms due to > required support in algif_hash. Implement these for OMAP SHA driver, > saving and restoring the internal state of the driver. > > Signed-off-by: Tero Kristo > --- >

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

2016-08-04 Thread Tero Kristo
Context export/import are now required for ahash algorithms due to required support in algif_hash. Implement these for OMAP SHA driver, saving and restoring the internal state of the driver. Signed-off-by: Tero Kristo --- drivers/crypto/omap-sham.c | 31 +-- 1 file ch