All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] crypto: hisilicon/hpre - don't use GFP_KERNEL to alloc mem during softirq
@ 2022-07-19  4:23 Zhengchao Shao
  2022-07-29 10:33 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Zhengchao Shao @ 2022-07-19  4:23 UTC (permalink / raw)
  To: linux-crypto, linux-kernel, liulongfang, herbert, davem
  Cc: xuzaibo, weiyongjun1, yuehaibing, shaozhengchao

The hpre encryption driver may be used to encrypt and decrypt packets
during the rx softirq, it is not allowed to use GFP_KERNEL.

Fixes: c8b4b477079d ("crypto: hisilicon - add HiSilicon HPRE accelerator")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
This patch is not tested, compiled only.
---
 drivers/crypto/hisilicon/hpre/hpre_crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
index 97d54c1465c2..3ba6f15deafc 100644
--- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c
+++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
@@ -252,7 +252,7 @@ static int hpre_prepare_dma_buf(struct hpre_asym_request *hpre_req,
 	if (unlikely(shift < 0))
 		return -EINVAL;
 
-	ptr = dma_alloc_coherent(dev, ctx->key_sz, tmp, GFP_KERNEL);
+	ptr = dma_alloc_coherent(dev, ctx->key_sz, tmp, GFP_ATOMIC);
 	if (unlikely(!ptr))
 		return -ENOMEM;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] crypto: hisilicon/hpre - don't use GFP_KERNEL to alloc mem during softirq
  2022-07-19  4:23 [PATCH v2] crypto: hisilicon/hpre - don't use GFP_KERNEL to alloc mem during softirq Zhengchao Shao
@ 2022-07-29 10:33 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2022-07-29 10:33 UTC (permalink / raw)
  To: Zhengchao Shao
  Cc: linux-crypto, linux-kernel, liulongfang, davem, xuzaibo,
	weiyongjun1, yuehaibing

On Tue, Jul 19, 2022 at 12:23:23PM +0800, Zhengchao Shao wrote:
> The hpre encryption driver may be used to encrypt and decrypt packets
> during the rx softirq, it is not allowed to use GFP_KERNEL.
> 
> Fixes: c8b4b477079d ("crypto: hisilicon - add HiSilicon HPRE accelerator")
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> ---
> This patch is not tested, compiled only.
> ---
>  drivers/crypto/hisilicon/hpre/hpre_crypto.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-29 10:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19  4:23 [PATCH v2] crypto: hisilicon/hpre - don't use GFP_KERNEL to alloc mem during softirq Zhengchao Shao
2022-07-29 10:33 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.