mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Golla, Nagendra" <Nagendra.Golla@amd.com>
To: Frank Li <Frank.li@oss.nxp.com>
Cc: Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Michal Simek <michal.simek@amd.com>,
	Michael Tretter <m.tretter@pengutronix.de>,
	Harini Katakam <harini.katakam@amd.com>,
	Shyam Pandey <radhey.shyam.pandey@amd.com>,
	Abin Joseph <abin.joseph@amd.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, git@amd.com
Subject: Re: [PATCH v5 4/4] dmaengine: zynqmp_dma: Add per-channel reset support
Date: Thu, 19 Nov 2026 17:24:18 +0530	[thread overview]
Message-ID: <fd4bcca5-b775-43a8-a7da-5edf6df91a5e@amd.com> (raw)
In-Reply-To: <av3dLAxz5TvMf1J6@SMW015318>

Hi Frank,

On 11/18/2026 10:45 PM, Frank Li wrote:
> On Wed, Nov 18, 2026 at 11:54:30AM +0530, Golla, Nagendra wrote:
>> Hi Frank,
>>
>> On 11/17/2026 2:06 AM, Frank Li wrote:
>>> On Fri, Nov 06, 2026 at 03:40:26PM +0530, Golla Nagendra wrote:
>>>> Versal Gen2 and Versal Net expose a dedicated reset line per ZDMA
>>>> channel. Trigger a reset pulse during probe using device_reset().
>>>>
>>>> For Versal Net and Versal Gen2, reset is a required DT property, so
>>>> probe returns an error if the reset property is missing. For legacy
>>>> SoCs, the reset path is skipped.
>>>>
>>>> Signed-off-by: Golla Nagendra <nagendra.golla@amd.com>
>>>> ---
>>>>    drivers/dma/xilinx/zynqmp_dma.c | 10 +++++++++-
>>>>    1 file changed, 9 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
>>>> index cb0eb13f9b05..12696fa44c66 100644
>>>> --- a/drivers/dma/xilinx/zynqmp_dma.c
>>>> +++ b/drivers/dma/xilinx/zynqmp_dma.c
>>>> @@ -19,6 +19,7 @@
>>>>    #include <linux/clk.h>
>>>>    #include <linux/io-64-nonatomic-lo-hi.h>
>>>>    #include <linux/pm_runtime.h>
>>>> +#include <linux/reset.h>
>>>>
>>>>    #include "../dmaengine.h"
>>>>
>>>> @@ -937,6 +938,14 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev,
>>>>    	if (IS_ERR(chan->regs))
>>>>    		return PTR_ERR(chan->regs);
>>>>
>>>> +	match_data = of_device_get_match_data(&pdev->dev);
>>>> +	if (match_data && match_data->has_reset) {
>>>> +		err = device_reset(&pdev->dev);
>>>> +		if (err)
>>>> +			return dev_err_probe(&pdev->dev, err,
>>>> +					     "failed to reset channel\n");
>>>> +	}
>>>> +
>>>
>>> Use device_reset_optional() will simple code. Your binding already verify
>>> dts, needn't check again.
>>
>> Thanks for the review
>>
>> The binding schema restricts the resets property to Versal Gen2 and Versal
>> Net, where it is required.
>>
>> An unconditional device_reset_optional() does not enforce this required
>> property for Versal Gen2 and Versal Net devices in alignment with the DT
>> binding schema. If the required reset is missing, device_reset_optional()
>> would allow the driver to continue probing.
> 
> Yes, but I suppose function doesn't work without reset at dts, which is
> same as that driver is not probed. And new dts require pass CHECK_DTBS.

Thanks for the response

However, if a DTB without the reset property is used, 
device_reset_optional() would allow probe to succeed. Without the reset, 
we cannot ensure the channel is in a known state, and a subsequent DMA 
transfer could fail.

Since the reset is required for Versal Gen 2 and Versal Net, we think it 
would be clearer to detect the missing reset and fail in the probe, 
rather than allow a possible failure during a later transfer.


> 
>>
>> Whereas, in the current approach, the match-data check limits reset handling
>> to Versal Gen2 and Versal Net. Calling device_reset() for those compatibles
>> enforces the required reset property and ensures that probe fails if the
>> required reset is missing or cannot be applied, in alignment with the DT
>> binding schema.
>>
>> For legacy compatibles, the driver skips reset handling even if an old or
>> unvalidated DTB contains an unexpected resets property.
> 
> Fixes these dts.


Agreed, we are taking care of this as well. The invalid DTB case was an 
auxiliary point.
> 
>>
>> Hence, we prefer the current approach. Could you please advise if you see
>> any concerns?
> 
> Similar case is about clk_get_optional(). Only check critical problem, like
> out of ranges.

Using optional does check critical problem, when the reset is present. 
But doesn't enforce the reset as required.

Thanks,
Nagendra
> 
> Frank
> 
>>
>> Thanks,
>> Nagendra
>>>
>>> Frank
>>>
>>>>    	chan->bus_width = ZYNQMP_DMA_BUS_WIDTH_64;
>>>>    	chan->dst_burst_len = ZYNQMP_DMA_MAX_DST_BURST_LEN;
>>>>    	chan->src_burst_len = ZYNQMP_DMA_MAX_SRC_BURST_LEN;
>>>> @@ -952,7 +961,6 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev,
>>>>    		return -EINVAL;
>>>>    	}
>>>>
>>>> -	match_data = of_device_get_match_data(&pdev->dev);
>>>>    	if (match_data)
>>>>    		chan->irq_offset = match_data->offset;
>>>>
>>>>
>>>> --
>>>> 2.43.7
>>>>
>>


  reply	other threads:[~2026-11-19 11:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 10:10 [PATCH v5 0/4] dmaengine: zynqmp_dma: Add reset support for Versal Gen2 and Versal Net Golla Nagendra
2026-11-06 10:10 ` [PATCH v5 1/4] dt-bindings: dma: xlnx,zynqmp-dma: Require resets for Versal Gen2 Golla Nagendra
2026-11-06 14:28   ` Rob Herring (Arm)
2026-11-16 20:32   ` Frank Li
2026-11-06 10:10 ` [PATCH v5 2/4] dt-bindings: dma: xlnx,zynqmp-dma: Add Versal Net compatible Golla Nagendra
2026-11-06 14:27   ` Rob Herring (Arm)
2026-11-16 20:33   ` Frank Li
2026-11-06 10:10 ` [PATCH v5 3/4] dmaengine: zynqmp_dma: Add new compatible string for Versal Net Golla Nagendra
2026-11-06 11:10   ` Pandey, Radhey Shyam
2026-11-06 10:10 ` [PATCH v5 4/4] dmaengine: zynqmp_dma: Add per-channel reset support Golla Nagendra
2026-11-06 11:11   ` Pandey, Radhey Shyam
2026-11-16 20:36   ` Frank Li
2026-11-18  6:24     ` Golla, Nagendra
2026-11-18 17:15       ` Frank Li
2026-11-19 11:54         ` Golla, Nagendra [this message]
2026-11-10  4:09 ` [PATCH v5 0/4] dmaengine: zynqmp_dma: Add reset support for Versal Gen2 and Versal Net Pandey, Radhey Shyam

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=fd4bcca5-b775-43a8-a7da-5edf6df91a5e@amd.com \
    --to=nagendra.golla@amd.com \
    --cc=Frank.Li@kernel.org \
    --cc=Frank.li@oss.nxp.com \
    --cc=abin.joseph@amd.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=git@amd.com \
    --cc=harini.katakam@amd.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.tretter@pengutronix.de \
    --cc=michal.simek@amd.com \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=robh@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®