Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3660987ioo; Mon, 30 May 2022 07:03:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvf9Gmb2EDq6+w1znFNSSQLBtNByZrDZ5P9YnxcNjSA3tew85B2A+3S37tyR13OFzA6FFV X-Received: by 2002:a17:902:cecb:b0:163:fc74:b6a8 with SMTP id d11-20020a170902cecb00b00163fc74b6a8mr455262plg.82.1653919425364; Mon, 30 May 2022 07:03:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653919425; cv=none; d=google.com; s=arc-20160816; b=fThdTm8SW7AntBQauFtlY54fwFIdWGP2lkz2WZBGCeIRhOu+3vZG90WQAvFLsahcAi qv2kyL/EKtI44Ey9STXZ/MrNHfcNcxnPEiA8J/0vYo6nEKQdQlB/AX0oZQN6bsjC0hW7 RIcVZdpSELSv2EdBaYtWxAa4oCNiZx4tkE/UAFzx67zSOVy3hNcKPc9ewV9hkdhOviDn qBJTSdsNr3Fpw31NLkwf4ZqVSUFu4oK97Wsq5B7bKAAfN0PuEqB6imn+Dde2EeQ6RnNJ EP7iWLFoPVhAmBvuvCfZes1iWp6ppOaIlgYB3O96TZpk+OrrXccxq+EWEjnSO4Zctj0c nCNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:reply-to :message-id:subject:cc:to:from:date:dkim-signature; bh=UrB6JZivFqE5OCWeNQt/i/4T12gkvv9wdeSvo/EtH7o=; b=n7XLXz+yKXDxvCSXpb20xW9TXY/VMXB43qIE5t0IPgSBG/0jgnHziDOy6leMgTWc2Z 02HExi/xITYCO4UJKpv8L/OYgNULqN/kRy5HjmAPR7n/ppA/uaVLLEpOynMCyfvo4WOB 3sB/LriBnZjTmyL58+1/0n1wH8s9HuD22XS2mOb/S5Bp+RL4M7WKcrIzbxagm4r+mNCW 5/HW9lHx54y5SwNL5+W1x820JNlHCSSdtvVhaZPhYVGURaDrZ2lLx94dTp0//50H9gqq NjFYlf6fj8Elr7AA1V0O0eQ/yDwUWMn8PvH85aazepSpa2050E/PyIy7j8jXf8AXGS2L yKiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="fTWVqF/+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o12-20020a635a0c000000b003ab1f09b880si16841508pgb.694.2022.05.30.07.03.32; Mon, 30 May 2022 07:03:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="fTWVqF/+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231631AbiE2SXL (ORCPT + 99 others); Sun, 29 May 2022 14:23:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229960AbiE2SXK (ORCPT ); Sun, 29 May 2022 14:23:10 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F6B587A1B; Sun, 29 May 2022 11:23:09 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id y13so17173343eje.2; Sun, 29 May 2022 11:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:reply-to:mime-version :content-disposition; bh=UrB6JZivFqE5OCWeNQt/i/4T12gkvv9wdeSvo/EtH7o=; b=fTWVqF/+400H+4XSXZFH4QSsVwcU21XPB5zGmKB/Zhd75m9njKnRpQdrSRG0bZ04h2 GHwaG48I8vqzLWNIkK+YmrXAZQwHIm57y+7r8CSGhdrhQL4fYC3xLXxHKIQ0fFqsfk4v mmHY49JgVWaDqxI03gVoc/geL3K+uruDklX46wkbTXtSZh6ZCpG70Bw8UXOHdZlRK7e1 4weqysRT9/HDJpi94f0jRCohkHF0kU/PTxa8pwhsTKsJVF1NcbDce1PsJEvn3LtjzGzr gUQhUZMifbYhufou3qrlDecmAF+cOQWq5pA0wSw2w6yNEvqSbAcp4TxIuVjGOTmSBSap JJDw== 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:reply-to :mime-version:content-disposition; bh=UrB6JZivFqE5OCWeNQt/i/4T12gkvv9wdeSvo/EtH7o=; b=5eyxttauxl/wsGJs/gscqnx10YP0ypn9CjR+/wDqvrZ9XMwvTg/+C96Y/lijL9mfL+ JqhIpFTEMG7Az3RBT8o15MIP1gBvYy/lm9qyUG+appzueQMhaHdW4n7rU18RziZxGqk4 qLNfqx3hkny11FoY7eF/j0/BRtJ2m2QxIOLjkeRCIIjC4NM6bYPc77k5jSsx+YEQIl9W Uoxm7+PyZMsCFO264rxzD+fwao2yXftV3gK906cNig6dTMZYtE1KpUy3T09HCdbc2Tsr 91SVVNQhH6MUrx4Z0NXBJ2Znc+ckVr8eO/rIz+8/Hk8gyTVfLg3PM23Jh8U6FY+p/kzW LQbg== X-Gm-Message-State: AOAM5312dPfmWra3W8FwPIYhlM0J6g8EV56rGYOboByuo/53E/nb9Jpk ENBaqiABgJV2hDXxtF4WsA97Ma6lJ+o= X-Received: by 2002:a17:907:d86:b0:6ff:1557:a080 with SMTP id go6-20020a1709070d8600b006ff1557a080mr18997528ejc.678.1653848587589; Sun, 29 May 2022 11:23:07 -0700 (PDT) Received: from nam-dell ([2a02:8109:afbf:ed88:435:610d:d1eb:dc05]) by smtp.gmail.com with ESMTPSA id a9-20020a170906190900b006fec3b388edsm3325759eje.95.2022.05.29.11.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 May 2022 11:23:07 -0700 (PDT) Date: Sun, 29 May 2022 20:23:06 +0200 From: Nam Cao To: vkoul@kernel.org, sr@denx.de Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] dmaengine: altera-msgdma: correct mutex locking order Message-ID: <20220529182306.GA26782@nam-dell> Reply-To: 20220529172554.GA22554@nam-dell MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The order of spin_unlock and spin_lock seems wrong. Correct it. Signed-off-by: Nam Cao --- Changes in v2: - Get rid of dirty index problem due to the patch being manually editted. drivers/dma/altera-msgdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/altera-msgdma.c b/drivers/dma/altera-msgdma.c index 6f56dfd375e3..e35096c12abc 100644 --- a/drivers/dma/altera-msgdma.c +++ b/drivers/dma/altera-msgdma.c @@ -591,9 +591,9 @@ static void msgdma_chan_desc_cleanup(struct msgdma_device *mdev) dmaengine_desc_get_callback(&desc->async_tx, &cb); if (dmaengine_desc_callback_valid(&cb)) { - spin_unlock(&mdev->lock); - dmaengine_desc_callback_invoke(&cb, NULL); spin_lock(&mdev->lock); + dmaengine_desc_callback_invoke(&cb, NULL); + spin_unlock(&mdev->lock); } /* Run any dependencies, then free the descriptor */ -- 2.25.1