lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 31 Jan 2022 09:42:05 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Akhil R <akhilrajeev@...dia.com>
Cc:     "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
        Jonathan Hunter <jonathanh@...dia.com>,
        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>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "thierry.reding@...il.com" <thierry.reding@...il.com>,
        "vkoul@...nel.org" <vkoul@...nel.org>,
        Pavan Kunapuli <pkunapuli@...dia.com>
Subject: Re: [PATCH v17 2/4] dmaengine: tegra: Add tegra gpcdma driver

В Mon, 31 Jan 2022 04:25:14 +0000
Akhil R <akhilrajeev@...dia.com> пишет:

> > 30.01.2022 19:34, Akhil R пишет:  
> > >> 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.  
> > 
> > Why you couldn't update the status in tegra_dma_terminate_all()?  
> Is it useful to update the status in terminate_all()? I assume the
> descriptor Is freed in vchan_dma_desc_free_list() or am I getting it
> wrong?

Yes, it's not useful. Then you only need to fix the tx_status() and
don't touch dma_desc on pause.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ