From patchwork Mon Feb 21 12:08:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12753530 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9AB5C433EF for ; Mon, 21 Feb 2022 12:08:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357338AbiBUMJH (ORCPT ); Mon, 21 Feb 2022 07:09:07 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357332AbiBUMJF (ORCPT ); Mon, 21 Feb 2022 07:09:05 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 991F3201AC for ; Mon, 21 Feb 2022 04:08:42 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id c192so9393498wma.4 for ; Mon, 21 Feb 2022 04:08:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mrY/YH1b9s1O9jMerN3hmkMMZmwmjWK0cZUfx1sY+dQ=; b=EHxIl7XNaoQqifbAvm4pywi+Wi6IHmxkBODFSm+hpEkuqO2pcABRHVqZhfTEPj1C/x qh6elN871Df9GMwQuyaZdPJC3DxREktLEXIZvvlF0OV8gP3GwT0NsKoTwz65WJst/8T+ Jc6I9zU5zpMgjdlDS5KnRSSt+Pqg+BmmfkewzG/0DiGhzUSgxV0HMYXTaOW8wULF3qPX ZlGHJKkX0klQhkX6VeZciYbt82ixAoV6ySkls8QVrWpDNVBDuSBnlgHxWIJO0XM0hqLG 4CM/AUl9hfEj+n4UcteK6q2IVldLU4dmeJWbD1pH+2+6uaTjbF4hpUtFn66Vvd/UVwvy JWOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mrY/YH1b9s1O9jMerN3hmkMMZmwmjWK0cZUfx1sY+dQ=; b=ni1q/cwKzhMbT0fDKANkCPKOzVvEmAu3urftgeeZk45GKsKKBnaQL1gFz8Qwg4fcKi K2PeNcH7ngXPCkD4yQDU7F859vtBSmahm5q6zvGKpwxGK2HZ7Rr/4UBXplwz0jyrBdZJ LVOtZMkkKbjiiHlVFTTSZwnYfE4uCTSI5LEA1YmoeShWEFQkDOgri5M6L+RMKLPtnhLV m9gNkEJ/xJf3L5WDLTIR7o0sIp++7gfFaVcMxj+A6DIkVh2ag6y46lFEN9cvPRHIOpIE Sgxs5bN+HVdrWkHdDay6AXqQQLXhc4bvBWxfgKZIO10CqdkWWYmJlNDp6bboKNON6vTC w7ow== X-Gm-Message-State: AOAM531XozHttTczfRafCLfZcZ7SlfkC8ALq6wLVfciH7f9gwtzipgfA AmWNRrB1DetXk5T5wkFQYrBamA== X-Google-Smtp-Source: ABdhPJxZOj3bAaqzQpMpwIZwq1rULq8jrXuaL/D3GX2+h/JhGdZn8tGDnxnawe+BhPseDP53wiUJlg== X-Received: by 2002:a05:600c:1f16:b0:37b:c7f2:fbb4 with SMTP id bd22-20020a05600c1f1600b0037bc7f2fbb4mr20467582wmb.47.1645445321196; Mon, 21 Feb 2022 04:08:41 -0800 (PST) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a8sm11821546wra.0.2022.02.21.04.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 04:08:40 -0800 (PST) From: Corentin Labbe To: herbert@gondor.apana.org.au, jernej.skrabec@gmail.com, linus.walleij@linaro.org, narmstrong@baylibre.com, ulli.kroll@googlemail.com, wens@csie.org Cc: linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Corentin Labbe Subject: [PATCH 1/5] crypto: sun8i-ss: call finalize with bh disabled Date: Mon, 21 Feb 2022 12:08:29 +0000 Message-Id: <20220221120833.2618733-2-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221120833.2618733-1-clabbe@baylibre.com> References: <20220221120833.2618733-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Doing ipsec produces a spinlock recursion warning. This is due to not disabling BH during crypto completion function. Fixes: f08fcced6d00 ("crypto: allwinner - Add sun8i-ss cryptographic offloader") Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 3 +++ drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c index 9ef1c85c4aaa..554e400d41ca 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c @@ -11,6 +11,7 @@ * You could find a link for the datasheet in Documentation/arm/sunxi.rst */ +#include #include #include #include @@ -274,7 +275,9 @@ static int sun8i_ss_handle_cipher_request(struct crypto_engine *engine, void *ar struct skcipher_request *breq = container_of(areq, struct skcipher_request, base); err = sun8i_ss_cipher(breq); + local_bh_disable(); crypto_finalize_skcipher_request(engine, breq, err); + local_bh_enable(); return 0; } diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c index d8c333fe5eb2..0c2ca296bede 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c @@ -9,6 +9,7 @@ * * You could find the datasheet in Documentation/arm/sunxi.rst */ +#include #include #include #include @@ -633,6 +634,8 @@ int sun8i_ss_hash_run(struct crypto_engine *engine, void *breq) memcpy(areq->result, result, algt->alg.hash.halg.digestsize); theend: + local_bh_disable(); crypto_finalize_hash_request(engine, breq, err); + local_bh_enable(); return 0; } From patchwork Mon Feb 21 12:08:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12753531 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF4DAC433F5 for ; Mon, 21 Feb 2022 12:08:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357372AbiBUMJK (ORCPT ); Mon, 21 Feb 2022 07:09:10 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357360AbiBUMJG (ORCPT ); Mon, 21 Feb 2022 07:09:06 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AC68201B6 for ; Mon, 21 Feb 2022 04:08:43 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id d3so11041240wrf.1 for ; Mon, 21 Feb 2022 04:08:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tbukRrC7Ov9F7pBcIG9IeTY2nydApA5tOh+cl5c9cGc=; b=SdKLSu27cu2/hHwLhVv7Jo5NLGz2GrSxYcsgEyyOgzdrRUyITQbKY4U4C1U7WkLqFC qe6XvaUjxo8J+U50MFASy3E1yA0PwR15dPQnsDWRTVAC+ricUxOKvuthq3wG3aDjC6tK dKTfpKygLdl7yWXFNyH0r0r2OoqY6poyYz2Q1LAoIjmPuaK9OFuJBAJ79aGvmHNnaO7V KCLzl7lZC1NEBrYXotzVKPVaYafTQB2+4MY96hhBOrR6G4EXfebubkZlfg7Vz5DTDxCV PdxZovQ+CBNr264//qDUeHDh8VLnbSD7TSMK1D9etdED/q6eWCNJ04f6eI6/N5DmSQvQ Jb6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tbukRrC7Ov9F7pBcIG9IeTY2nydApA5tOh+cl5c9cGc=; b=Z87CHhPAbQAg+cfcjDPmDaa6n+TcmwoLsRzJyuwa94+g6OeWBwrII1ER/O4jhODrGA 2mJgI5kfVhzW6AInKe4YsWMLE3cI/0yRoh55VksgSXhBWV84JUcthlSwpP4akaUTfS1s g1khdRElBvLOfB345YI2DS8y8Xp5R5nJJxK2b3e+8/XZLToHTanaXBLXXWBm65mp0HLh F8wbjjJMcgNFzz4WxDfZ3MU98HZ9gWAybXygKyUbl9I9fI/4EgGB3jRlyLYyT1Vf7r+Y 5DOLJxVHrvmVbKgWh3Nq2lh1kpAtnbA+vlB2Iryb+sJQZh4urzmB4sF4mdJxhj2OBxdb W9zA== X-Gm-Message-State: AOAM532OxpoXeCIEMiPxLHRPTJDJASwQtCK5iemWGNvO0x4jZNRhDO6z BMWN09L5/3tqR+A3g0nzRzWoKg== X-Google-Smtp-Source: ABdhPJy/cSnpe98uh3pMY3LAxU5hDt1WIksiv02kviAW0TkeCF3/8ErsTgLm6Koq7SSLTrdT4sgkuw== X-Received: by 2002:adf:f312:0:b0:1e8:f4bb:5a5c with SMTP id i18-20020adff312000000b001e8f4bb5a5cmr14695631wro.668.1645445321994; Mon, 21 Feb 2022 04:08:41 -0800 (PST) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a8sm11821546wra.0.2022.02.21.04.08.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 04:08:41 -0800 (PST) From: Corentin Labbe To: herbert@gondor.apana.org.au, jernej.skrabec@gmail.com, linus.walleij@linaro.org, narmstrong@baylibre.com, ulli.kroll@googlemail.com, wens@csie.org Cc: linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Corentin Labbe Subject: [PATCH 2/5] crypto: sun8i-ce: call finalize with bh disabled Date: Mon, 21 Feb 2022 12:08:30 +0000 Message-Id: <20220221120833.2618733-3-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221120833.2618733-1-clabbe@baylibre.com> References: <20220221120833.2618733-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Doing ipsec produces a spinlock recursion warning. This is due to not disabling BH during crypto completion function. Fixes: 06f751b61329 ("crypto: allwinner - Add sun8i-ce Crypto Engine") Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 3 +++ drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c index 7cc496c03084..0b1ce58bdeb9 100644 --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c @@ -11,6 +11,7 @@ * You could find a link for the datasheet in Documentation/arm/sunxi.rst */ +#include #include #include #include @@ -272,7 +273,9 @@ static int sun8i_ce_cipher_run(struct crypto_engine *engine, void *areq) flow = rctx->flow; err = sun8i_ce_run_task(ce, flow, crypto_tfm_alg_name(breq->base.tfm)); + local_bh_disable(); crypto_finalize_skcipher_request(engine, breq, err); + local_bh_enable(); return 0; } diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c index fd7f1db863d9..5b6c51b78dde 100644 --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c @@ -9,6 +9,7 @@ * * You could find the datasheet in Documentation/arm/sunxi.rst */ +#include #include #include #include @@ -472,6 +473,8 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq) theend: kfree(buf); kfree(result); + local_bh_disable(); crypto_finalize_hash_request(engine, breq, err); + local_bh_enable(); return 0; } From patchwork Mon Feb 21 12:08:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12753533 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26DD5C433FE for ; Mon, 21 Feb 2022 12:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357332AbiBUMJf (ORCPT ); Mon, 21 Feb 2022 07:09:35 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357358AbiBUMJI (ORCPT ); Mon, 21 Feb 2022 07:09:08 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68BA2201AC for ; Mon, 21 Feb 2022 04:08:44 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id k127-20020a1ca185000000b0037bc4be8713so13388212wme.3 for ; Mon, 21 Feb 2022 04:08:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wZFWsyzx/jHMsWPxyPrQm5lf1ZD0aMT85ez0uftjp7E=; b=1PGtPPDp+XFtVSREdW90iUbBSR6N4gGIyYK9a0b8MHbK/Qkq1UH2wOhpNzD7hyTVtA 6B0QWQnBoukyAnTHYkmmddBYf0sa26knc7O5Kx9X6uxs/H7QHr7zPA2/BzmboSv2pTh/ GhZ8Q5dfBViX2AvCAPLUNbiRQuPHwq5tS0CrZwqj5Z8gpiSVq/rYF2MMveY7EIGO+JSz vEePq/DY+or1APvewtFco3JsmXAZbCmvzQHZ8hetzHBpaTvjqTXZrZc9Vy2gOlSElOq/ 9be2oV+LKSHqtwqJXl/m9+UIKdFVb44sEBA0HKyq+KNsl427a4yhdZEtb4/8jwnNkMsz 9tmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wZFWsyzx/jHMsWPxyPrQm5lf1ZD0aMT85ez0uftjp7E=; b=6ZetXdunALW13lioxFSw5vM6Sad3yQSdkWfMmvtqWB3nJwya+VGCNeIZi4KPB03e9l K8JGETMsdFt+en4fhduDpTviHNk1hUrGVoBXStZSOdpDX2xJ2olphvrwycEgQf8QMTx+ UuYyYbxPv3Ln6655ZPiYk/yjEiKm0iE8aoZEkJXIx3jN6+qYhfuZo7wifynLh9zCFD83 MCWNdy8aY5WJ+xzyNv5Hx5u9GirmGATOK/j9iLiBqdRo4WGkEy9Rgx+Y12keLk30/RbQ h9x62QueReNkgQiRIpIvm048I4UkqFBCKJOf/3VFHgn9vyc11ZytITHtfq+6X7ZSckh/ CRIQ== X-Gm-Message-State: AOAM531Syboc4SK98lNjWs7X4fDCeGUAkeu3Pnjq4zX4vT8Wu5TpE5EN imutrk3GhU92M97YS51YlhXoeg== X-Google-Smtp-Source: ABdhPJyFGzoL8/nsVuES11PLDKB1Nir+e3TPvcagEp/HBZSmVCZxbZuibRi7efMk2RlWfpuAwsMcxw== X-Received: by 2002:a05:600c:2b94:b0:355:1695:e8c5 with SMTP id j20-20020a05600c2b9400b003551695e8c5mr17921665wmc.142.1645445323024; Mon, 21 Feb 2022 04:08:43 -0800 (PST) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a8sm11821546wra.0.2022.02.21.04.08.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 04:08:42 -0800 (PST) From: Corentin Labbe To: herbert@gondor.apana.org.au, jernej.skrabec@gmail.com, linus.walleij@linaro.org, narmstrong@baylibre.com, ulli.kroll@googlemail.com, wens@csie.org Cc: linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Corentin Labbe Subject: [PATCH 3/5] crypto: amlogic: call finalize with bh disabled Date: Mon, 21 Feb 2022 12:08:31 +0000 Message-Id: <20220221120833.2618733-4-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221120833.2618733-1-clabbe@baylibre.com> References: <20220221120833.2618733-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Doing ipsec produces a spinlock recursion warning. This is due to not disabling BH during crypto completion function. Fixes: 48fe583fe541 ("crypto: amlogic - Add crypto accelerator for amlogic GXL") Signed-off-by: Corentin Labbe --- drivers/crypto/amlogic/amlogic-gxl-cipher.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/amlogic/amlogic-gxl-cipher.c b/drivers/crypto/amlogic/amlogic-gxl-cipher.c index c6865cbd334b..e79514fce731 100644 --- a/drivers/crypto/amlogic/amlogic-gxl-cipher.c +++ b/drivers/crypto/amlogic/amlogic-gxl-cipher.c @@ -265,7 +265,9 @@ static int meson_handle_cipher_request(struct crypto_engine *engine, struct skcipher_request *breq = container_of(areq, struct skcipher_request, base); err = meson_cipher(breq); + local_bh_disable(); crypto_finalize_skcipher_request(engine, breq, err); + local_bh_enable(); return 0; } From patchwork Mon Feb 21 12:08:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12753532 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D95DC433F5 for ; Mon, 21 Feb 2022 12:09:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357422AbiBUMJe (ORCPT ); Mon, 21 Feb 2022 07:09:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357332AbiBUMJI (ORCPT ); Mon, 21 Feb 2022 07:09:08 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B99C201B9 for ; Mon, 21 Feb 2022 04:08:45 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id d27so26702993wrc.6 for ; Mon, 21 Feb 2022 04:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eRwXQ22zhUvx1o2PZ7ENLpRDM+5TmK2L3Q+xebz6RZg=; b=qmw5zddLshVBKDNx9LmeyGeFD06unJdxUalh9qYp20aANFXunS0qfedH7kKreKAi1B TuZ66MDF1UKDbxZfJtTct+TBv4WAKrXribxlOnzuChMAnS3sDdKtTRU18+ju9/hFQSxs EhLx/h9ZR4eCkZxp1ViV4aDidIOXtwLywqNfVkjll1JeohtBMUWIZN98n1+RDri/GkOj vLCnqS9rwSkHDW6XYSZV9Oe834ro/eJCV+XoXF40hYLL4DMMubP/riKiaLy7jIuAEmp7 wi+n0NwOGdXFC6avheY2YvwGHhX3elgBsAo6php6McGHit+QF9Qq9ovwKve12Rs6xaT7 cVNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eRwXQ22zhUvx1o2PZ7ENLpRDM+5TmK2L3Q+xebz6RZg=; b=DkqN9wfyg+D7E+m2XpRkBHhSifUuMfHibvb6L8FjjM267HE0LkX/DfOhEuqdbK3rQr oQwOH1OCSakuFn+fweJNWaZiUiVMw1dsZ32YRlny5DRPtNepEDeW9ZtST2eOUetj/sVG BUgLrEbumCPUzN4PQFLXGA3FLSaVgujWkN94KCL/AVY78JmG/yY8sEH3tM2Xw9hvwV9b SqNFvcwUkU1tQxPEq/AAYSi3Mi3zq/2k3upK+OHsxpf10WsDgGs84d5n9U8+184PQoSm 8+BMdHhYBndj4Z/qO9LKusPalNvdmOFC2Hav5qRI1ikAyZGFZagUVemATX1cYbwRD4LE cjHw== X-Gm-Message-State: AOAM5327ZCvFvJN4o5W+ElQMqUr2uwr4lRpKdQ7E0/dp48wkrm9ol00l Tz3EKbMRoqYasf3RPNDmvfjoHQ== X-Google-Smtp-Source: ABdhPJy6vbpLlKF2o118HSZXUs4RfBWx6RmuHRbHpvyirVgJKBWwM1e3MmCtrMzPWWHPKMXOLsmeIQ== X-Received: by 2002:a05:6000:154e:b0:1ea:7622:64ec with SMTP id 14-20020a056000154e00b001ea762264ecmr676608wry.600.1645445323857; Mon, 21 Feb 2022 04:08:43 -0800 (PST) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a8sm11821546wra.0.2022.02.21.04.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 04:08:43 -0800 (PST) From: Corentin Labbe To: herbert@gondor.apana.org.au, jernej.skrabec@gmail.com, linus.walleij@linaro.org, narmstrong@baylibre.com, ulli.kroll@googlemail.com, wens@csie.org Cc: linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Corentin Labbe Subject: [PATCH 4/5] crypto: gemini: call finalize with bh disabled Date: Mon, 21 Feb 2022 12:08:32 +0000 Message-Id: <20220221120833.2618733-5-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221120833.2618733-1-clabbe@baylibre.com> References: <20220221120833.2618733-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Doing ipsec produces a spinlock recursion warning. This is due to not disabling BH during crypto completion function. Fixes: 46c5338db7bd45b2 ("crypto: sl3516 - Add sl3516 crypto engine") Signed-off-by: Corentin Labbe --- drivers/crypto/gemini/sl3516-ce-cipher.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/gemini/sl3516-ce-cipher.c b/drivers/crypto/gemini/sl3516-ce-cipher.c index 53e3fefb81de..14d0d83d388d 100644 --- a/drivers/crypto/gemini/sl3516-ce-cipher.c +++ b/drivers/crypto/gemini/sl3516-ce-cipher.c @@ -264,7 +264,9 @@ static int sl3516_ce_handle_cipher_request(struct crypto_engine *engine, void *a struct skcipher_request *breq = container_of(areq, struct skcipher_request, base); err = sl3516_ce_cipher(breq); + local_bh_disable(); crypto_finalize_skcipher_request(engine, breq, err); + local_bh_enable(); return 0; } From patchwork Mon Feb 21 12:08:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12753534 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3BD9C43219 for ; Mon, 21 Feb 2022 12:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357313AbiBUMJg (ORCPT ); Mon, 21 Feb 2022 07:09:36 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357367AbiBUMJJ (ORCPT ); Mon, 21 Feb 2022 07:09:09 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DFC7205C0 for ; Mon, 21 Feb 2022 04:08:46 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id c192so9393586wma.4 for ; Mon, 21 Feb 2022 04:08:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1WbusBDevTL0id1+rC6qLSGi8eX9Tec+0gEdUp6beE0=; b=D/T2RPldzgpWaePTaWvFPRInmTGPvf5JQV2GkaAY4ibltSxUGvo267U3iNBvxTTNVf oXgkIEryAs8WFCi8dNoB0wHLcM4GAuZ02L1fSj+7wu84dKzey4l7F/ctcAAC+8Tncay7 2DXF7IOzXCF7JtZvr4rWoTOGYLmmotDBg/0Ij/PUQeZy86dO/RFVogFYAwxMuOQrAOjb FnDjxhbedsPEUBohewERqQvuUbkUKCqoQjT5JTMxy4ZbonuZwrfYj9TLXXW8yPeacSZd sOOx9U/UEXhXCV1h1mX+Mqz2OFFhsMbokU3w8p2zTaJOAngv0/lpFrKLeZ+Dg7U7rU3o LrDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1WbusBDevTL0id1+rC6qLSGi8eX9Tec+0gEdUp6beE0=; b=sg3cJa/PNyIvAb1p1a6s4BXJBCDtj8Lv+8sOHgI0eIi7s0AFb9r9+ZY/x570zfhktL Wrbi3lE+MRauibjIM4OobOGYp2ufJ+e1EO983VyRIIDmPv/qI80yP4QMSYAIO+WOVXaj +19yZjdAq42+t/Kf+/D9JtviPrd6jUqf/KMucMGTXxvqhuNOBWwjK5A5pgskg8X1AAe1 WyLt0fOxEbvEesB9dZpSdT3cL9ZTA11CCsEryRkyZpjsfa/kmLU8cGOJ9I4bXkiEU6im QuL0TKEPhB4Gac55/X3sH0pgs6SfZbf3tDa0nqiFxqy+aTVTV/AkZFLocM7xnS4Yr39V TlEw== X-Gm-Message-State: AOAM532kkMp59BbRgzMp6uxtA1Dxc0EucXSz8O4W2XoH0PBXKZmrzz41 UKBnuVGHBdu87On7YLdoAaHVow== X-Google-Smtp-Source: ABdhPJyA8PlOfDHHxH/OqNVLLFns7QOhkyM6XRROGBV6oQogaZvQ9JL5vuO0S3f6KL+yexhcV87zBQ== X-Received: by 2002:a1c:7c0d:0:b0:37d:1e29:5cc6 with SMTP id x13-20020a1c7c0d000000b0037d1e295cc6mr20767654wmc.31.1645445324664; Mon, 21 Feb 2022 04:08:44 -0800 (PST) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a8sm11821546wra.0.2022.02.21.04.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 04:08:44 -0800 (PST) From: Corentin Labbe To: herbert@gondor.apana.org.au, jernej.skrabec@gmail.com, linus.walleij@linaro.org, narmstrong@baylibre.com, ulli.kroll@googlemail.com, wens@csie.org Cc: linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Corentin Labbe Subject: [PATCH 5/5] crypto: engine: check if BH is disabled during completion Date: Mon, 21 Feb 2022 12:08:33 +0000 Message-Id: <20220221120833.2618733-6-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221120833.2618733-1-clabbe@baylibre.com> References: <20220221120833.2618733-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org When doing iperf over ipsec with crypto hardware sun8i-ce, I hit some spinlock recursion bug. This is due to completion function called with enabled BH. Add check a to detect this. Fixes: 735d37b5424b ("crypto: engine - Introduce the block request crypto engine framework") Signed-off-by: Corentin Labbe --- crypto/crypto_engine.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/crypto_engine.c b/crypto/crypto_engine.c index fb07da9920ee..6056a990c9f2 100644 --- a/crypto/crypto_engine.c +++ b/crypto/crypto_engine.c @@ -53,6 +53,7 @@ static void crypto_finalize_request(struct crypto_engine *engine, dev_err(engine->dev, "failed to unprepare request\n"); } } + lockdep_assert_in_softirq(); req->complete(req, err); kthread_queue_work(engine->kworker, &engine->pump_requests);