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] [day] [month] [year] [list]
Message-ID: <CH2PR02MB7000539B4F841BABC31AA07AC79D0@CH2PR02MB7000.namprd02.prod.outlook.com>
Date:   Tue, 1 Oct 2019 12:03:48 +0000
From:   Radhey Shyam Pandey <radheys@...inx.com>
To:     Vinod Koul <vkoul@...nel.org>
CC:     "dan.j.williams@...el.com" <dan.j.williams@...el.com>,
        Michal Simek <michals@...inx.com>,
        "nick.graumann@...il.com" <nick.graumann@...il.com>,
        "andrea.merello@...il.com" <andrea.merello@...il.com>,
        Appana Durga Kedareswara Rao <appanad@...inx.com>,
        "mcgrof@...nel.org" <mcgrof@...nel.org>,
        "dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH -next 3/8] dmaengine: xilinx_dma: Introduce
 xilinx_dma_get_residue

> -----Original Message-----
> From: Radhey Shyam Pandey
> Sent: Friday, September 27, 2019 10:46 AM
> To: Vinod Koul <vkoul@...nel.org>
> Cc: dan.j.williams@...el.com; Michal Simek <michals@...inx.com>;
> nick.graumann@...il.com; andrea.merello@...il.com; Appana Durga
> Kedareswara Rao <appanad@...inx.com>; mcgrof@...nel.org;
> dmaengine@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: RE: [PATCH -next 3/8] dmaengine: xilinx_dma: Introduce
> xilinx_dma_get_residue
> 
> > -----Original Message-----
> > From: Vinod Koul <vkoul@...nel.org>
> > Sent: Thursday, September 26, 2019 10:48 PM
> > To: Radhey Shyam Pandey <radheys@...inx.com>
> > Cc: dan.j.williams@...el.com; Michal Simek <michals@...inx.com>;
> > nick.graumann@...il.com; andrea.merello@...il.com; Appana Durga
> > Kedareswara Rao <appanad@...inx.com>; mcgrof@...nel.org;
> > dmaengine@...r.kernel.org; linux-kernel@...r.kernel.org
> > Subject: Re: [PATCH -next 3/8] dmaengine: xilinx_dma: Introduce
> > xilinx_dma_get_residue
> >
> > On 26-09-19, 05:52, Radhey Shyam Pandey wrote:
> >
> > > > > +	 * VDMA and simple mode do not support residue reporting,
> so the
> > > > > +	 * residue field will always be 0.
> > > > > +	 */
> > > > > +	if (chan->xdev->dma_config->dmatype ==
> XDMA_TYPE_VDMA ||
> > > > !chan->has_sg)
> > > > > +		return residue;
> > > >
> > > > why not check this in status callback?
> > > Assuming we mean to move vdma and non-sg check to
> > xilinx_dma_tx_status.
> > > Just a thought- Keeping this check in xilinx_dma_get_residue
> > > provides an abstraction and caller can simply call this func with
> > > knowing about IP config specific residue calculation. Considering
> > > this point does it looks ok ?
> >
> > well you are checking either way, so calling the lower level function
> > only when you need it makes more sense!
> 
> Sure, will do it in v2.

Just noticed that xilinx_dma_get_residue() is called at the multiple
places i.e one in device_tx_status and other in _complete_descriptor.
To avoid code duplication, I will create a helper function to check
if residue calculation is supported.

> >
> > --
> > ~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ