Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@oss.nxp.com>
To: Frank Li <Frank.li@oss.nxp.com>
Cc: Frank Li <Frank.Li@nxp.com>, Vinod Koul <vkoul@kernel.org>,
	"Joerg Roedel (AMD)" <joro@8bytes.org>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Jon Hunter <jonathanh@nvidia.com>,
	Thierry Reding <thierry.reding@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Frank Li <Frank.Li@kernel.org>,
	Larisa IIeana Grigore <larisa.grigore@nxp.com>,
	imx@lists.linux.dev, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org, iommu@lists.linux.dev,
	linux-tegra@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH v5 6/7] dmaengine: fsl-edma: support per-channel DT child nodes
Date: Thu, 12 Nov 2026 08:41:16 +0800	[thread overview]
Message-ID: <avULLAj1s5IRo80N@shlinux89> (raw)
In-Reply-To: <avSsj0Ho_n6DL36_@SMW015318>

On Wed, Nov 11, 2026 at 11:57:35AM -0600, Frank Li wrote:
>On Wed, Nov 11, 2026 at 09:47:34PM +0800, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>>
>> Add support for parsing per-channel child nodes from devicetree.
>> Each child node can carry its own interrupts and iommus properties.
>> Child power-domains are not handled here; power domains remain attached
>> at the parent level.

[...]

>>
>> - fsl_edma_configure_chan_iommu(): called after
>>   dmaenginem_async_device_register() to configure per-channel IOMMU
>>   by calling of_dma_configure() on each dma_chan_dev and setting
>>   chan_dma_dev so dmaengine_get_dma_device() returns the per-channel
>>   device.  Propagate the controller dma_parms to the per-channel device
>>   so the DMA segment size limit is preserved.
>
>Needn't detail for each funciton.
>
>The implementation is split into three functions:
>  - fsl_edma_child_to_chan_id()
>  - fsl_edma_configure_chan_from_dt()
>  - fsl_edma_configure_chan_iommu()

Fix in v6.

>
>>
>> Child nodes beyond the configured dma-channels are ignored, which allows
>> boards to reduce dma-channels without disabling every unused child node.
>> If child nodes are present, every unmasked channel must have a child node
>> with a valid interrupt; otherwise probe fails with an error asking for
>> dma-channel-mask.  In child-node mode fsl_edma3_irq_init() does not fall
>> back to the parent's flat interrupt array.
>>
>> The shared error IRQ remains a parent-node interrupt.  A child-node-only
>> DTS without that entry simply has no shared error IRQ.

[...]

>>  	if (fsl_chan->dma_dir != DMA_NONE)
>> -		dma_unmap_resource(fsl_chan->vchan.chan.device->dev,
>> -				   fsl_chan->dma_dev_addr,
>> -				   fsl_chan->dma_dev_size,
>> +		dma_unmap_resource(dev, fsl_chan->dma_dev_addr, fsl_chan->dma_dev_size,
>>  				   fsl_chan->dma_dir, 0);
>
>Use dmaengine_get_dma_device() needs sperate patches.

ok. I will add a new patch in this series to handle it.

>
>>  	fsl_chan->dma_dir = DMA_NONE;
>>  }
>> @@ -321,7 +321,7 @@ static void fsl_edma_unprep_slave_dma(struct fsl_edma_chan *fsl_chan)
>>  static bool fsl_edma_prep_slave_dma(struct fsl_edma_chan *fsl_chan,
>>  				    enum dma_transfer_direction dir)
>>  {

[...]
>> @@ -397,15 +401,24 @@ static int fsl_edma3_irq_init(struct platform_device *pdev, struct fsl_edma_engi
>>
>>  		struct fsl_edma_chan *fsl_chan = &fsl_edma->chans[i];
>>
>> -		if (fsl_edma->chan_masked & BIT(i))
>> +		if (fsl_edma->chan_masked & BIT_ULL(i))
>>  			continue;
>
>
>This one need sperate patch to fix it.

Fix in v6.

>
>>
>> -		/* request channel irq */
>> -		fsl_chan->txirq = platform_get_irq(pdev, i);
>> -		if (fsl_chan->txirq < 0)
>> -			return  -EINVAL;
>> +		if (fsl_chan->txirq <= 0) {
>> +		return ret;
[...]
>> +
>> +	for_each_available_child_of_node(np, child) {
>
>for_each_available_child_of_node_scoped()

Fix in v6.

>
>> +		struct fsl_edma_chan *fsl_chan;
>> +		int ch_id, irq;
>> +
>> +		has_children = true;
>> +
>> +
[...]
>> +		list_for_each_entry(chan, &fsl_edma->dma_dev.channels,
>> +				    device_node) {
>> +			struct device *chdev;
>> +
>> +			if (to_fsl_edma_chan(chan) != fsl_chan)
>> +				continue;
>
>Can we avoid scan channel twice?

yeah. Fix in v6.

Thanks
Peng

  reply	other threads:[~2026-11-12  0:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 13:47 [PATCH v5 0/7] dmaengine: add DMA channel bus and fsl-edma per-channel IOMMU support Peng Fan (OSS)
2026-11-11 13:47 ` [PATCH v5 1/7] dmaengine: fsl-edma: unregister channels before vchan cleanup Peng Fan (OSS)
2026-11-11 17:27   ` Frank Li
2026-11-11 13:47 ` [PATCH v5 2/7] dmaengine: add a bus for DMA channel devices Peng Fan (OSS)
2026-11-11 17:31   ` Frank Li
2026-11-12  0:27     ` Peng Fan
2026-11-12  2:16       ` Frank Li
2026-11-12  3:13         ` Peng Fan
2026-11-11 13:47 ` [PATCH v5 3/7] iommu: register the DMA channel bus for IOMMU notifications Peng Fan (OSS)
2026-11-11 13:47 ` [PATCH v5 4/7] dmaengine: move channel devices to the DMA channel bus Peng Fan (OSS)
2026-11-11 17:41   ` Frank Li
2026-11-11 13:47 ` [PATCH v5 5/7] dt-bindings: dma: fsl,edma: add per-channel child node support Peng Fan (OSS)
2026-11-11 13:47 ` [PATCH v5 6/7] dmaengine: fsl-edma: support per-channel DT child nodes Peng Fan (OSS)
2026-11-11 17:57   ` Frank Li
2026-11-12  0:41     ` Peng Fan [this message]
2026-11-11 13:47 ` [PATCH v5 7/7] arm64: dts: imx95: convert eDMA to per-channel " Peng Fan (OSS)
2026-11-11 17:59   ` Frank Li
2026-11-12  0:57     ` Peng Fan

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=avULLAj1s5IRo80N@shlinux89 \
    --to=peng.fan@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=Frank.li@oss.nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=iommu@lists.linux.dev \
    --cc=jonathanh@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=larisa.grigore@nxp.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=s.hauer@pengutronix.de \
    --cc=thierry.reding@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=will@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