Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp2342832rdb; Wed, 6 Sep 2023 01:32:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7ePe+uvXOKsdFeMlTiPu7ZY0s8XGEP+tcuWjjmS8Ik1TgzNoVy8kaKPaJTFnhW3vZXumb X-Received: by 2002:a05:6a00:1952:b0:68b:daf2:b2d2 with SMTP id s18-20020a056a00195200b0068bdaf2b2d2mr19126582pfk.1.1693989177432; Wed, 06 Sep 2023 01:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693989177; cv=none; d=google.com; s=arc-20160816; b=OQrKHGaI52HXq6WXlmnAC/jGOKH2wWM60EE8pctAzOBDdrJSfy0S0sD8dTj0/2yISG 1e06gRniVwM7VL/FkUk1gzg34BTy7y5iaVK7n3HH3Jt8ko2iB8CmD29st3nH/A8fy0ei jyx4wllD4O/0ZuyTNa1y/E4NiqBq8XyQO40qSdrE4gyPq3dmVlBrFeJLXVMlbMhJfY7u RMyo32RAr8g6KdPD2bepmd/29z2MvLeOnwDnLQ338Jpeu+APNnUoXVOkFTTNXmBnS5Qc r61PrOYiuUPZIMIQ8lbycS91yWpkAubD7a1eiMRZIAuj9Fp5bVHRUJz1nEX9nczFDCr1 rcoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=RTMUKhpmIQpQ1dHJbfO5e8T51nAufyRz+MlUIHPMxLQ=; fh=rprwLZaqH9nEYOpOctItPofgDuE9skK6Zh+PtDCqbFk=; b=m+1OUt9spBS1FH0rVWCcaLXA9/pNxyls9PkWV47bKK7l0PkvVJx1d6lzAiqQbpprOc fWHIjhlIGiL/K0Gyun1iGRuC+4WjvJP3e/ysA3VvOiiJzn/0k3QjHP0qDRK4Vij1QkKt n6tDuz7kUG/9RYQ71Jf0nHJO/knqZU1sw+5ev5CexsLrk7RNjZk4WqgvfN8rd+ZLSvJs Cw6SsaGL4j7a19VVNrhFmkNsNwL4ZE6+Q9oyH7P8Mv6zmNrEqku4BVOWNRtDsmOXzdn+ t0bK0HfOpSEKMxPRLw7hVTS6qm1Syzg2PK01yUbDakN3Xx3jjwI/LHANJRzaoy1jhteE 9bNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l70-20020a638849000000b00573fb2be497si452300pgd.594.2023.09.06.01.32.31; Wed, 06 Sep 2023 01:32:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231781AbjIFHth (ORCPT + 99 others); Wed, 6 Sep 2023 03:49:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbjIFHth (ORCPT ); Wed, 6 Sep 2023 03:49:37 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E022C9 for ; Wed, 6 Sep 2023 00:49:33 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RgZGl3TlMz1M8yq; Wed, 6 Sep 2023 15:47:43 +0800 (CST) Received: from [10.67.109.150] (10.67.109.150) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 6 Sep 2023 15:49:30 +0800 Message-ID: Date: Wed, 6 Sep 2023 15:49:30 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] crypto: Fix hungtask for PADATA_RESET Content-Language: en-US To: Steffen Klassert , Herbert Xu CC: Daniel Jordan , "David S . Miller" , Guo Zihua , References: <20230904133341.2528440-1-lujialin4@huawei.com> From: Lu Jialin In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.109.150] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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? > >