Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto <linux-crypto@vger.kernel.org>
Subject: Re: cipher implementations allowed to sleep?
Date: Thu, 31 Mar 2016 13:47:50 +0200	[thread overview]
Message-ID: <5387862.2PP9F0yuod@tauon.atsec.com> (raw)
In-Reply-To: <20160331092106.GA28538@gondor.apana.org.au>

Am Donnerstag, 31. März 2016, 17:21:06 schrieb Herbert Xu:

Hi Herbert,

> On Thu, Mar 31, 2016 at 11:18:48AM +0200, Stephan Mueller wrote:
> > Hi Herbert,
> > 
> > is it allowed that cipher implementations sleep? The driver of my question
> > is whether I can use spin_lock_irqsave() as a lock around a cipher
> > operation.
> > 
> > The cipher operations in question are hashing, HMACing and symmetric
> > ciphers.
> Whether they can sleep is controlled by the MAY_SLEEP flag.
> 
> Of course, even if they can't sleep, if you invoke an async op
> then it may return -EINPROGRESS and continue the processing in
> the background.

Considering the implementation in ansi_cprng.c, is it allowed to use 
spin_lock_bh with the sync operations assuming that a cipher implementation 
may sleep?

Thanks
Stephan

  parent reply	other threads:[~2016-03-31 11:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31  9:18 cipher implementations allowed to sleep? Stephan Mueller
2016-03-31  9:21 ` Herbert Xu
2016-03-31  9:39   ` Stephan Mueller
2016-03-31 11:47   ` Stephan Mueller [this message]
2016-03-31 12:58     ` Herbert Xu
2016-03-31 13:02       ` Stephan Mueller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5387862.2PP9F0yuod@tauon.atsec.com \
    --to=smueller@chronox.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox