Re: [patch 5/6] edma: Make reading the position of active channels work

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

 



On Thu, 17 Apr 2014, Joel Fernandes wrote:
> On 04/17/2014 09:40 AM, Thomas Gleixner wrote:
> > +	/*
> > +	 * If the channel is active, we need to double read as we
> > +	 * might see half updated data. We limit this to 5
> > +	 * attempts. If that fails we return -EBUSY and let the caller
> > +	 * deal with it.
> > +	 */
> > +	dat = edma_read(ctlr, offs);
> > +	for (i = 0; i < 5; i++) {
> > +		u32 tmp = edma_read(ctlr, offs);
> > +
> > +		if (tmp == dat) {
> > +			*pos = dat;
> > +			return 0;
> > +		}
> > +		dat = tmp;
> > +	}
> > +	return -EBUSY;
> >  }
> > -EXPORT_SYMBOL(edma_get_position);
> >  
> >  /**
> 
> The access is synchronized though and you shouldn't see unreliable
> results, unless you _are_ seeing unreliable results in which case it
> could be a silicon issue.
>
> The original code also doesn't have the double read so I would just drop
> that, unless you are seeing reliability issues.
>
> Here's a thread that discusses it and the end conclusion is that it
> should be fine (Kyle Kastile is one of the EDMA hardware designers).
> http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/99/t/66011.aspx

Gah, right I saw the issues with the original code, which does a
memcpy_fromio which copies byte by byte. Did not think about retrying
with the edma_read() based one.

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux