On Mon Tuesday, October 31, 2017 6:10 AM, Herbert Xu wrote: > > Are you allocating the tfm from atomic context? That is not allowed. > > Normally you would allocate the tfm in process context, e.g., when the > connection is setup. >
I call crypto_alloc_aead("gcm(aes)", 0, flags) in process context. and aead_request_set_tfm(aead_req, aead) in atomic context. I'm assuming by tfm you are referring to the struct crypto_aead allocated in the first call I mentioned. I was able to resolve the "sleeping function called from invalid context" issue By clearing the CRYPTO_TFM_REQ_MAY_SLEEP flag using aead_request_set_callback with flags = 0. However I'm still concerned about the lack of irq_fpu_usable() check. and I don't really want to do the check myself outside of the crypto code as it is arch specific.