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

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

 



> 29.01.2022 19:40, Akhil R пишет:
> > +static int tegra_dma_device_pause(struct dma_chan *dc) {
> > +     struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc);
> > +     unsigned long wcount, flags;
> > +     int ret = 0;
> > +
> > +     if (!tdc->tdma->chip_data->hw_support_pause)
> > +             return 0;
> 
> It's wrong to return zero if pause unsupported, please see what
> dmaengine_pause() returns.
> 
> > +
> > +     spin_lock_irqsave(&tdc->vc.lock, flags);
> > +     if (!tdc->dma_desc)
> > +             goto out;
> > +
> > +     ret = tegra_dma_pause(tdc);
> > +     if (ret) {
> > +             dev_err(tdc2dev(tdc), "DMA pause timed out\n");
> > +             goto out;
> > +     }
> > +
> > +     wcount = tdc_read(tdc, TEGRA_GPCDMA_CHAN_XFER_COUNT);
> > +     tdc->dma_desc->bytes_xfer +=
> > +                     tdc->dma_desc->bytes_req - (wcount * 4);
> 
> Why transfer is accumulated?
> 
> Why do you need to update xfer size at all on pause?

I will verify the calculation. This looks correct only for single sg transaction.

Updating xfer_size is added to support drivers which pause the transaction
and read the status before terminating. 
Eg. https://elixir.bootlin.com/linux/latest/source/drivers/tty/serial/amba-pl011.c

Thanks,
Akhil 




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux