All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Abin Joseph <abin.joseph@amd.com>
Cc: michal.simek@amd.com, yanzhen@vivo.com,
	radhey.shyam.pandey@amd.com, palmer@rivosinc.com,
	u.kleine-koenig@baylibre.com, git@amd.com,
	dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: zynqmp_dma: Add shutdown operation support
Date: Tue, 17 Jun 2025 12:08:53 +0530	[thread overview]
Message-ID: <aFENfW0v0gmtY2Gu@vaman> (raw)
In-Reply-To: <20250612162144.3294953-1-abin.joseph@amd.com>

On 12-06-25, 21:51, Abin Joseph wrote:
> Implement shutdown hook to ensure dmaengine could be stopped inorder for
> kexec to restart the new kernel.
> 
> Signed-off-by: Abin Joseph <abin.joseph@amd.com>
> ---
>  drivers/dma/xilinx/zynqmp_dma.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
> index d05fc5fcc77d..8f9f1ef4f0bf 100644
> --- a/drivers/dma/xilinx/zynqmp_dma.c
> +++ b/drivers/dma/xilinx/zynqmp_dma.c
> @@ -1178,6 +1178,18 @@ static void zynqmp_dma_remove(struct platform_device *pdev)
>  		zynqmp_dma_runtime_suspend(zdev->dev);
>  }
>  
> +/**
> + * zynqmp_dma_shutdown - Driver shutdown function
> + * @pdev: Pointer to the platform_device structure
> + */
> +static void zynqmp_dma_shutdown(struct platform_device *pdev)
> +{
> +	struct zynqmp_dma_device *zdev = platform_get_drvdata(pdev);
> +
> +	zynqmp_dma_chan_remove(zdev->chan);
> +	pm_runtime_disable(zdev->dev);
> +}
> +
>  static const struct of_device_id zynqmp_dma_of_match[] = {
>  	{ .compatible = "amd,versal2-dma-1.0", .data = &versal2_dma_config },
>  	{ .compatible = "xlnx,zynqmp-dma-1.0", },
> @@ -1193,6 +1205,7 @@ static struct platform_driver zynqmp_dma_driver = {
>  	},
>  	.probe = zynqmp_dma_probe,
>  	.remove = zynqmp_dma_remove,
> +	.shutdown = zynqmp_dma_shutdown,

Why not do all operations performed in remove..?

>  };
>  
>  module_platform_driver(zynqmp_dma_driver);
> -- 
> 2.34.1

-- 
~Vinod

  reply	other threads:[~2025-06-17  6:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12 16:21 [PATCH] dmaengine: zynqmp_dma: Add shutdown operation support Abin Joseph
2025-06-17  6:38 ` Vinod Koul [this message]
2025-06-17  7:43   ` Uwe Kleine-König
2025-06-18 17:56     ` Vinod Koul

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=aFENfW0v0gmtY2Gu@vaman \
    --to=vkoul@kernel.org \
    --cc=abin.joseph@amd.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=git@amd.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=palmer@rivosinc.com \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=yanzhen@vivo.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.