Messages in this thread | | | Date | Sun, 9 Jun 2013 22:43:38 +0300 | Subject | Re: [PATCH] dma: mmp_pdma: support for getting residual bytes | From | Andy Shevchenko <> |
| |
On Fri, Jun 7, 2013 at 6:02 AM, Xiang Wang <wangxfdu@gmail.com> wrote: > 2013/6/6 Andy Shevchenko <andy.shevchenko@gmail.com>: >> On Thu, Jun 6, 2013 at 6:09 AM, Xiang Wang <wangxfdu@gmail.com> wrote:
[]
>>> 2. DMA controller handles trailing bytes for us. >>> This is the case I mentioned in my previous email. "When a timed-out >>> event occurs in peripheral device, it will notify DMA controller and >>> DMA controller will send out a End of Receive interrupt" >>> I think we should know how many residual bytes in this case even the >>> DMA status is DMA_SUCCESS. >> >> I'm still not convinced that you have implement such algorithm. Anyway, >> if I got it correctly you have something like "Receive FIFO Occupancy >> Register (FOR)" in UART. When you got timeout interrupt, you may get >> residue and value from FOR, sum them, program DMA to transfer the >> trailing bytes. >> What did I miss? > This case is another working mode of peripheral device (e.g. UART). If > we configure UART to work in this mode, the hardware(DMA controller > and UART controller) will deal with the trailing bytes for us. > The workflow is likely to be: > a. When timeout occurs in UART, it notifies DMA controller to move the > trailing bytes in UART FIFO. (software transparent) > b. After DMA finishes moving all bytes in UART FIFO, it will send out > an End Of Receive(EOR) interrupt. > So in this case, software sees an EOR interrupt from DMA controller > instead of an Timeout Interrupt from UART controller.
Thanks for explanation.
It's quite good your hw could manage such cases, though I thing it's wrong to have residue great than 0 and DMA_SUCCESS as a status in the driver.
So, if Vinod, Dan, or any experienced developer is okay with it, I'm okay too.
-- With Best Regards, Andy Shevchenko
| |