[RFC/PATCH 05/13] serial: omap: drop DMA support

2012-08-21 Thread Felipe Balbi
The current support is known to be broken and
a later patch will come re-adding it using
dma engine API.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/tty/serial/omap-serial.c | 330 ++-
 1 file changed, 12 insertions(+), 318 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index fb81366..4d74a9b 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -33,14 +33,12 @@
 #include linux/tty.h
 #include linux/tty_flip.h
 #include linux/io.h
-#include linux/dma-mapping.h
 #include linux/clk.h
 #include linux/serial_core.h
 #include linux/irq.h
 #include linux/pm_runtime.h
 #include linux/of.h
 
-#include plat/dma.h
 #include plat/dmtimer.h
 #include plat/omap-serial.h
 
@@ -74,9 +72,6 @@
 static struct uart_omap_port *ui[OMAP_MAX_HSUART_PORTS];
 
 /* Forward declaration of functions */
-static void uart_tx_dma_callback(int lch, u16 ch_status, void *data);
-static void serial_omap_rxdma_poll(unsigned long uart_no);
-static int serial_omap_start_rxdma(struct uart_omap_port *up);
 static void serial_omap_mdr1_errataset(struct uart_omap_port *up, u8 mdr1);
 
 static struct workqueue_struct *serial_omap_uart_wq;
@@ -160,19 +155,6 @@ serial_omap_get_divisor(struct uart_port *port, unsigned 
int baud)
return port-uartclk/(baud * divisor);
 }
 
-static void serial_omap_stop_rxdma(struct uart_omap_port *up)
-{
-   if (up-uart_dma.rx_dma_used) {
-   del_timer(up-uart_dma.rx_timer);
-   omap_stop_dma(up-uart_dma.rx_dma_channel);
-   omap_free_dma(up-uart_dma.rx_dma_channel);
-   up-uart_dma.rx_dma_channel = OMAP_UART_DMA_CH_FREE;
-   up-uart_dma.rx_dma_used = false;
-   pm_runtime_mark_last_busy(up-dev);
-   pm_runtime_put_autosuspend(up-dev);
-   }
-}
-
 static void serial_omap_enable_ms(struct uart_port *port)
 {
struct uart_omap_port *up = to_uart_omap_port(port);
@@ -188,22 +170,6 @@ static void serial_omap_enable_ms(struct uart_port *port)
 static void serial_omap_stop_tx(struct uart_port *port)
 {
struct uart_omap_port *up = to_uart_omap_port(port);
-   struct omap_uart_port_info *pdata = up-dev-platform_data;
-
-   if (up-use_dma 
-   up-uart_dma.tx_dma_channel != OMAP_UART_DMA_CH_FREE) {
-   /*
-* Check if dma is still active. If yes do nothing,
-* return. Else stop dma
-*/
-   if (omap_get_dma_active_status(up-uart_dma.tx_dma_channel))
-   return;
-   omap_stop_dma(up-uart_dma.tx_dma_channel);
-   omap_free_dma(up-uart_dma.tx_dma_channel);
-   up-uart_dma.tx_dma_channel = OMAP_UART_DMA_CH_FREE;
-   pm_runtime_mark_last_busy(up-dev);
-   pm_runtime_put_autosuspend(up-dev);
-   }
 
pm_runtime_get_sync(up-dev);
if (up-ier  UART_IER_THRI) {
@@ -211,8 +177,7 @@ static void serial_omap_stop_tx(struct uart_port *port)
serial_out(up, UART_IER, up-ier);
}
 
-   if (!up-use_dma  pdata)
-   serial_omap_set_forceidle(up);
+   serial_omap_set_forceidle(up);
 
pm_runtime_mark_last_busy(up-dev);
pm_runtime_put_autosuspend(up-dev);
@@ -223,8 +188,6 @@ static void serial_omap_stop_rx(struct uart_port *port)
struct uart_omap_port *up = to_uart_omap_port(port);
 
pm_runtime_get_sync(up-dev);
-   if (up-use_dma)
-   serial_omap_stop_rxdma(up);
up-ier = ~UART_IER_RLSI;
up-port.read_status_mask = ~UART_LSR_DR;
serial_out(up, UART_IER, up-ier);
@@ -342,67 +305,12 @@ static inline void serial_omap_enable_ier_thri(struct 
uart_omap_port *up)
 static void serial_omap_start_tx(struct uart_port *port)
 {
struct uart_omap_port *up = to_uart_omap_port(port);
-   struct circ_buf *xmit;
-   unsigned int start;
-   int ret = 0;
-
-   if (!up-use_dma) {
-   pm_runtime_get_sync(up-dev);
-   serial_omap_enable_ier_thri(up);
-   serial_omap_set_noidle(up);
-   pm_runtime_mark_last_busy(up-dev);
-   pm_runtime_put_autosuspend(up-dev);
-   return;
-   }
-
-   if (up-uart_dma.tx_dma_used)
-   return;
-
-   xmit = up-port.state-xmit;
-
-   if (up-uart_dma.tx_dma_channel == OMAP_UART_DMA_CH_FREE) {
-   pm_runtime_get_sync(up-dev);
-   ret = omap_request_dma(up-uart_dma.uart_dma_tx,
-   UART Tx DMA,
-   (void *)uart_tx_dma_callback, up,
-   (up-uart_dma.tx_dma_channel));
 
-   if (ret  0) {
-   serial_omap_enable_ier_thri(up);
-   return;
-   }
-   }
-   spin_lock((up-uart_dma.tx_lock));
-   up-uart_dma.tx_dma_used = 

Re: [RFC/PATCH 05/13] serial: omap: drop DMA support

2012-08-21 Thread Shilimkar, Santosh
On Tue, Aug 21, 2012 at 2:45 PM, Felipe Balbi ba...@ti.com wrote:
 The current support is known to be broken and
 a later patch will come re-adding it using
 dma engine API.

 Signed-off-by: Felipe Balbi ba...@ti.com
 ---
Thanks Felipe !!
One less driver now towards OMAP DMA
engine conversion.

FWIW,
Acked-by: Santosh Shilimkar santosh.shilim...@ti.com
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC/PATCH 05/13] serial: omap: drop DMA support

2012-08-21 Thread Felipe Balbi
On Tue, Aug 21, 2012 at 03:14:19PM +0530, Shilimkar, Santosh wrote:
 On Tue, Aug 21, 2012 at 2:45 PM, Felipe Balbi ba...@ti.com wrote:
  The current support is known to be broken and
  a later patch will come re-adding it using
  dma engine API.
 
  Signed-off-by: Felipe Balbi ba...@ti.com
  ---
 Thanks Felipe !!

no problem.

 One less driver now towards OMAP DMA
 engine conversion.

indeed :-) I'll take a closer look into rx timeout IRQ, but it looks
like we can use it to kick dma only for big transfers... need to play
with it for a while first, though.

 FWIW,
 Acked-by: Santosh Shilimkar santosh.shilim...@ti.com

is this Ack for this patch only or the entire series ??

-- 
balbi


signature.asc
Description: Digital signature


Re: [RFC/PATCH 05/13] serial: omap: drop DMA support

2012-08-21 Thread Shilimkar, Santosh
On Tue, Aug 21, 2012 at 3:50 PM, Felipe Balbi ba...@ti.com wrote:
 On Tue, Aug 21, 2012 at 03:14:19PM +0530, Shilimkar, Santosh wrote:
 On Tue, Aug 21, 2012 at 2:45 PM, Felipe Balbi ba...@ti.com wrote:
  The current support is known to be broken and
  a later patch will come re-adding it using
  dma engine API.
 
  Signed-off-by: Felipe Balbi ba...@ti.com
  ---
 Thanks Felipe !!

 no problem.

 One less driver now towards OMAP DMA
 engine conversion.

 indeed :-) I'll take a closer look into rx timeout IRQ, but it looks
 like we can use it to kick dma only for big transfers... need to play
 with it for a while first, though.

Yep. The RX path with DMA is bit of difficult part to manage for
UART.

 FWIW,
 Acked-by: Santosh Shilimkar santosh.shilim...@ti.com

 is this Ack for this patch only or the entire series ??

Two more patches to review and then I will do it for
full series on top of the cover-letter :-)

Regards
Santosh
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC/PATCH 05/13] serial: omap: drop DMA support

2012-08-21 Thread Felipe Balbi
On Tue, Aug 21, 2012 at 04:05:22PM +0530, Shilimkar, Santosh wrote:
 On Tue, Aug 21, 2012 at 3:50 PM, Felipe Balbi ba...@ti.com wrote:
  On Tue, Aug 21, 2012 at 03:14:19PM +0530, Shilimkar, Santosh wrote:
  On Tue, Aug 21, 2012 at 2:45 PM, Felipe Balbi ba...@ti.com wrote:
   The current support is known to be broken and
   a later patch will come re-adding it using
   dma engine API.
  
   Signed-off-by: Felipe Balbi ba...@ti.com
   ---
  Thanks Felipe !!
 
  no problem.
 
  One less driver now towards OMAP DMA
  engine conversion.
 
  indeed :-) I'll take a closer look into rx timeout IRQ, but it looks
  like we can use it to kick dma only for big transfers... need to play
  with it for a while first, though.
 
 Yep. The RX path with DMA is bit of difficult part to manage for
 UART.
 
  FWIW,
  Acked-by: Santosh Shilimkar santosh.shilim...@ti.com
 
  is this Ack for this patch only or the entire series ??
 
 Two more patches to review and then I will do it for
 full series on top of the cover-letter :-)

cool, thanks

-- 
balbi


signature.asc
Description: Digital signature