* [PATCH] OMAP: UART: Keep the TX fifo full when possible
@ 2013-07-08 10:04 ` Alexander Savchenko
0 siblings, 0 replies; 7+ messages in thread
From: Alexander Savchenko @ 2013-07-08 10:04 UTC (permalink / raw)
To: gregkh, jslaby, matts, paulmck, santosh.shilimkar, dhowells
Cc: linux-serial, linux-kernel, Alexander Savchenko
From: Dmitry Fink <finik@ti.com>
Current logic results in interrupt storm since the fifo
is constantly below the threshold level. Change the logic
to fill all the available spaces in the fifo as long as
we have data to minimize the possibilty of underflow and
elimiate excessive interrupts.
Signed-off-by: Dmitry Fink <finik@ti.com>
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
---
drivers/tty/serial/omap-serial.c | 3 ++-
include/uapi/linux/serial_reg.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index b6d1728..5c9b074 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -310,7 +310,8 @@ static void transmit_chars(struct uart_omap_port *up, unsigned int lsr)
serial_omap_stop_tx(&up->port);
return;
}
- count = up->port.fifosize / 4;
+ count = up->port.fifosize -
+ (serial_in(up, UART_OMAP_TXFIFO_LVL) & 0xFF);
do {
serial_out(up, UART_TX, xmit->buf[xmit->tail]);
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
index e632260..97c26be 100644
--- a/include/uapi/linux/serial_reg.h
+++ b/include/uapi/linux/serial_reg.h
@@ -366,6 +366,7 @@
#define UART_OMAP_MDR1_FIR_MODE 0x05 /* FIR mode */
#define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */
#define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */
+#define UART_OMAP_TXFIFO_LVL 0x1A /* TX FIFO fullness */
/*
* These are definitions for the Exar XR17V35X and XR17(C|D)15X
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] OMAP: UART: Keep the TX fifo full when possible
@ 2013-07-08 10:04 ` Alexander Savchenko
0 siblings, 0 replies; 7+ messages in thread
From: Alexander Savchenko @ 2013-07-08 10:04 UTC (permalink / raw)
To: gregkh, jslaby, matts, paulmck, santosh.shilimkar, dhowells
Cc: linux-serial, linux-kernel, Alexander Savchenko
From: Dmitry Fink <finik@ti.com>
Current logic results in interrupt storm since the fifo
is constantly below the threshold level. Change the logic
to fill all the available spaces in the fifo as long as
we have data to minimize the possibilty of underflow and
elimiate excessive interrupts.
Signed-off-by: Dmitry Fink <finik@ti.com>
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
---
drivers/tty/serial/omap-serial.c | 3 ++-
include/uapi/linux/serial_reg.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index b6d1728..5c9b074 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -310,7 +310,8 @@ static void transmit_chars(struct uart_omap_port *up, unsigned int lsr)
serial_omap_stop_tx(&up->port);
return;
}
- count = up->port.fifosize / 4;
+ count = up->port.fifosize -
+ (serial_in(up, UART_OMAP_TXFIFO_LVL) & 0xFF);
do {
serial_out(up, UART_TX, xmit->buf[xmit->tail]);
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
index e632260..97c26be 100644
--- a/include/uapi/linux/serial_reg.h
+++ b/include/uapi/linux/serial_reg.h
@@ -366,6 +366,7 @@
#define UART_OMAP_MDR1_FIR_MODE 0x05 /* FIR mode */
#define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */
#define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */
+#define UART_OMAP_TXFIFO_LVL 0x1A /* TX FIFO fullness */
/*
* These are definitions for the Exar XR17V35X and XR17(C|D)15X
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] OMAP: UART: Keep the TX fifo full when possible
2013-07-08 10:04 ` Alexander Savchenko
(?)
@ 2013-08-20 15:57 ` Kevin Hilman
2013-08-27 14:32 ` Kevin Hilman
2013-08-27 23:03 ` Greg KH
-1 siblings, 2 replies; 7+ messages in thread
From: Kevin Hilman @ 2013-08-20 15:57 UTC (permalink / raw)
To: Alexander Savchenko
Cc: gregkh, jslaby, matts, Paul McKenney, Santosh Shilimkar,
dhowells, linux-serial, LKML
+ Felipe
On Mon, Jul 8, 2013 at 3:04 AM, Alexander Savchenko
<oleksandr.savchenko@ti.com> wrote:
> From: Dmitry Fink <finik@ti.com>
>
> Current logic results in interrupt storm since the fifo
> is constantly below the threshold level. Change the logic
> to fill all the available spaces in the fifo as long as
> we have data to minimize the possibilty of underflow and
> elimiate excessive interrupts.
>
> Signed-off-by: Dmitry Fink <finik@ti.com>
> Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
Hmm, another OMAP serial patch that wasn't Cc'd to linux-omap where
OMAP users might have seen it. :(
I just bisected a strange problem in linux-next on OMAP3 down to this
patch. Reverting it fixes the problem.
On OMAP3530 Beagle and Overo, after boot, doing a 'cat /proc/cpuinfo'
was not returning to a prompt, suggesting something strange with the
FIFO. Hitting return gets me back to a prompt.
Greg, this one should also be dropped from tty-next until it can be
further investgated and the problem solved.
Thanks,
Kevin
> ---
> drivers/tty/serial/omap-serial.c | 3 ++-
> include/uapi/linux/serial_reg.h | 1 +
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
> index b6d1728..5c9b074 100644
> --- a/drivers/tty/serial/omap-serial.c
> +++ b/drivers/tty/serial/omap-serial.c
> @@ -310,7 +310,8 @@ static void transmit_chars(struct uart_omap_port *up, unsigned int lsr)
> serial_omap_stop_tx(&up->port);
> return;
> }
> - count = up->port.fifosize / 4;
> + count = up->port.fifosize -
> + (serial_in(up, UART_OMAP_TXFIFO_LVL) & 0xFF);
> do {
> serial_out(up, UART_TX, xmit->buf[xmit->tail]);
> xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
> diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
> index e632260..97c26be 100644
> --- a/include/uapi/linux/serial_reg.h
> +++ b/include/uapi/linux/serial_reg.h
> @@ -366,6 +366,7 @@
> #define UART_OMAP_MDR1_FIR_MODE 0x05 /* FIR mode */
> #define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */
> #define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */
> +#define UART_OMAP_TXFIFO_LVL 0x1A /* TX FIFO fullness */
>
> /*
> * These are definitions for the Exar XR17V35X and XR17(C|D)15X
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] OMAP: UART: Keep the TX fifo full when possible
2013-08-20 15:57 ` Kevin Hilman
@ 2013-08-27 14:32 ` Kevin Hilman
2013-08-27 23:03 ` Greg KH
1 sibling, 0 replies; 7+ messages in thread
From: Kevin Hilman @ 2013-08-27 14:32 UTC (permalink / raw)
To: gregkh
Cc: jslaby, matts, Paul McKenney, Santosh Shilimkar, David Howells,
linux-serial, LKML, linux-omap
Greg,
On Tue, Aug 20, 2013 at 8:57 AM, Kevin Hilman <khilman@linaro.org> wrote:
> + Felipe
>
> On Mon, Jul 8, 2013 at 3:04 AM, Alexander Savchenko
> <oleksandr.savchenko@ti.com> wrote:
>> From: Dmitry Fink <finik@ti.com>
>>
>> Current logic results in interrupt storm since the fifo
>> is constantly below the threshold level. Change the logic
>> to fill all the available spaces in the fifo as long as
>> we have data to minimize the possibilty of underflow and
>> elimiate excessive interrupts.
>>
>> Signed-off-by: Dmitry Fink <finik@ti.com>
>> Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
>
> Hmm, another OMAP serial patch that wasn't Cc'd to linux-omap where
> OMAP users might have seen it. :(
>
> I just bisected a strange problem in linux-next on OMAP3 down to this
> patch. Reverting it fixes the problem.
>
> On OMAP3530 Beagle and Overo, after boot, doing a 'cat /proc/cpuinfo'
> was not returning to a prompt, suggesting something strange with the
> FIFO. Hitting return gets me back to a prompt.
>
> Greg, this one should also be dropped from tty-next until it can be
> further investgated and the problem solved.
Can this one be dropped from tty-next too until it can be
investigated. The author's ti.com addresses are bouncing, and this
has introduced a regression in -next.
Kevin
>> ---
>> drivers/tty/serial/omap-serial.c | 3 ++-
>> include/uapi/linux/serial_reg.h | 1 +
>> 2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
>> index b6d1728..5c9b074 100644
>> --- a/drivers/tty/serial/omap-serial.c
>> +++ b/drivers/tty/serial/omap-serial.c
>> @@ -310,7 +310,8 @@ static void transmit_chars(struct uart_omap_port *up, unsigned int lsr)
>> serial_omap_stop_tx(&up->port);
>> return;
>> }
>> - count = up->port.fifosize / 4;
>> + count = up->port.fifosize -
>> + (serial_in(up, UART_OMAP_TXFIFO_LVL) & 0xFF);
>> do {
>> serial_out(up, UART_TX, xmit->buf[xmit->tail]);
>> xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
>> diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
>> index e632260..97c26be 100644
>> --- a/include/uapi/linux/serial_reg.h
>> +++ b/include/uapi/linux/serial_reg.h
>> @@ -366,6 +366,7 @@
>> #define UART_OMAP_MDR1_FIR_MODE 0x05 /* FIR mode */
>> #define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */
>> #define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */
>> +#define UART_OMAP_TXFIFO_LVL 0x1A /* TX FIFO fullness */
>>
>> /*
>> * These are definitions for the Exar XR17V35X and XR17(C|D)15X
>> --
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] OMAP: UART: Keep the TX fifo full when possible
2013-08-20 15:57 ` Kevin Hilman
2013-08-27 14:32 ` Kevin Hilman
@ 2013-08-27 23:03 ` Greg KH
1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2013-08-27 23:03 UTC (permalink / raw)
To: Kevin Hilman
Cc: Alexander Savchenko, jslaby, matts, Paul McKenney,
Santosh Shilimkar, dhowells, linux-serial, LKML
On Tue, Aug 20, 2013 at 08:57:25AM -0700, Kevin Hilman wrote:
> + Felipe
>
> On Mon, Jul 8, 2013 at 3:04 AM, Alexander Savchenko
> <oleksandr.savchenko@ti.com> wrote:
> > From: Dmitry Fink <finik@ti.com>
> >
> > Current logic results in interrupt storm since the fifo
> > is constantly below the threshold level. Change the logic
> > to fill all the available spaces in the fifo as long as
> > we have data to minimize the possibilty of underflow and
> > elimiate excessive interrupts.
> >
> > Signed-off-by: Dmitry Fink <finik@ti.com>
> > Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
>
> Hmm, another OMAP serial patch that wasn't Cc'd to linux-omap where
> OMAP users might have seen it. :(
>
> I just bisected a strange problem in linux-next on OMAP3 down to this
> patch. Reverting it fixes the problem.
>
> On OMAP3530 Beagle and Overo, after boot, doing a 'cat /proc/cpuinfo'
> was not returning to a prompt, suggesting something strange with the
> FIFO. Hitting return gets me back to a prompt.
>
> Greg, this one should also be dropped from tty-next until it can be
> further investgated and the problem solved.
Now reverted, thanks.
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] OMAP: UART: Keep the TX fifo full when possible
@ 2013-07-03 10:40 ` Alexander Savchenko
0 siblings, 0 replies; 7+ messages in thread
From: Alexander Savchenko @ 2013-07-03 10:40 UTC (permalink / raw)
To: gregkh, jslaby, matts, paulmck, santosh.shilimkar, dhowells
Cc: linux-serial, linux-kernel, ti-linux-patch-review
From: Dmitry Fink <finik@ti.com>
Current logic results in interrupt storm since the fifo
is constantly below the threshold level. Change the logic
to fill all the available spaces in the fifo as long as
we have data to minimize the possibilty of underflow and
elimiate excessive interrupts.
Signed-off-by: Dmitry Fink <finik@ti.com>
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
---
[rebased according to 3.10]
drivers/tty/serial/omap-serial.c | 3 ++-
include/uapi/linux/serial_reg.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index fe50375..6a07a9b 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -316,7 +316,8 @@ static void transmit_chars(struct uart_omap_port *up, unsigned int lsr)
serial_omap_stop_tx(&up->port);
return;
}
- count = up->port.fifosize / 4;
+ count = up->port.fifosize -
+ (serial_in(up, UART_OMAP_TXFIFO_LVL) & 0xFF);
do {
serial_out(up, UART_TX, xmit->buf[xmit->tail]);
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
index e632260..97c26be 100644
--- a/include/uapi/linux/serial_reg.h
+++ b/include/uapi/linux/serial_reg.h
@@ -366,6 +366,7 @@
#define UART_OMAP_MDR1_FIR_MODE 0x05 /* FIR mode */
#define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */
#define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */
+#define UART_OMAP_TXFIFO_LVL 0x1A /* TX FIFO fullness */
/*
* These are definitions for the Exar XR17V35X and XR17(C|D)15X
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] OMAP: UART: Keep the TX fifo full when possible
@ 2013-07-03 10:40 ` Alexander Savchenko
0 siblings, 0 replies; 7+ messages in thread
From: Alexander Savchenko @ 2013-07-03 10:40 UTC (permalink / raw)
To: gregkh, jslaby, matts, paulmck, santosh.shilimkar, dhowells
Cc: linux-serial, linux-kernel, ti-linux-patch-review
From: Dmitry Fink <finik@ti.com>
Current logic results in interrupt storm since the fifo
is constantly below the threshold level. Change the logic
to fill all the available spaces in the fifo as long as
we have data to minimize the possibilty of underflow and
elimiate excessive interrupts.
Signed-off-by: Dmitry Fink <finik@ti.com>
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
---
[rebased according to 3.10]
drivers/tty/serial/omap-serial.c | 3 ++-
include/uapi/linux/serial_reg.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index fe50375..6a07a9b 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -316,7 +316,8 @@ static void transmit_chars(struct uart_omap_port *up, unsigned int lsr)
serial_omap_stop_tx(&up->port);
return;
}
- count = up->port.fifosize / 4;
+ count = up->port.fifosize -
+ (serial_in(up, UART_OMAP_TXFIFO_LVL) & 0xFF);
do {
serial_out(up, UART_TX, xmit->buf[xmit->tail]);
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
index e632260..97c26be 100644
--- a/include/uapi/linux/serial_reg.h
+++ b/include/uapi/linux/serial_reg.h
@@ -366,6 +366,7 @@
#define UART_OMAP_MDR1_FIR_MODE 0x05 /* FIR mode */
#define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */
#define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */
+#define UART_OMAP_TXFIFO_LVL 0x1A /* TX FIFO fullness */
/*
* These are definitions for the Exar XR17V35X and XR17(C|D)15X
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-08-27 23:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-08 10:04 [PATCH] OMAP: UART: Keep the TX fifo full when possible Alexander Savchenko
2013-07-08 10:04 ` Alexander Savchenko
2013-08-20 15:57 ` Kevin Hilman
2013-08-27 14:32 ` Kevin Hilman
2013-08-27 23:03 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2013-07-03 10:40 Alexander Savchenko
2013-07-03 10:40 ` Alexander Savchenko
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.