public inbox for dmaengine@vger.kernel.org
 help / color / mirror / Atom feed
From: Nam Cao <namcaov@gmail.com>
To: olivier.dautricourt@orolia.com, vkoul@kernel.org, sr@denx.de
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] dmaengine: altera-msgdma: correct mutex locking order
Date: Sun, 29 May 2022 19:25:54 +0200	[thread overview]
Message-ID: <20220529172554.GA22554@nam-dell> (raw)

The order of spin_unlock and spin_lock seems wrong. Correct it.

Signed-off-by: Nam Cao <namcaov@gmail.com>
---
 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


                 reply	other threads:[~2022-05-29 17:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220529172554.GA22554@nam-dell \
    --to=namcaov@gmail.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olivier.dautricourt@orolia.com \
    --cc=sr@denx.de \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox