Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1329185
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4] dmaengine: edma: fix residue race for cyclic |
| Date | 2016-02-08 16:30 +0100 |
| Message-ID | <qZVVg-782-25@gated-at.bofh.it> (permalink) |
| References | <qVRZU-1Z8-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Jan 28, 2016 at 12:29 PM, John Ogness <john.ogness@linutronix.de> wrote:
> When retrieving the residue value, the SRC/DST fields of the
> active PaRAM are read to determine the current position of
> the DMA engine. However, the AM335x Technical Reference Manual
> states:
> + /*
> + * "pos" may represent a transfer request that is still being
> + * processed by the EDMACC or EDMATC. We will busy wait until
> + * any one of the situations occurs:
> + * 1. the DMA hardware is idle
> + * 2. a new transfer request is setup
> + * 3. we hit the loop limit
> + */
> + while (edma_read(echan->ecc, EDMA_CCSTAT) & EDMA_CCSTAT_ACTV) {
> + /* check if a new transfer request is setup */
> + if (edma_get_position(echan->ecc,
> + echan->slot[0], dst) != pos) {
> + break;
> + }
> +
> + if (!--loop_count) {
More usual pattern is
while (... && --count) {
}
if (!count) {
Timeout!
}
But since it's minor and already applied, just take into consideration
for the future.
> + dev_dbg_ratelimited(echan->vchan.chan.device->dev,
> + "%s: timeout waiting for PaRAM update\n",
> + __func__);
> + break;
> + }
> +
> + cpu_relax();
> + }
--
With Best Regards,
Andy Shevchenko
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v4] dmaengine: edma: fix residue race for cyclic John Ogness <john.ogness@linutronix.de> - 2016-01-28 11:30 +0100 Re: [PATCH v4] dmaengine: edma: fix residue race for cyclic Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-02-01 15:00 +0100 Re: [PATCH v4] dmaengine: edma: fix residue race for cyclic Vinod Koul <vinod.koul@intel.com> - 2016-02-08 04:20 +0100 Re: [PATCH v4] dmaengine: edma: fix residue race for cyclic Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-02-08 16:30 +0100
csiph-web