All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Golla, Nagendra" <Nagendra.Golla@amd.com>
To: sashiko-reviews@lists.linux.dev
Cc: robh@kernel.org, Frank.Li@kernel.org, vkoul@kernel.org,
	dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
	conor+dt@kernel.org
Subject: Re: [PATCH V3 1/6] dmaengine: zynqmp_dma: Fix PM usage count handling in probe error path
Date: Tue, 11 Aug 2026 16:25:25 +0530	[thread overview]
Message-ID: <322931c5-dfbc-4441-b992-8608231f9fb7@amd.com> (raw)
In-Reply-To: <20260810102814.4A6981F000E9@smtp.kernel.org>

Hi,

On 8/10/2026 3:58 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The introduced pm_runtime_put_sync() fails to synchronously suspend the device because autosuspend is enabled, leaving clocks active.
> --
> 
> --- Patch [1]: [PATCH V3 1/6] dmaengine: zynqmp_dma: Fix PM usage count handling in probe error path ---
> commit 8bb5754b8f17c08d0144740ac308428274806a68
> Author: Golla Nagendra <nagendra.golla@amd.com>
> 
> dmaengine: zynqmp_dma: Fix PM usage count handling in probe error path
> 
> This commit attempts to fix a reference leak on the probe error path. When
> probe fails after successfully waking up the device, it adds a missing
> runtime PM put call to drop the usage count and allow the device to suspend.
> 
>> diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
>> --- a/drivers/dma/xilinx/zynqmp_dma.c
>> +++ b/drivers/dma/xilinx/zynqmp_dma.c
> 
> [ ... ]
> 
>> @@ -1152,6 +1152,8 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
>>   err_disable_pm:
>>   	if (!pm_runtime_enabled(zdev->dev))
>>   		zynqmp_dma_runtime_suspend(zdev->dev);
>> +	else
>> +		pm_runtime_put_sync(zdev->dev);
>>   	pm_runtime_disable(zdev->dev);
> 
> [Severity: Medium]
> Does this actually suspend the device and disable the clocks?
> 
> Since autosuspend is enabled for this device earlier in zynqmp_dma_probe():
> pm_runtime_use_autosuspend(zdev->dev);
> 
> Calling pm_runtime_put_sync() will only schedule an asynchronous suspend
> timer. The immediately following pm_runtime_disable() will cancel this
> pending timer before the suspend callback ever runs, leaving the clocks
> permanently enabled.
> 
> Should this use pm_runtime_put_sync_suspend() instead to force a synchronous
> suspend and bypass the autosuspend delay before disabling runtime PM?

Thanks for catching this
Agreed will fix this in the next version

Thanks,
Nagendra
> 
>>   	return ret;
>>   }
> 


  reply	other threads:[~2026-08-11 10:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 10:04 [PATCH V3 0/6] dmaengine: zynqmp_dma: Per-channel reset, IRQ guard improvements, and PM fixes Golla Nagendra
2026-08-10 10:04 ` [PATCH V3 1/6] dmaengine: zynqmp_dma: Fix PM usage count handling in probe error path Golla Nagendra
2026-08-10 10:28   ` sashiko-bot
2026-08-11 10:55     ` Golla, Nagendra [this message]
2026-08-10 10:04 ` [PATCH V3 2/6] PM: runtime: Add pm_runtime_if_active guard and conditional variant Golla Nagendra
2026-08-10 10:25   ` sashiko-bot
2026-08-11 10:54     ` Golla, Nagendra
2026-08-10 10:04 ` [PATCH V3 3/6] dmaengine: zynqmp_dma: Guard IRQ handler against spurious interrupts Golla Nagendra
2026-08-10 10:04 ` [PATCH V3 4/6] dt-bindings: dma: xlnx,zynqmp-dma: Add Versal Net compatible support Golla Nagendra
2026-08-10 10:20   ` sashiko-bot
2026-08-11 10:50     ` Golla, Nagendra
2026-08-10 10:04 ` [PATCH V3 5/6] dmaengine: zynqmp_dma: Add new compatible string for Versal Net Golla Nagendra
2026-08-10 10:20   ` sashiko-bot
2026-08-11 10:52     ` Golla, Nagendra
2026-08-10 10:04 ` [PATCH V3 6/6] dmaengine: zynqmp_dma: Add per-channel reset support Golla Nagendra

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=322931c5-dfbc-4441-b992-8608231f9fb7@amd.com \
    --to=nagendra.golla@amd.com \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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 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.