All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@suse.de>
To: valentin.longchamp@epfl.ch, alan@linux.intel.com, gregkh@suse.de,
	linux-serial@vger.kernel.org, philippe.retornaz@epfl.ch,
	s.hauer@pengutronix.de, stable@kernel.org, w.sang@pengutronix.de
Subject: patch serial-imx.c-fix-cts-trigger-level-lower-to-avoid-lost-chars.patch added to gregkh-2.6 tree
Date: Wed, 05 May 2010 16:48:15 -0700	[thread overview]
Message-ID: <12731032952456@kroah.org> (raw)
In-Reply-To: <4BE13E9B.6050406@epfl.ch>


This is a note to let you know that I've just added the patch titled

    Subject: serial: imx.c: fix CTS trigger level lower to avoid lost chars

to my gregkh-2.6 tree.  Its filename is

    serial-imx.c-fix-cts-trigger-level-lower-to-avoid-lost-chars.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


From valentin.longchamp@epfl.ch  Wed May  5 11:15:04 2010
From: Valentin Longchamp <valentin.longchamp@epfl.ch>
Date: Wed, 05 May 2010 11:47:07 +0200
Subject: serial: imx.c: fix CTS trigger level lower to avoid lost chars
To: Alan Cox <alan@linux.intel.com>
Cc: "s.hauer@pengutronix.de" <s.hauer@pengutronix.de>, "w.sang@pengutronix.de" <w.sang@pengutronix.de>, "linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>, Greg Kroah-Hartman <gregkh@suse.de>
Message-ID: <4BE13E9B.6050406@epfl.ch>


The imx CTS trigger level is left at its reset value that is 32
chars. Since the RX FIFO has 32 entries, when CTS is raised, the
FIFO already is full. However, some serial port devices first empty
their TX FIFO before stopping when CTS is raised, resulting in lost
chars.

This patch sets the trigger level lower so that other chars arrive
after CTS is raised, there is still room for 16 of them.

Signed-off-by: Valentin Longchamp<valentin.longchamp@epfl.ch>
Tested-by: Philippe Rétornaz<philippe.retornaz@epfl.ch>
Acked-by: Wolfram Sang<w.sang@pengutronix.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/serial/imx.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -120,7 +120,8 @@
 #define  MX2_UCR3_RXDMUXSEL	 (1<<2)  /* RXD Muxed Input Select, on mx2/mx3 */
 #define  UCR3_INVT  	 (1<<1)  /* Inverted Infrared transmission */
 #define  UCR3_BPEN  	 (1<<0)  /* Preset registers enable */
-#define  UCR4_CTSTL_32   (32<<10) /* CTS trigger level (32 chars) */
+#define  UCR4_CTSTL_SHF  10      /* CTS trigger level shift */
+#define  UCR4_CTSTL_MASK 0x3F    /* CTS trigger is 6 bits wide */
 #define  UCR4_INVR  	 (1<<9)  /* Inverted infrared reception */
 #define  UCR4_ENIRI 	 (1<<8)  /* Serial infrared interrupt enable */
 #define  UCR4_WKEN  	 (1<<7)  /* Wake interrupt enable */
@@ -591,6 +592,9 @@ static int imx_setup_ufcr(struct imx_por
 	return 0;
 }
 
+/* half the RX buffer size */
+#define CTSTL 16
+
 static int imx_startup(struct uart_port *port)
 {
 	struct imx_port *sport = (struct imx_port *)port;
@@ -607,6 +611,10 @@ static int imx_startup(struct uart_port
 	if (USE_IRDA(sport))
 		temp |= UCR4_IRSC;
 
+	/* set the trigger level for CTS */
+	temp &= ~(UCR4_CTSTL_MASK<<  UCR4_CTSTL_SHF);
+	temp |= CTSTL<<  UCR4_CTSTL_SHF;
+
 	writel(temp & ~UCR4_DREN, sport->port.membase + UCR4);
 
 	if (USE_IRDA(sport)) {

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

      parent reply	other threads:[~2010-05-05 23:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-21 21:26 [PATCH] serial imx.c: fix CTS trigger level lower to avoid lost chars Valentin Longchamp
2010-01-21 22:06 ` Wolfram Sang
2010-01-21 22:06   ` Wolfram Sang
2010-01-21 22:11   ` Russell King - ARM Linux
2010-01-21 22:11     ` Russell King - ARM Linux
2010-01-22 10:14     ` Valentin Longchamp
2010-01-22 10:14       ` Valentin Longchamp
2010-01-22 11:07       ` Jamie Lokier
2010-01-22 11:07         ` Jamie Lokier
2010-01-22 11:31         ` Russell King - ARM Linux
2010-01-22 11:31           ` Russell King - ARM Linux
2010-01-22 11:49           ` Wolfram Sang
2010-01-22 11:49             ` Wolfram Sang
2010-01-22 16:47             ` Jamie Lokier
2010-01-22 16:47               ` Jamie Lokier
2010-01-22 16:47           ` Jamie Lokier
2010-01-22 16:47             ` Jamie Lokier
2010-01-22 16:57             ` Russell King - ARM Linux
2010-01-22 16:57               ` Russell King - ARM Linux
2010-01-22 11:58 ` Wolfram Sang
2010-01-22 11:58   ` Wolfram Sang
2010-01-24 10:48   ` Valentin Longchamp
2010-01-24 10:48     ` Valentin Longchamp
2010-05-05  9:47     ` Valentin Longchamp
2010-05-05 16:42       ` Greg KH
2010-05-05 23:48       ` gregkh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12731032952456@kroah.org \
    --to=gregkh@suse.de \
    --cc=alan@linux.intel.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=philippe.retornaz@epfl.ch \
    --cc=s.hauer@pengutronix.de \
    --cc=stable@kernel.org \
    --cc=valentin.longchamp@epfl.ch \
    --cc=w.sang@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.