Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1110209rdh; Mon, 25 Sep 2023 03:44:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrqUvCVX5qXqeg5EMKiEmOcY149Wfk2mcZUR7STzbSpVN/h2HyXy+6ilEerZDqfba+aMTL X-Received: by 2002:a05:6a20:440d:b0:15a:3285:e834 with SMTP id ce13-20020a056a20440d00b0015a3285e834mr8308691pzb.4.1695638672139; Mon, 25 Sep 2023 03:44:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695638672; cv=none; d=google.com; s=arc-20160816; b=BQbRW9amnMB1LgZMM5Ot3YwhrFYbH0p9pT7awxbDWXDNZsDdBznxlbJc3gR2lzatXn 8XN1RYQmlway3UJufjnXl4HdSuDe/WZxUulltkBEpR/JixJvndLeLaGRcoboroRThnLZ PZuy693bERvwnfbEct8tUNYIXZ5N6z6RJAVcrZCoDnmUMgYXlaJVM6niCw8lRx5OngcN 1g/NMp4Qe/SPxKOcgk6lxaEbPJnUfofpdxmcI88poguZ3lKGai7Ci7IGALP/CWmg8Q+J PnWCtef7LodChnD7gxhuMVQXXu31cuV1wsZoZIeL30jFbP30lNF/jDfUWR9rPTcjpZ3l sRBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=FgoU26dGV5m9yDMLZO+tGolTDmAXJF+m0+8vegNQ6Y0=; fh=DdKsH9clYC5pu+KhHQ6hQPVgCHniwQnRJ+iATcaNHfI=; b=CA5qRWbS6CjG7x7pTmTXlew6GqVClOnFhG3sV2G+a8JbReaztlS5fmaaQt7B4K3gKS 8fs8KmHu/nW2ebmbLbA6DKoN53HFcGk6cDUAZGErskZe+O6+DdD3pJb7TzvypIr40L+g t0katcPFi2oAIPwdas+Tmcw9k4yXFbDwH6fYmdQTphlO7jQGa+7xCvjSc18Y7E3XuvUc 0tlPOd/GHZ53L8JHTlKMfB9bkUNgmwVBQNZxBXoqxgTXqLOrD+s9eFGTmCTPh3oMrkFI KEkZL/UAJImLcPiUkl9NyOQHz1RYYhSLzMvBqyyo686+wbNSbKKQXxi/OZzihLnZHdj4 ZcUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id t24-20020a17090ad51800b002776e57a5d5si426369pju.94.2023.09.25.03.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 03:44:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 29E9B8075B26; Mon, 25 Sep 2023 02:20:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232809AbjIYJUV (ORCPT + 99 others); Mon, 25 Sep 2023 05:20:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232804AbjIYJUT (ORCPT ); Mon, 25 Sep 2023 05:20:19 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1B87AB for ; Mon, 25 Sep 2023 02:20:11 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkhl7-0007eZ-Cq; Mon, 25 Sep 2023 11:20:05 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkhl6-008pnP-Tm; Mon, 25 Sep 2023 11:20:04 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkhl6-004dPf-Jc; Mon, 25 Sep 2023 11:20:04 +0200 Date: Mon, 25 Sep 2023 11:20:04 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Tim van der Staaij | Zign Cc: Shawn Guo , Sascha Hauer , "linux-kernel@vger.kernel.org" , Vinod Koul , Pengutronix Kernel Team , "dmaengine@vger.kernel.org" , Fabio Estevam , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] dmaengine: imx-sdma: fix deadlock in interrupt handler Message-ID: <20230925092004.natij4i364yupevi@pengutronix.de> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3vziazxi4g3jfqf6" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 25 Sep 2023 02:20:23 -0700 (PDT) --3vziazxi4g3jfqf6 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, On Thu, Sep 21, 2023 at 09:57:11AM +0000, Tim van der Staaij | Zign wrote: > dev_warn internally acquires the lock that is already held when > sdma_update_channel_loop is called. Therefore it is acquired twice and > this is detected as a deadlock. Temporarily release the lock while > logging to avoid this. >=20 > Signed-off-by: Tim van der Staaij > Link: https://lore.kernel.org/all/AM0PR08MB308979EC3A8A53AE6E2D3408802CA@= AM0PR08MB3089.eurprd08.prod.outlook.com/ > --- > drivers/dma/imx-sdma.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c > index 51012bd39900..3a7cd783a567 100644 > --- a/drivers/dma/imx-sdma.c > +++ b/drivers/dma/imx-sdma.c > @@ -904,7 +904,10 @@ static void sdma_update_channel_loop(struct sdma_cha= nnel *sdmac) > * owned buffer is available (i.e. BD_DONE was set too late). > */ > if (sdmac->desc && !is_sdma_channel_enabled(sdmac->sdma, sdmac->channel= )) { > + spin_unlock(&sdmac->vc.lock); > dev_warn(sdmac->sdma->dev, "restart cyclic channel %d\n", sdmac->chann= el); > + spin_lock(&sdmac->vc.lock); > + I don't know if Sascha's patch helps, but this patch looks definitively wrong. If this was the right approach (and I doubt it is) this would definitively lack an explaining code comment. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --3vziazxi4g3jfqf6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmURUMIACgkQj4D7WH0S /k56XQf/Z4tp5E2PnPCbZXqG6hnW84LB48sTntvzlHjgepkXNBivI0Ww08OVuvp7 6t6LyqUXpkh574B8mlTO29Pc1G095CmbvdOE3/CrrHh8gLbUCOgIBTefPG6xqE7C cPKGpwUxJ2PzxyP0GJA1pEyFLi4Dh9Bj1cLjjZdKQPL926Wf24RpgDMN4DsUpNjw L7kVsO/kCs7bopTZHnGNmuEE7yMz2UTSQeJ8tF9Kfl0vuoWFXT0njUVl7B1JABsM N8Rbo5fudyeu9+PeBf964B8jHc5hAbF1TLDrIo36QGEB4GnG9v+6SBrwcgfb9kVi WKCB91+hVfqHn3+AlA3pRfxrpHOuKw== =Jqzd -----END PGP SIGNATURE----- --3vziazxi4g3jfqf6--