RE: [PATCH v6 2/4] dmaengine: tegra: Add tegra gpcdma driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux