Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Lu Jialin <lujialin4@huawei.com>
To: Steffen Klassert <steffen.klassert@secunet.com>,
	Herbert Xu <herbert@gondor.apana.org.au>
Cc: Daniel Jordan <daniel.m.jordan@oracle.com>,
	"David S . Miller" <davem@davemloft.net>,
	Guo Zihua <guozihua@huawei.com>, <linux-crypto@vger.kernel.org>
Subject: Re: [PATCH v3] crypto: Fix hungtask for PADATA_RESET
Date: Wed, 6 Sep 2023 15:49:30 +0800	[thread overview]
Message-ID: <f06917ed-a0ba-30f1-4b65-57fe96bbf741@huawei.com> (raw)
In-Reply-To: <ZPb4ovJ+eatyPk1E@gauss3.secunet.de>

Hi Steffen,

padata_do_parallel is only called by pcrypt_aead_encrypt/decrypt, 
therefore, changing in padata_do_parallel and changing in 
pcrypt_aead_encrypt/decrypt have the same effect. Both should be ok.

Thanks.

Herbert, the two ways look both right. What is your suggestion?

On 2023/9/5 17:45, Steffen Klassert wrote:
> On Mon, Sep 04, 2023 at 01:33:41PM +0000, Lu Jialin wrote:
>> ---
>>   crypto/pcrypt.c | 4 ++++
>>   kernel/padata.c | 2 +-
>>   2 files changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
>> index 8c1d0ca41213..d0d954fe9d54 100644
>> --- a/crypto/pcrypt.c
>> +++ b/crypto/pcrypt.c
>> @@ -117,6 +117,8 @@ static int pcrypt_aead_encrypt(struct aead_request *req)
>>   	err = padata_do_parallel(ictx->psenc, padata, &ctx->cb_cpu);
>>   	if (!err)
>>   		return -EINPROGRESS;
>> +	if (err == -EBUSY)
>> +		return -EAGAIN;
>>   
>>   	return err;
>>   }
>> @@ -164,6 +166,8 @@ static int pcrypt_aead_decrypt(struct aead_request *req)
>>   	err = padata_do_parallel(ictx->psdec, padata, &ctx->cb_cpu);
>>   	if (!err)
>>   		return -EINPROGRESS;
>> +	if (err == -EBUSY)
>> +		return -EAGAIN;
>>   
>>   	return err;
>>   }
>> diff --git a/kernel/padata.c b/kernel/padata.c
>> index 222d60195de6..81c8183f3176 100644
>> --- a/kernel/padata.c
>> +++ b/kernel/padata.c
>> @@ -202,7 +202,7 @@ int padata_do_parallel(struct padata_shell *ps,
>>   		*cb_cpu = cpu;
>>   	}
>>   
>> -	err =  -EBUSY;
>> +	err = -EBUSY;
> Why not just returning -EAGAIN here directly?
>
>

  reply	other threads:[~2023-09-06  7:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04 13:33 [PATCH v3] crypto: Fix hungtask for PADATA_RESET Lu Jialin
2023-09-05  9:45 ` Steffen Klassert
2023-09-06  7:49   ` Lu Jialin [this message]
2023-09-06  7:56     ` Herbert Xu
2023-09-15 10:43 ` Herbert Xu

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=f06917ed-a0ba-30f1-4b65-57fe96bbf741@huawei.com \
    --to=lujialin4@huawei.com \
    --cc=daniel.m.jordan@oracle.com \
    --cc=davem@davemloft.net \
    --cc=guozihua@huawei.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    /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