From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1D368C433EF for ; Fri, 14 Jan 2022 07:13:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Aav2frUK/uty5/9ra1ULWUwC5Tq4Hq6CgbXeVAaFCR4=; b=xDDfmqF8rnIKLI O9AM2qclJ873CRhQsDis/s5iaPuuod4Wfj+ODFeXrw5xTkI3DZpebvclZoWkl5BopjFP3OIfSIcBK 3yFm7BJnm81iXKaguZknCDNj3nrkmjL9Tre0kwfmJ+aYegxocaA1GC8ppKM1ogjOKUsnfpetKl0OM z+ExIb/Sm5KiZPwTBgawif9ROIp0A84RwhvujrSssrBvOVZOREcwO7GESWOa1VaqZ/i4f+xOHEqg4 ODQJQm7Iz/AbRzKxnP3uKPwHwTj8socEnWSrsNL+tgBLxQ03w4q11S8LQJ3xzocFYW675jEwGgKdO BTCnWzNvpZtEpcDyDfiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n8GlH-0081tk-QU; Fri, 14 Jan 2022 07:12:36 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n8GlE-0081sT-5V for linux-arm-kernel@lists.infradead.org; Fri, 14 Jan 2022 07:12:33 +0000 Received: by mail-wm1-x333.google.com with SMTP id p1-20020a1c7401000000b00345c2d068bdso6751110wmc.3 for ; Thu, 13 Jan 2022 23:12:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=WvwkzxK8j3CRir1iwMyK3hew1DzSIzTqLWxWq027HNg=; b=k4BlAb+qMsYgW6YuuFj6yHaB3GQ72yQZrhc6WzYrHZjzH6c6rAnjvloHmS8Drt41Bk AwVld1flsnVLuMiibcDwEhCWR39x2MavRC4B1czU38n9PJO3nCC2grx3CB4X3K6RLMDB fFzjALVytrcZxpx+0cVJINml0saXxSOjuJxsgnzHj70+PGC/r1JQTmuevDki+YM+LxCM b0n3YfsIEaYdhTsjti2Jr8aOpLUE0AYXZD4+guxYjy71PzrpxpfiElA03iOonESMpCcs qwGqO0QmuTXl7i4fe6LApMdYdV1bcffyR5f3RxfcBds+iZrrKzSY/2OO6i+TWmu+zys4 /ApQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=WvwkzxK8j3CRir1iwMyK3hew1DzSIzTqLWxWq027HNg=; b=aUvdy67YKgNz+57gR+w/uuhkaUAw0r/Ube+ZYr3sQf1htglufmNDK6w8cNXnr1MmSg JW9dy52IvI7Ws4Jl1sWuX4lus/pyMioFwA58XgSa508tBx4f6e1RAg0yxjYR3AtUZa9P JJBl17i/Ek+3rUXXGgICcRx2GfQ/CvCfHXa+6XQrLQ/4IUqgQyOr2fMf0ihWPjYUxb1P FTe7Rsc3/qmnWofwH7k7ZD32BqNQ+xDQAUN7qy/JTr14SLOac6wnmNDCNdv3FfusPtJk MFhoZa3AJdzP2BusuhZ89oi70CHwNiI74GPNDBBneesM7P4sw+JQWyuRyVjlpYdBsdjs PkGg== X-Gm-Message-State: AOAM5326Y2IJyooHJcAyjBJOabJOzajkrsacFD8/xLLmttHQEcBI5ahs r1IQAYs5ruXkvdE2/vTqjdiqoScR5oc= X-Google-Smtp-Source: ABdhPJweUBK1XUsIXRfTOySdTx1nEzjPqdK1a79b/pzQxDgKaXgij/E6CsiG7cOegZg+/wYt7XvY4A== X-Received: by 2002:a7b:ce01:: with SMTP id m1mr7115034wmc.115.1642144349783; Thu, 13 Jan 2022 23:12:29 -0800 (PST) Received: from Red ([2a01:cb1d:3d5:a100:264b:feff:fe03:2806]) by smtp.googlemail.com with ESMTPSA id m39sm9830079wms.33.2022.01.13.23.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jan 2022 23:12:29 -0800 (PST) Date: Fri, 14 Jan 2022 08:12:26 +0100 From: Corentin Labbe To: Herbert Xu Cc: davem@davemloft.net, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: crypto: BUG: spinlock recursion when doing iperf over ipsec with crypto hardware device Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220113_231232_248203_F9BCCC0B X-CRM114-Status: GOOD ( 14.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Le Fri, Jan 14, 2022 at 03:23:26PM +1100, Herbert Xu a =E9crit : > On Fri, Jan 14, 2022 at 03:14:38PM +1100, Herbert Xu wrote: > > On Tue, Jan 11, 2022 at 10:47:12AM +0100, Corentin Labbe wrote: > > > > > > [ 44.646050] [] (__irq_svc) from [] (xfrm_repla= y_advance+0x11c/0x3dc) > > > [ 44.654143] [] (xfrm_replay_advance) from [] (= xfrm_input+0x4d0/0x1304) > > > [ 44.662408] [] (xfrm_input) from [] (crypto_fi= nalize_request+0x5c/0xc4) > > > [ 44.670766] [] (crypto_finalize_request) from [] (sun8i_ce_cipher_run+0x34/0x3c) > > > [ 44.679900] [] (sun8i_ce_cipher_run) from [] (= crypto_pump_work+0x1a8/0x330) > > = > > So did sun8i_ce_cipher_run ensure that BH is disabled before > > invoking xfrm_input? If not then this explains the dead-lock. > = > The issue appears to be with crypto_engine. It needs to ensure > that completion functions are called with BH disabled, not IRQ > disabled and definitely not BH enabled. > = Hello This minimal patch fix my issue, does it is the rigth way ? Thanks for your help Regards diff --git a/crypto/crypto_engine.c b/crypto/crypto_engine.c index fb07da9920ee..b3844f6d98a3 100644 --- a/crypto/crypto_engine.c +++ b/crypto/crypto_engine.c @@ -7,6 +7,7 @@ * Author: Baolin Wang */ = +#include #include #include #include @@ -53,7 +54,9 @@ static void crypto_finalize_request(struct crypto_engine = *engine, dev_err(engine->dev, "failed to unprepare r= equest\n"); } } + local_bh_disable(); req->complete(req, err); + local_bh_enable(); = kthread_queue_work(engine->kworker, &engine->pump_requests); } _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel