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 1B40BC433FE for ; Fri, 14 Jan 2022 04:23:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239147AbiANEXh (ORCPT ); Thu, 13 Jan 2022 23:23:37 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:59486 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234038AbiANEXg (ORCPT ); Thu, 13 Jan 2022 23:23:36 -0500 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1n8E7Z-00057Y-OJ; Fri, 14 Jan 2022 15:23:26 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 14 Jan 2022 15:23:26 +1100 Date: Fri, 14 Jan 2022 15:23:26 +1100 From: Herbert Xu To: Corentin Labbe 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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_replay_advance+0x11c/0x3dc) > > [ 44.654143] [] (xfrm_replay_advance) from [] (xfrm_input+0x4d0/0x1304) > > [ 44.662408] [] (xfrm_input) from [] (crypto_finalize_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. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt