Re: [PATCH v2] ARM: PL011: Add support for Rx DMA buffer polling

From: Linus Walleij
Date: Tue Jan 22 2013 - 08:18:15 EST


On Tue, Jan 22, 2013 at 1:45 PM, Chanho Min <chanho.min@xxxxxxx> wrote:

> In DMA support, The received data is not pushed to tty until the DMA buffer
> is filled. But some megabyte rate chips such as BT expect fast response and
> data should be pushed immediately. In order to fix this issue, We suggest
> the use of the timer for polling DMA buffer.
> In our test, no data loss occurred at high-baudrate as compared with interrupt-
> driven (We tested with 3Mbps).

So to enable this you put a poll rate > 0 into the new variable,
OK seems like it could work...

> - If poll timer is activated, We use consistent DMA mappings to avoid from
> the frequent cache operation of the timer function. sg->coherency is used
> to check if buffer is coherent.

Hm. We can begin like this but maybe we should later patch it to
make this the default unless it has performance impacts on our
systems.

> +++ b/include/linux/amba/serial.h
> @@ -203,6 +203,8 @@ struct amba_pl011_data {
> bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
> void *dma_rx_param;
> void *dma_tx_param;
> + unsigned int dma_rx_poll_rate;
> + unsigned int dma_rx_poll_timeout;
> void (*init) (void);
> void (*exit) (void);
> };

Maybe this is a good opportunity to add some kerneldoc above
this struct so as to help platform implementers. It will invariably
be reused by Device Tree binding authors later on...

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/