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]
Date:	Thu, 3 Mar 2016 17:12:13 +0000
From:	Appana Durga Kedareswara Rao <appana.durga.rao@...inx.com>
To:	Vinod Koul <vinod.koul@...el.com>
CC:	"dan.j.williams@...el.com" <dan.j.williams@...el.com>,
	Michal Simek <michals@...inx.com>,
	Soren Brinkmann <sorenb@...inx.com>,
	"moritz.fischer@...us.com" <moritz.fischer@...us.com>,
	"laurent.pinchart@...asonboard.com" 
	<laurent.pinchart@...asonboard.com>,
	"luis@...ethencourt.com" <luis@...ethencourt.com>,
	Anirudha Sarangi <anirudh@...inx.com>,
	"dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v3 4/4] dmaengine: xilinx_vdma: Use readl_poll_timeout
 instead of do while loop's

Hi Vinod,


> -----Original Message-----
> From: dmaengine-owner@...r.kernel.org [mailto:dmaengine-
> owner@...r.kernel.org] On Behalf Of Vinod Koul
> Sent: Thursday, March 03, 2016 9:00 PM
> To: Appana Durga Kedareswara Rao
> Cc: dan.j.williams@...el.com; Michal Simek; Soren Brinkmann; Appana Durga
> Kedareswara Rao; moritz.fischer@...us.com;
> laurent.pinchart@...asonboard.com; luis@...ethencourt.com; Anirudha
> Sarangi; dmaengine@...r.kernel.org; linux-arm-kernel@...ts.infradead.org;
> linux-kernel@...r.kernel.org
> Subject: Re: [PATCH v3 4/4] dmaengine: xilinx_vdma: Use readl_poll_timeout
> instead of do while loop's
> 
> On Fri, Feb 26, 2016 at 07:33:54PM +0530, Kedareswara rao Appana wrote:
> 
> >  static void xilinx_vdma_halt(struct xilinx_vdma_chan *chan)  {
> > -	int loop = XILINX_VDMA_LOOP_COUNT;
> > +	int err = 0;
> > +	u32 val;
> >
> >  	vdma_ctrl_clr(chan, XILINX_VDMA_REG_DMACR,
> > XILINX_VDMA_DMACR_RUNSTOP);
> >
> >  	/* Wait for the hardware to halt */
> > -	do {
> > -		if (vdma_ctrl_read(chan, XILINX_VDMA_REG_DMASR) &
> > -		    XILINX_VDMA_DMASR_HALTED)
> > -			break;
> > -	} while (loop--);
> > +	err = xilinx_vdma_poll_timeout(chan, XILINX_VDMA_REG_DMASR, val,
> > +				      (val & XILINX_VDMA_DMASR_HALTED), 0,
> > +				      XILINX_VDMA_LOOP_COUNT);
> >
> > -	if (!loop) {
> > +	if (err) {
> >  		dev_err(chan->dev, "Cannot stop channel %p: %x\n",
> >  			chan, vdma_ctrl_read(chan,
> XILINX_VDMA_REG_DMASR));
> >  		chan->err = true;
> > @@ -576,18 +579,17 @@ static void xilinx_vdma_halt(struct
> xilinx_vdma_chan *chan)
> >   */
> >  static void xilinx_vdma_start(struct xilinx_vdma_chan *chan)  {
> > -	int loop = XILINX_VDMA_LOOP_COUNT;
> > +	int err = 0;
> 
> why is this initialization required here and other places?

Yes initialization is not required on the other mail you said you already applied this patch series.
Will send a separate patch to fix it.

Regards,
Kedar.

> 
> > +	u32 val;
> >
> >  	vdma_ctrl_set(chan, XILINX_VDMA_REG_DMACR,
> > XILINX_VDMA_DMACR_RUNSTOP);
> >
> >  	/* Wait for the hardware to start */
> > -	do {
> > -		if (!(vdma_ctrl_read(chan, XILINX_VDMA_REG_DMASR) &
> > -		      XILINX_VDMA_DMASR_HALTED))
> > -			break;
> > -	} while (loop--);
> > +	err = xilinx_vdma_poll_timeout(chan, XILINX_VDMA_REG_DMASR, val,
> > +				      !(val & XILINX_VDMA_DMASR_HALTED), 0,
> > +				      XILINX_VDMA_LOOP_COUNT);
> >
> > -	if (!loop) {
> > +	if (err) {
> >  		dev_err(chan->dev, "Cannot start channel %p: %x\n",
> >  			chan, vdma_ctrl_read(chan,
> XILINX_VDMA_REG_DMASR));
> >
> > @@ -754,21 +756,17 @@ static void xilinx_vdma_complete_descriptor(struct
> xilinx_vdma_chan *chan)
> >   */
> >  static int xilinx_vdma_reset(struct xilinx_vdma_chan *chan)  {
> > -	int loop = XILINX_VDMA_LOOP_COUNT;
> > +	int err = 0;
> >  	u32 tmp;
> >
> >  	vdma_ctrl_set(chan, XILINX_VDMA_REG_DMACR,
> XILINX_VDMA_DMACR_RESET);
> >
> > -	tmp = vdma_ctrl_read(chan, XILINX_VDMA_REG_DMACR) &
> > -		XILINX_VDMA_DMACR_RESET;
> > -
> >  	/* Wait for the hardware to finish reset */
> > -	do {
> > -		tmp = vdma_ctrl_read(chan, XILINX_VDMA_REG_DMACR) &
> > -			XILINX_VDMA_DMACR_RESET;
> > -	} while (loop-- && tmp);
> > +	err = xilinx_vdma_poll_timeout(chan, XILINX_VDMA_REG_DMACR, tmp,
> > +				      !(tmp & XILINX_VDMA_DMACR_RESET), 0,
> > +				      XILINX_VDMA_LOOP_COUNT);
> >
> > -	if (!loop) {
> > +	if (err) {
> 
> 
> 
> --
> ~Vinod
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body
> of a message to majordomo@...r.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ