Re: RFC: Support DMA timeout interrupt for UART Rx

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

 



On Thu, Feb 25, 2016 at 02:02:45PM +0000, Shevchenko, Andriy wrote:
> Recently I've met an issue which, I guess, requires architectural
> changes in virt-chan API.

You are mistaken. :)

> HSU DMA Documentation states in particular "
> If the UART receives data that does not reach the size of the minimum
> bus transfer size, than this data remains in the buffer and is never
> delivered to the memory by the DMA.
> In order to resolve such potential problem, the UART generates a
> timeout interrupt to the DMA. This interrupt is not dependent on the
> timeout enable bit in the UART but is always enabled.
> Once the DMA receives such an interrupts, it will start emptying the
> FIFO and assert its own timeout interrupt to the CPU."

I'm not sure about the terminology here: "UART generates a timeout
interrupt to the DMA" ?  Don't interrupts go to the CPU?  That's what
other UARTs do.

> Our current DMA <-> UART work flow relies on UART Timeout Interrupt,
> which is not happen in this case.

That sounds like the UART is buggy.

> What DMA Engine API provides us? The callback function and possibility
> to call a _tx_status() from it. During completion tasklet the flow
> looks like this:
> 1. Split completed descriptor to local list.
> 2. Get callback functions for first descriptor in the list.
> 3. Free the descriptor.
> 4. Call callback. <<< descriptor related information is gone already!

If the completion function is called, then the DMA operation has
completed, which means the full amount of requested data has been
tranferred.

The way other UARTs handle this is that when the CPU receives the UART
RX timeout interrupt, they pause the RX DMA, and ask for its status.
The status callback tells you the DMA residue, which is the number of
bytes remaining to be transferred.  From that, you can work out the
number of bytes that have already been transferred, and if you need to,
read the remaining untransferred bytes from the UART, passing them all
up to the higher TTY layers.

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux