[From nobody Sat Aug 16 21:14:08 2008
Return-Path: Received: from ganesha.gnumonks.org ([unix socket])
	by ganesha (Cyrus v2.1.18-IPv6-Debian-2.1.18-1+sarge2) with LMTP;
	Wed, 04 Apr 2007 10:19:32 +0200
X-Sieve: CMU Sieve 2.2
Return-path: &lt;linux-arm-kernel-bounces+laforge=gnumonks.org@lists.arm.linux.org.uk&gt;
Received: from [2002:c35c:fd02::1] (helo=ZenIV.linux.org.uk)
	by ganesha.gnumonks.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1HZ0iK-0004Oc-2G
	for laforge@gnumonks.org; Wed, 04 Apr 2007 10:19:32 +0200
Received: from lists.arm.linux.org.uk ([217.147.92.251])
	by ZenIV.linux.org.uk with esmtpsa (Exim 4.52 #1 (Red Hat Linux))
	id 1HZ0gk-0004aF-7f; Wed, 04 Apr 2007 09:17:57 +0100
Received: from localhost ([127.0.0.1] helo=lists.arm.linux.org.uk)
	by lists.arm.linux.org.uk with esmtp (Exim 4.50)
	id 1HZ0gW-0001cB-Td; Wed, 04 Apr 2007 09:17:40 +0100
Received: from www.osadl.org ([213.239.205.134] helo=mail.tglx.de)
	by lists.arm.linux.org.uk with esmtp (Exim 4.50) id 1HZ0eC-0001bU-Sk
	for linux-arm-kernel@lists.arm.linux.org.uk;
	Wed, 04 Apr 2007 09:15:22 +0100
Received: from hermes.tec.linutronix.de (unknown [192.168.0.1])
	by mail.tglx.de (Postfix) with ESMTP id 3255365C292;
	Wed,  4 Apr 2007 10:15:11 +0200 (CEST)
Received: from tglx.tec.linutronix.de (tglx.tec.linutronix.de [192.168.0.68])
	by hermes.tec.linutronix.de (Postfix) with ESMTP id 6CC5F266DB4;
	Wed,  4 Apr 2007 10:15:10 +0200 (CEST)
From: Thomas Gleixner &lt;tglx@linutronix.de&gt;
To: Ben Dooks &lt;ben-linux-arm@fluff.org&gt;
Content-Type: text/plain
Date: Wed, 04 Apr 2007 10:15:28 +0200
Message-Id: &lt;1175674528.28263.296.camel@localhost.localdomain&gt;
Mime-Version: 1.0
X-Mailer: Evolution 2.6.1 
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/); 186e8b483c7a847866f354868fcb7a8b
X-Spam-Report: SpamAssassin version 3.0.3 on lists.arm.linux.org.uk summary:
	Content analysis details:   (0.1 points, 5.0 required)
	pts rule name              description
	---- ----------------------
	--------------------------------------------------
	0.1 FORGED_RCVD_HELO       Received: contains a forged HELO
Cc: linux-arm-kernel@lists.arm.linux.org.uk
Subject: [PATCH] S3C24xx: Fix UART malfunction with RTSCTS enabled
X-BeenThere: linux-arm-kernel@lists.arm.linux.org.uk
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: ARM Linux kernel discussions &lt;linux-arm-kernel.lists.arm.linux.org.uk&gt;
List-Unsubscribe: &lt;http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel&gt;,
	&lt;mailto:linux-arm-kernel-request@lists.arm.linux.org.uk?subject=unsubscribe&gt;
List-Archive: &lt;http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel&gt;
List-Post: &lt;mailto:linux-arm-kernel@lists.arm.linux.org.uk&gt;
List-Help: &lt;mailto:linux-arm-kernel-request@lists.arm.linux.org.uk?subject=help&gt;
List-Subscribe: &lt;http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel&gt;,
	&lt;mailto:linux-arm-kernel-request@lists.arm.linux.org.uk?subject=subscribe&gt;
Sender: linux-arm-kernel-bounces@lists.arm.linux.org.uk
X-Spam-Score: 0.1 (/)
X-Spam-Report: SpamAssassin version 3.0.4 on ZenIV.linux.org.uk summary:
	Content analysis details:   (0.1 points, 5.0 required)
	pts rule name              description
	---- ----------------------
	--------------------------------------------------
	0.1 FORGED_RCVD_HELO       Received: contains a forged HELO
Errors-To: linux-arm-kernel-bounces+laforge=gnumonks.org+laforge=gnumonks.org@lists.arm.linux.org.uk
X-Spam-Score: 0.1 (/)
X-Spam-Report: SpamASsassin versoin 3.0.3 on ganesha.gnumonks.org summary:
	Content analysis details:   (0.1 points, 5.0 required)
	pts rule name              description
	---- ----------------------
	--------------------------------------------------
	0.1 FORGED_RCVD_HELO       Received: contains a forged HELO

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 &lt;tglx@linutronix.de&gt;

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 &amp; S3C2410_UMSTAT_CTS)
+	/*
+	 * The 3rd does not support handshake lines, so we avoid to
+	 * read from the control register.
+	 */
+	if (port-&gt;line &lt; 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 &amp; S3C2410_UMSTAT_CTS) || (umcon &amp; 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
]