Maybe this fixes or otherwise positively affects our RTS/CTS issues with
the GSM Modem (stty / ..)?

Somebody interested in giving this a try and see if it changes the GSM
flow control behaviour?

Please give apropriate feedback to this list.

Thanks!
-- 
- Harald Welte <[EMAIL PROTECTED]>                      http://openmoko.org/
============================================================================
Software for the world's first truly open Free Software mobile phone
--- Begin Message ---
The S3C24xx UARTs have an Automatic Flow Control feature, which handles
the hardware handshake via RTS/CTS itself. A change on the cts line does
not result in an interrupt.

When the UART is configured for hardware handshake the serial core code
reads the status of the CTS line. If the line status indicates that the
connected device is not ready to receive data, then the uart is blocked
until the status of the CTS line changes. Due to the missing CTS change
interrupt the UART transmit side is blocked for ever.

Change the modem control status read function so it returns with
TIOCM_CTS set, when the AFC feature is enabled.

Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>

diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 3ba9208..650aec3 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -458,8 +458,21 @@ static unsigned int s3c24xx_serial_tx_empty(struct 
uart_port *port)
 static unsigned int s3c24xx_serial_get_mctrl(struct uart_port *port)
 {
        unsigned int umstat = rd_regb(port,S3C2410_UMSTAT);
+       unsigned int umcon = S3C2410_UMCOM_AFC;
 
-       if (umstat & S3C2410_UMSTAT_CTS)
+       /*
+        * The 3rd does not support handshake lines, so we avoid to
+        * read from the control register.
+        */
+       if (port->line < 2)
+               umcon = rd_regb(port, S3C2410_UMCON);
+
+       /*
+        * Return the status of the CTS line only when AFC is turned
+        * off. Otherwise the logic in serial_core might disable the
+        * uart for ever.
+        */
+       if ((umstat & S3C2410_UMSTAT_CTS) || (umcon & S3C2410_UMCOM_AFC))
                return TIOCM_CAR | TIOCM_DSR | TIOCM_CTS;
        else
                return TIOCM_CAR | TIOCM_DSR;





-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

--- End Message ---

Reply via email to