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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5761DC04A94 for ; Thu, 27 Jul 2023 15:31:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232281AbjG0PbX (ORCPT ); Thu, 27 Jul 2023 11:31:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231578AbjG0PbV (ORCPT ); Thu, 27 Jul 2023 11:31:21 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A19D51BC1; Thu, 27 Jul 2023 08:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:From:References:Cc:To: MIME-Version:Date:Message-ID:content-disposition; bh=Dfas0y0eezHGt3ORPFcg54EkFswOHp+7SIWelfc59p8=; b=durHmeRLiJGH1feVB6AVEbtL2S w35cK7dO8zDysPgztPnDTMJZUG/3DKxrJW3xGorrO6f8j4koM3CXbtNgM3GhD71i7ERE7NVhNx1+V mWdjRo6ZClNSNhTe+qrxBMJWhKU1O8eeRm811oPgm2LVBh53uaLXCTq+jELDsLBrLNthngX89Ww/7 9X/i0HaGurnWXS7qQ6003/zUlq1cOkF2vBkPXarKX8cCyPmeg1JgOh9cJohIp9wWt0jZ+fauHR3pL IQ88BLwgioEKwkRxeS1kBX7m5bsZHKsQsiXe47YrKYWIyLQeDjFyVCMyITLGkfjQiU74i8Vl4Z12t 7tnTBi5g==; Received: from s0106a84e3fe8c3f3.cg.shawcable.net ([24.64.144.200] helo=[192.168.0.10]) by ale.deltatee.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qP2xO-00Bv7B-Vn; Thu, 27 Jul 2023 09:31:15 -0600 Message-ID: Date: Thu, 27 Jul 2023 09:31:12 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-CA To: Chengfeng Ye Cc: Christophe JAILLET , vkoul@kernel.org, Yunbo Yu , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230726104827.60382-1-dg573847474@gmail.com> <9378e69f-2bd4-9d8d-c736-b8799f6ebecc@deltatee.com> <0e4caa6c-d5bd-61e7-2ef6-300973cd2db6@deltatee.com> From: Logan Gunthorpe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 24.64.144.200 X-SA-Exim-Rcpt-To: dg573847474@gmail.com, christophe.jaillet@wanadoo.fr, vkoul@kernel.org, yuyunbo519@gmail.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH] dmaengine: plx_dma: Fix potential deadlock on &plxdev->ring_lock X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/27/23 00:48, Chengfeng Ye wrote: > Hi Logan and Christophe, > > Thanks much for the reply and reminder, and yes, spin_lock_bh() should > be better. > > When I wrote the patch I thought the spin_lock_bh() cannot be nested, > and afraid that if some outside callers called .dma_tx_status() callback > with softirq already disable, then spin_unlock_bh() would unintentionally > re-enable softirq(). spin_lock_irqsave() is always safer in general thus I > used it. > > But I just check the document [1] about these API and found that _bh() > can be nested. Then use spin_lock_bh() should be better due to > performance concern. > > >> So perhaps we should just revert 1d05a0bdb420? > Then for this one I think revert 1d05a0bdb420 should be enough. May I > ask to revert that patch, should I do anything further? (like sending > a new patch). Yes, I think you can just send a revert patch explaining the reasoning further in a commit message. Thanks, Logan