From: Akhil R <akhilrajeev@nvidia.com>
To: <frank.li@nxp.com>
Cc: <Frank.Li@kernel.org>, <akhilrajeev@nvidia.com>,
<conor+dt@kernel.org>, <devicetree@vger.kernel.org>,
<dmaengine@vger.kernel.org>, <jonathanh@nvidia.com>,
<krzk+dt@kernel.org>, <ldewangan@nvidia.com>,
<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
<p.zabel@pengutronix.de>, <robh@kernel.org>,
<thierry.reding@gmail.com>, <vkoul@kernel.org>
Subject: Re: [PATCH v5 08/10] dmaengine: tegra: Use iommu-map for stream ID
Date: Mon, 30 Mar 2026 23:50:40 +0530 [thread overview]
Message-ID: <20260330182040.33366-1-akhilrajeev@nvidia.com> (raw)
In-Reply-To: <acq9z3-lqBHY78v3@lizhi-Precision-Tower-5810>
On Mon, 30 Mar 2026 14:15:43 -0400, Frank Li wrote:
> On Mon, Mar 30, 2026 at 11:32:40PM +0530, Akhil R wrote:
>> On Mon, 30 Mar 2026 12:47:24 -0400, Frank Li wrote:
>> > On Mon, Mar 30, 2026 at 08:14:54PM +0530, Akhil R wrote:
>> >> Use 'iommu-map', when provided, to get the stream ID to be programmed
>> >> for each channel. Iterate over the channels registered and configure
>> >> each channel device separately using of_dma_configure_id() to allow
>> >> it to use a separate IOMMU domain for the transfer. However, do this
>> >> in a second loop since the first loop populates the DMA device channels
>> >> list and async_device_register() registers the channels. Both are
>> >> prerequisites for using the channel device in the next loop.
>> >>
>> >> Channels will continue to use the same global stream ID if the
>> >> 'iommu-map' property is not present in the device tree.
>> >>
>> >> Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
>> >> ---
>> > ...
>> >>
>> >> + /*
>> >> + * Configure stream ID for each channel from the channels registered
>> >> + * above. This is done in a separate iteration to ensure that only
>> >> + * the channels available and registered for the DMA device are used.
>> >> + */
>> >> + list_for_each_entry(chan, &tdma->dma_dev.channels, device_node) {
>> >> + chdev = &chan->dev->device;
>> >> + tdc = to_tegra_dma_chan(chan);
>> >> +
>> >> + if (use_iommu_map) {
>> >> + chdev->bus = pdev->dev.bus;
>> >> + dma_coerce_mask_and_coherent(chdev, DMA_BIT_MASK(cdata->addr_bits));
>> >> +
>> >> + ret = of_dma_configure_id(chdev, pdev->dev.of_node,
>> >> + true, &tdc->id);
>> >> + if (ret)
>> >> + return dev_err_probe(chdev, ret,
>> >> + "Failed to configure IOMMU for channel %d", tdc->id);
>> >> +
>> >> + if (!tegra_dev_iommu_get_stream_id(chdev, &stream_id)) {
>> >> + dev_err(chdev, "Failed to get stream ID for channel %d\n",
>> >> + tdc->id);
>> >> + return -EINVAL;
>> >
>> > Can you check similar problem before post patch, here also can use
>> > return dev_err_probe()
>>
>> I did notice that, but I thought dev_err_probe is to handle -EPROBE_DEFER
>> and we do not use it when we return a fixed value. It returns -EINVAL here
>> directly.
>
> even that, still can use return dev_err_probe(chddev, -EINVAL, ...) to
> short your code.
I just saw in the dev_err_probe() description that it is not limited to
-EPROBE_DEFER. Thanks for pointing. I will update the patch.
Best Regards,
Akhil
next prev parent reply other threads:[~2026-03-30 18:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 14:44 [PATCH v5 00/10] Add GPCDMA support in Tegra264 Akhil R
2026-03-30 14:44 ` [PATCH v5 01/10] dt-bindings: dma: nvidia,tegra186-gpc-dma: Make reset optional Akhil R
2026-03-30 14:44 ` [PATCH v5 02/10] arm64: tegra: Remove fallback compatible for GPCDMA Akhil R
2026-03-30 14:44 ` [PATCH v5 03/10] dt-bindings: dma: nvidia,tegra186-gpc-dma: Add iommu-map property Akhil R
2026-03-30 14:44 ` [PATCH v5 04/10] dmaengine: tegra: Make reset control optional Akhil R
2026-03-30 14:44 ` [PATCH v5 05/10] dmaengine: tegra: Use struct for register offsets Akhil R
2026-03-30 14:44 ` [PATCH v5 06/10] dmaengine: tegra: Support address width > 39 bits Akhil R
2026-03-30 14:44 ` [PATCH v5 07/10] dmaengine: tegra: Use managed DMA controller registration Akhil R
2026-03-30 14:44 ` [PATCH v5 08/10] dmaengine: tegra: Use iommu-map for stream ID Akhil R
2026-03-30 16:47 ` Frank Li
2026-03-30 18:02 ` Akhil R
2026-03-30 18:15 ` Frank Li
2026-03-30 18:20 ` Akhil R [this message]
2026-03-30 14:44 ` [PATCH v5 09/10] dmaengine: tegra: Add Tegra264 support Akhil R
2026-03-30 14:44 ` [PATCH v5 10/10] arm64: tegra: Enable GPCDMA in Tegra264 and add iommu-map Akhil R
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=20260330182040.33366-1-akhilrajeev@nvidia.com \
--to=akhilrajeev@nvidia.com \
--cc=Frank.Li@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=frank.li@nxp.com \
--cc=jonathanh@nvidia.com \
--cc=krzk+dt@kernel.org \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=thierry.reding@gmail.com \
--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