Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1563361 > unrolled thread
| Started by | Vignesh R <vigneshr@ti.com> |
|---|---|
| First post | 2017-01-20 09:20 +0100 |
| Last post | 2017-01-20 09:30 +0100 |
| Articles | 3 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH RESEND 0/3] serial: 8250_omap: Enable DMA support Vignesh R <vigneshr@ti.com> - 2017-01-20 09:20 +0100
[PATCH RESEND 1/3] serial: 8250_omap: pause DMA only if DMA transfer in progress Vignesh R <vigneshr@ti.com> - 2017-01-20 09:20 +0100
[PATCH RESEND 3/3] serial: 8250_omap: Remove rx_dma_broken flag Vignesh R <vigneshr@ti.com> - 2017-01-20 09:30 +0100
| From | Vignesh R <vigneshr@ti.com> |
|---|---|
| Date | 2017-01-20 09:20 +0100 |
| Subject | [PATCH RESEND 0/3] serial: 8250_omap: Enable DMA support |
| Message-ID | <t1CAp-4Pq-3@gated-at.bofh.it> |
This patch series re enables DMA support for UART 8250_omap driver. Tested on AM335x, AM437x that use EDMA and OMAP5 and DRA74 EVM with SDMA. Vignesh R (3): serial :8250_omap: pause DMA only if DMA transfer in progress serial: 8250_omap: Add OMAP_DMA_TX_KICK quirk for AM437x serial: 8250_omap: Remove rx_dma_broken flag drivers/tty/serial/8250/8250_omap.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) -- 2.11.0
[toc] | [next] | [standalone]
| From | Vignesh R <vigneshr@ti.com> |
|---|---|
| Date | 2017-01-20 09:20 +0100 |
| Subject | [PATCH RESEND 1/3] serial: 8250_omap: pause DMA only if DMA transfer in progress |
| Message-ID | <t1CAp-4Pq-15@gated-at.bofh.it> |
| In reply to | #1563361 |
It is possible that DMA transfer is already complete but, completion
handler is yet to be called, when dmaengine_pause() is called in case of
error condition(like break/rx timeout). This leads to dmaengine_pause()
API to return EINVAL (as descriptor is already NULL) causing
rx_dma_broken flag to be set and effectively disabling RX DMA.
Fix this by calling dmaengine_pause() only when transfer is in progress.
Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
---
drivers/tty/serial/8250/8250_omap.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 61ad6c3b20a0..4ad1934ef6ed 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -790,6 +790,7 @@ static void omap_8250_rx_dma_flush(struct uart_8250_port *p)
{
struct omap8250_priv *priv = p->port.private_data;
struct uart_8250_dma *dma = p->dma;
+ struct dma_tx_state state;
unsigned long flags;
int ret;
@@ -800,10 +801,12 @@ static void omap_8250_rx_dma_flush(struct uart_8250_port *p)
return;
}
- ret = dmaengine_pause(dma->rxchan);
- if (WARN_ON_ONCE(ret))
- priv->rx_dma_broken = true;
-
+ ret = dmaengine_tx_status(dma->rxchan, dma->rx_cookie, &state);
+ if (ret == DMA_IN_PROGRESS) {
+ ret = dmaengine_pause(dma->rxchan);
+ if (WARN_ON_ONCE(ret))
+ priv->rx_dma_broken = true;
+ }
spin_unlock_irqrestore(&priv->rx_dma_lock, flags);
__dma_rx_do_complete(p);
--
2.11.0
[toc] | [prev] | [next] | [standalone]
| From | Vignesh R <vigneshr@ti.com> |
|---|---|
| Date | 2017-01-20 09:30 +0100 |
| Subject | [PATCH RESEND 3/3] serial: 8250_omap: Remove rx_dma_broken flag |
| Message-ID | <t1CK6-4SH-9@gated-at.bofh.it> |
| In reply to | #1563361 |
8250 UART DMA support was marked broken by default as it was not possible to pause ongoing RX DMA transfer. Now that both SDMA and EDMA can support pause operation for RX DMA transactions, don't set rx_dma_broken to true by default. With this patch 8250_omap driver will use DMA by default. Signed-off-by: Vignesh R <vigneshr@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> --- drivers/tty/serial/8250/8250_omap.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index 97766dcd67d4..68a6393d9636 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -1221,11 +1221,6 @@ static int omap8250_probe(struct platform_device *pdev) priv->omap8250_dma.rx_size = RX_TRIGGER; priv->omap8250_dma.rxconf.src_maxburst = RX_TRIGGER; priv->omap8250_dma.txconf.dst_maxburst = TX_TRIGGER; - /* - * pause is currently not supported atleast on omap-sdma - * and edma on most earlier kernels. - */ - priv->rx_dma_broken = true; } } #endif -- 2.11.0
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web