From: Akhil R <akhilrajeev@nvidia.com>
To: Jonathan Hunter <jonathanh@nvidia.com>
Cc: "dan.j.williams@intel.com" <dan.j.williams@intel.com>,
"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
Krishna Yarlagadda <kyarlagadda@nvidia.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
Rajesh Gumasta <rgumasta@nvidia.com>,
"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
"vkoul@kernel.org" <vkoul@kernel.org>,
Pavan Kunapuli <pkunapuli@nvidia.com>
Subject: RE: [PATCH v6 2/4] dmaengine: tegra: Add tegra gpcdma driver
Date: Thu, 23 Sep 2021 12:51:34 +0000 [thread overview]
Message-ID: <BN9PR12MB52731FB8F424A7E92EB8694AC0A39@BN9PR12MB5273.namprd12.prod.outlook.com> (raw)
In-Reply-To: <5a3de015-a0d1-4440-12d0-06297ac7f9d0@nvidia.com>
> On 22/09/2021 15:46, Akhil R wrote:
> >
> >> On 17/09/2021 15:11, Akhil R wrote:
> >>> +static int tegra_dma_slave_config(struct dma_chan *dc,
> >>> + struct dma_slave_config *sconfig) {
> >>> + struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc);
> >>> +
> >>> + if (tdc->dma_desc) {
> >>> + dev_err(tdc2dev(tdc), "Configuration not allowed\n");
> >>> + return -EBUSY;
> >>> + }
> >>> +
> >>> + memcpy(&tdc->dma_sconfig, sconfig, sizeof(*sconfig));
> >>> + if (tdc->slave_id == -1)
> >>> + tdc->slave_id = sconfig->slave_id;
> >>> +
> >>> + tdc->config_init = true;
> >>> + return 0;
> >>> +}
> >>
> >> So you have a function to reserve a slave ID, but you don't check
> >> here if it is already reserved.
> > slave-id is reserved considering the direction as well.
> > 'direction' is available only during prep_slave_sg function, I guess.
>
> Sorry I don't understand what you mean by that.
I mean, it would not be possible to check if the sid is in use without knowing
if the direction is MEM_TO_DEV or DEV_TO_MEM. The bitmask to check the
sid reservation is separate for MEM_TO_DEV and DEV_TO_MEM.
To get the direction parameter, we would need to wait till dma_prep_slave_sg
is called, I guess. I saw in the documentation that the 'direction' element in
dma_slave_config struct is deprecated and should use the value passed to
dma_prep_slave_sg().
Regards,
Akhil
--
nvpublic
next prev parent reply other threads:[~2021-09-23 12:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-17 14:11 [PATCH v6 0/4] Add Nvidia Tegra GPC-DMA driver Akhil R
2021-09-17 14:11 ` [PATCH v6 1/4] dt-bindings: dmaengine: Add doc for tegra gpcdma Akhil R
2021-09-17 14:11 ` [PATCH v6 2/4] dmaengine: tegra: Add tegra gpcdma driver Akhil R
2021-09-17 15:36 ` Jon Hunter
2021-09-22 14:46 ` Akhil R
2021-09-23 12:22 ` Jon Hunter
2021-09-23 12:51 ` Akhil R [this message]
2021-09-23 13:20 ` Jon Hunter
2021-09-17 14:11 ` [PATCH v6 3/4] arm64: defconfig: tegra: Enable GPCDMA Akhil R
2021-09-17 14:11 ` [PATCH v6 4/4] arm64: tegra: Add GPCDMA node for tegra186 and tegra194 Akhil R
2021-09-23 7:51 ` [PATCH v7 0/4] Add Nvidia Tegra GPC-DMA driver Akhil R
2021-09-23 7:51 ` [PATCH v7 1/4] dt-bindings: dmaengine: Add doc for tegra gpcdma Akhil R
2021-09-23 22:35 ` Jon Hunter
2021-09-23 7:51 ` [PATCH v7 2/4] dmaengine: tegra: Add tegra gpcdma driver Akhil R
2021-09-23 23:27 ` Jon Hunter
2021-09-23 7:51 ` [PATCH v7 3/4] arm64: defconfig: tegra: Enable GPCDMA Akhil R
2021-09-23 7:51 ` [PATCH v7 4/4] arm64: tegra: Add GPCDMA node for tegra186 and tegra194 Akhil R
2021-09-23 23:20 ` Jon Hunter
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=BN9PR12MB52731FB8F424A7E92EB8694AC0A39@BN9PR12MB5273.namprd12.prod.outlook.com \
--to=akhilrajeev@nvidia.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=jonathanh@nvidia.com \
--cc=kyarlagadda@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pkunapuli@nvidia.com \
--cc=rgumasta@nvidia.com \
--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;
as well as URLs for NNTP newsgroup(s).