DMA Engine development
 help / color / mirror / Atom feed
From: Olivier dautricourt <olivierdautricourt@gmail.com>
To: Nam Cao <namcaov@gmail.com>
Cc: vkoul@kernel.org, sr@denx.de, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] dmaengine: altera-msgdma: correct mutex locking order
Date: Tue, 31 May 2022 05:00:39 +0200	[thread overview]
Message-ID: <YpWE11ZI5MyyhtlD@olivier-3493erg> (raw)
In-Reply-To: <20220529182306.GA26782@nam-dell>

On Sun, May 29, 2022 at 08:23:06PM +0200, Nam Cao wrote:
> The order of spin_unlock and spin_lock seems wrong. Correct it.
> 
> Signed-off-by: Nam Cao <namcaov@gmail.com>
> ---
> 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
> 
Hello,

the lock is first grabbed in msgdma_tasklet.

Kr,

Olivier

      reply	other threads:[~2022-05-31  3:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-29 18:23 [PATCH v2] dmaengine: altera-msgdma: correct mutex locking order Nam Cao
2022-05-31  3:00 ` Olivier dautricourt [this message]

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=YpWE11ZI5MyyhtlD@olivier-3493erg \
    --to=olivierdautricourt@gmail.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namcaov@gmail.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