From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: <dan.j.williams@intel.com>, <dmaengine@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-omap@vger.kernel.org>
Subject: Re: [PATCH v4 3/3] dmaengine: ti: edma: Support for polled (memcpy) completion
Date: Sat, 13 Jul 2019 00:05:43 +0300 [thread overview]
Message-ID: <d695a2fa-61d4-e312-11d9-b501b6bc18a7@ti.com> (raw)
In-Reply-To: <20190705061714.GU2911@vkoul-mobl>
On 5.7.2019 9.17, Vinod Koul wrote:
>> @@ -1840,18 +1847,40 @@ static enum dma_status edma_tx_status(struct dma_chan *chan,
>> {
>> struct edma_chan *echan = to_edma_chan(chan);
>> struct virt_dma_desc *vdesc;
>> + struct dma_tx_state txstate_tmp;
>> enum dma_status ret;
>> unsigned long flags;
>>
>> ret = dma_cookie_status(chan, cookie, txstate);
>> - if (ret == DMA_COMPLETE || !txstate)
>> +
>> + /* Provide a dummy dma_tx_state for completion checking */
>> + if (ret != DMA_COMPLETE && !txstate)
>> + txstate = &txstate_tmp;
>> +
>> + if (ret == DMA_COMPLETE)
>> return ret;
>
> why not do:
>
> if (ret == DMA_COMPLETE)
> return ret;
>
> if (!txstate)
> txstate = &txstate_tmp;
>
Indeed it is much cleaner this way. Will send an updated series next week.
>> + txstate->residue = 0;
>> spin_lock_irqsave(&echan->vchan.lock, flags);
>> if (echan->edesc && echan->edesc->vdesc.tx.cookie == cookie)
>> txstate->residue = edma_residue(echan->edesc);
>> else if ((vdesc = vchan_find_desc(&echan->vchan, cookie)))
>> txstate->residue = to_edma_desc(&vdesc->tx)->residue;
>> +
>> + /*
>> + * Mark the cookie completed if the residue is 0 for non cyclic
>> + * transfers
>> + */
>> + if (ret != DMA_COMPLETE && !txstate->residue &&
>> + echan->edesc && echan->edesc->polled &&
>> + echan->edesc->vdesc.tx.cookie == cookie) {
>> + edma_stop(echan);
>> + vchan_cookie_complete(&echan->edesc->vdesc);
>> + echan->edesc = NULL;
>> + edma_execute(echan);
>> + ret = DMA_COMPLETE;
>> + }
>> +
>> spin_unlock_irqrestore(&echan->vchan.lock, flags);
>>
>> return ret;
>> --
>> Peter
>>
>> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
>> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>
--
Peter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
prev parent reply other threads:[~2019-07-12 21:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-18 13:21 [PATCH v4 0/3] dmaengine: ti: edma: Polled completion support Peter Ujfalusi
2019-06-18 13:21 ` [PATCH v4 1/3] dmaengine: ti: edma: Clean up the 2x32bit array register accesses Peter Ujfalusi
2019-06-18 13:21 ` [PATCH v4 2/3] dmaengine: ti: edma: Correct the residue calculation (fix for memcpy) Peter Ujfalusi
2019-06-18 13:21 ` [PATCH v4 3/3] dmaengine: ti: edma: Support for polled (memcpy) completion Peter Ujfalusi
2019-07-05 6:17 ` Vinod Koul
2019-07-12 21:05 ` Peter Ujfalusi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d695a2fa-61d4-e312-11d9-b501b6bc18a7@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox