mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Runyu Xiao <runyu.xiao@seu.edu.cn>
Cc: adrian.ho.yin.ng@altera.com, sr@denx.de, vkoul@kernel.org,
	Frank.Li@kernel.org, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	jianhao.xu@seu.edu.cn
Subject: Re: [PATCH] dmaengine: altera-msgdma: initialize state before requesting IRQ
Date: Mon, 31 Aug 2026 10:50:44 -0500	[thread overview]
Message-ID: <apWi1DOEPZ50SL6_@SMW015318> (raw)
In-Reply-To: <20260830053308.2190597-1-runyu.xiao@seu.edu.cn>

On Sun, Aug 30, 2026 at 01:33:08PM +0800, Runyu Xiao wrote:
> msgdma_probe() registers the IRQ before initializing the tasklet, lock,
> and descriptor lists used by the interrupt handler. A pending interrupt
> can access incomplete state during probe.
>
> Initialize the handler state before requesting the IRQ so the interrupt
> path observes ready software state.
>
> Fixes: a85c6f1b2921 ("dmaengine: Add driver for Altera / Intel mSGDMA IP core")
> Cc: stable@vger.kernel.org
> Assisted-by: Codex:GPT-5
> Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/dma/altera-msgdma.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/dma/altera-msgdma.c b/drivers/dma/altera-msgdma.c
> index e23e5b441..412f4bce1 100644
> --- a/drivers/dma/altera-msgdma.c
> +++ b/drivers/dma/altera-msgdma.c
> @@ -847,11 +847,6 @@ static int msgdma_probe(struct platform_device *pdev)
>  	if (mdev->irq < 0)
>  		return -ENXIO;
>
> -	ret = devm_request_irq(&pdev->dev, mdev->irq, msgdma_irq_handler,
> -			       0, dev_name(&pdev->dev), mdev);
> -	if (ret)
> -		return ret;
> -
>  	tasklet_setup(&mdev->irq_tasklet, msgdma_tasklet);
>
>  	dma_cookie_init(&mdev->dmachan);
> @@ -863,6 +858,11 @@ static int msgdma_probe(struct platform_device *pdev)
>  	INIT_LIST_HEAD(&mdev->done_list);
>  	INIT_LIST_HEAD(&mdev->free_list);
>
> +	ret = devm_request_irq(&pdev->dev, mdev->irq, msgdma_irq_handler,
> +			       0, dev_name(&pdev->dev), mdev);
> +	if (ret)
> +		return ret;
> +
>  	dma_dev = &mdev->dmadev;
>
>  	/* Set DMA capabilities */
> --
> 2.34.1

  reply	other threads:[~2026-08-31 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-30  5:33 Runyu Xiao
2026-08-31 15:50 ` Frank Li [this message]
2026-09-01  7:21 ` Ng, Adrian Ho Yin

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=apWi1DOEPZ50SL6_@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=adrian.ho.yin.ng@altera.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=jianhao.xu@seu.edu.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=runyu.xiao@seu.edu.cn \
    --cc=sr@denx.de \
    --cc=stable@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®