lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <MN0PR12MB5953CBA7D5D05F0D9F0A4400B754A@MN0PR12MB5953.namprd12.prod.outlook.com>
Date: Mon, 14 Jul 2025 04:37:28 +0000
From: "Pandey, Radhey Shyam" <radhey.shyam.pandey@....com>
To: "Joseph, Abin" <Abin.Joseph@....com>, "vkoul@...nel.org"
	<vkoul@...nel.org>, "Simek, Michal" <michal.simek@....com>,
	"yanzhen@...o.com" <yanzhen@...o.com>, "palmer@...osinc.com"
	<palmer@...osinc.com>, "u.kleine-koenig@...libre.com"
	<u.kleine-koenig@...libre.com>
CC: "git (AMD-Xilinx)" <git@....com>, "Joseph, Abin" <Abin.Joseph@....com>,
	"dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2] dmaengine: zynqmp_dma: Add shutdown operation support

[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Abin Joseph <abin.joseph@....com>
> Sent: Saturday, July 12, 2025 8:48 PM
> To: vkoul@...nel.org; Simek, Michal <michal.simek@....com>;
> yanzhen@...o.com; Pandey, Radhey Shyam <radhey.shyam.pandey@....com>;
> palmer@...osinc.com; u.kleine-koenig@...libre.com
> Cc: git (AMD-Xilinx) <git@....com>; Joseph, Abin <Abin.Joseph@....com>;
> dmaengine@...r.kernel.org; linux-arm-kernel@...ts.infradead.org; linux-
> kernel@...r.kernel.org
> Subject: [PATCH v2] dmaengine: zynqmp_dma: Add shutdown operation support
>
> Add shutdown callback to ensure that DMA operations are properly stopped
> and resources are released during system shutdown or kexec.
> Fix incorrect PM state handling in the remove function that was causing
> clock disabled warning during the shutdown operation since the device

Rephrase - it. Shutdown was not implemented earlier.

Say extend remove function for shutdown usecase.

> may already be suspended with clock disabled, causing the clock
> framework to warn about the double-disable attempt. The current check
> ensures runtime_suspend is only called when the device is in active
> power state, preventing clock warnings during shutdown while maintaining

Explain pm_runtime_enabled/ pm_runtime_active usage.

> proper clean up during normal remove operations.
>
> Signed-off-by: Abin Joseph <abin.joseph@....com>
> ---
>
> Changes in v2:
> Update the shutdown to perform same operations
> as remove.
>
> ---
>  drivers/dma/xilinx/zynqmp_dma.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
> index d05fc5fcc77d..0b03c2092c28 100644
> --- a/drivers/dma/xilinx/zynqmp_dma.c
> +++ b/drivers/dma/xilinx/zynqmp_dma.c
> @@ -1173,9 +1173,18 @@ static void zynqmp_dma_remove(struct platform_device
> *pdev)
>       dma_async_device_unregister(&zdev->common);
>
>       zynqmp_dma_chan_remove(zdev->chan);
> -     pm_runtime_disable(zdev->dev);
> -     if (!pm_runtime_enabled(zdev->dev))
> +     if (pm_runtime_active(zdev->dev))
>               zynqmp_dma_runtime_suspend(zdev->dev);
> +     pm_runtime_disable(zdev->dev);
> +}
> +
> +/**
> + * zynqmp_dma_shutdown - Driver shutdown function
> + * @pdev: Pointer to the platform_device structure
> + */

Why we need separate handler ? Just reuse the remove directly ?
See https://lore.kernel.org/all/1748977771-714153-1-git-send-email-radhey.shyam.pandey@amd.com/

> +static void zynqmp_dma_shutdown(struct platform_device *pdev)
> +{
> +     zynqmp_dma_remove(pdev);
>  }
>
>  static const struct of_device_id zynqmp_dma_of_match[] = {
> @@ -1193,6 +1202,7 @@ static struct platform_driver zynqmp_dma_driver = {
>       },
>       .probe = zynqmp_dma_probe,
>       .remove = zynqmp_dma_remove,
> +     .shutdown = zynqmp_dma_shutdown,
>  };
>
>  module_platform_driver(zynqmp_dma_driver);
> --
> 2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ