[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR12MB5273F667288F7DEE99BA275DC0A29@BN9PR12MB5273.namprd12.prod.outlook.com>
Date: Wed, 22 Sep 2021 14:46:50 +0000
From: Akhil R <akhilrajeev@...dia.com>
To: Jonathan Hunter <jonathanh@...dia.com>
CC: "dan.j.williams@...el.com" <dan.j.williams@...el.com>,
"dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
Krishna Yarlagadda <kyarlagadda@...dia.com>,
Laxman Dewangan <ldewangan@...dia.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
Rajesh Gumasta <rgumasta@...dia.com>,
"thierry.reding@...il.com" <thierry.reding@...il.com>,
"vkoul@...nel.org" <vkoul@...nel.org>,
Pavan Kunapuli <pkunapuli@...dia.com>
Subject: RE: [PATCH v6 2/4] dmaengine: tegra: Add tegra gpcdma driver
> 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.
>
> ...
>
> > +
> > + iommu_spec = dev_iommu_fwspec_get(&pdev->dev);
> > + if (!iommu_spec) {
> > + dev_err(&pdev->dev, "Missing iommu stream-id\n");
> > + return -EINVAL;
> > + }
> > + stream_id = iommu_spec->ids[0] & 0xffff;
>
> Is it an error if the ID is greater than 0xffff?
The value should correspond to one of the GPC DMA Clients listed in
include/dt-bindings/memory/tegra186-mc.h.
I saw similar masking in other tegra drivers also for stream-id.
Would add fixes for other comments in the next version.
Thanks,
Akhil
--
nvpublic
Powered by blists - more mailing lists