All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: imx: reduce irq-latency after rx overflow
@ 2015-06-20 17:25 ` Manfred Schlaegl
  0 siblings, 0 replies; 9+ messages in thread
From: Manfred Schlaegl @ 2015-06-20 17:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Manfred Schlaegl

To prevent problems with interrupt latency, and due to the fact, that
the error will be counted anyway (icount.overrun), the dev_err is simply
removed.

Background:
If an rx-fifo overflow occurs a dev_err message was called in interrupt
context. Since dev_err messages are written to console in a synchronous way
(unbuffered), and console may be a serial terminal, this leads to a
highly increased interrupt-latency (several milliseconds).
As a result of the high latency more rx-fifo overflows will happen, and
therefore a feedback loop of errors is created.

Signed-off-by: Manfred Schlaegl <manfred.schlaegl@gmx.at>
---
 drivers/tty/serial/imx.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 384cf1d..40fd32c 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -767,7 +767,6 @@ static irqreturn_t imx_int(int irq, void *dev_id)
 		writel(USR1_AWAKE, sport->port.membase + USR1);
 
 	if (sts2 & USR2_ORE) {
-		dev_err(sport->port.dev, "Rx FIFO overrun\n");
 		sport->port.icount.overrun++;
 		writel(USR2_ORE, sport->port.membase + USR2);
 	}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] serial: imx: reduce irq-latency after rx overflow
@ 2015-06-20 17:25 ` Manfred Schlaegl
  0 siblings, 0 replies; 9+ messages in thread
From: Manfred Schlaegl @ 2015-06-20 17:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Manfred Schlaegl

To prevent problems with interrupt latency, and due to the fact, that
the error will be counted anyway (icount.overrun), the dev_err is simply
removed.

Background:
If an rx-fifo overflow occurs a dev_err message was called in interrupt
context. Since dev_err messages are written to console in a synchronous way
(unbuffered), and console may be a serial terminal, this leads to a
highly increased interrupt-latency (several milliseconds).
As a result of the high latency more rx-fifo overflows will happen, and
therefore a feedback loop of errors is created.

Signed-off-by: Manfred Schlaegl <manfred.schlaegl@gmx.at>
---
 drivers/tty/serial/imx.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 384cf1d..40fd32c 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -767,7 +767,6 @@ static irqreturn_t imx_int(int irq, void *dev_id)
 		writel(USR1_AWAKE, sport->port.membase + USR1);
 
 	if (sts2 & USR2_ORE) {
-		dev_err(sport->port.dev, "Rx FIFO overrun\n");
 		sport->port.icount.overrun++;
 		writel(USR2_ORE, sport->port.membase + USR2);
 	}
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] serial: imx: reduce irq-latency after rx overflow
  2015-06-20 17:25 ` Manfred Schlaegl
@ 2015-06-22  6:48   ` Alexander Stein
  -1 siblings, 0 replies; 9+ messages in thread
From: Alexander Stein @ 2015-06-22  6:48 UTC (permalink / raw)
  To: Manfred Schlaegl
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel,
	Manfred Schlaegl

Am Samstag, 20. Juni 2015, 19:25:52 schrieb Manfred Schlaegl:
> To prevent problems with interrupt latency, and due to the fact, that
> the error will be counted anyway (icount.overrun), the dev_err is simply
> removed.
> 
> Background:
> If an rx-fifo overflow occurs a dev_err message was called in interrupt
> context. Since dev_err messages are written to console in a synchronous way
> (unbuffered), and console may be a serial terminal, this leads to a
> highly increased interrupt-latency (several milliseconds).
> As a result of the high latency more rx-fifo overflows will happen, and
> therefore a feedback loop of errors is created.

I understand your rationale but removing this error message from kernel log removes the possibility to detect serial overruns by simply check the kernel log or output on kernel console. AFAICS you have to use TIOCGICOUNT to get the error counters.
How about introducing a rate limit for this kernel message?

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
 
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] serial: imx: reduce irq-latency after rx overflow
@ 2015-06-22  6:48   ` Alexander Stein
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Stein @ 2015-06-22  6:48 UTC (permalink / raw)
  To: Manfred Schlaegl
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel,
	Manfred Schlaegl

Am Samstag, 20. Juni 2015, 19:25:52 schrieb Manfred Schlaegl:
> To prevent problems with interrupt latency, and due to the fact, that
> the error will be counted anyway (icount.overrun), the dev_err is simply
> removed.
> 
> Background:
> If an rx-fifo overflow occurs a dev_err message was called in interrupt
> context. Since dev_err messages are written to console in a synchronous way
> (unbuffered), and console may be a serial terminal, this leads to a
> highly increased interrupt-latency (several milliseconds).
> As a result of the high latency more rx-fifo overflows will happen, and
> therefore a feedback loop of errors is created.

I understand your rationale but removing this error message from kernel log removes the possibility to detect serial overruns by simply check the kernel log or output on kernel console. AFAICS you have to use TIOCGICOUNT to get the error counters.
How about introducing a rate limit for this kernel message?

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
 
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] serial: imx: reduce irq-latency after rx overflow
  2015-06-22  6:48   ` Alexander Stein
  (?)
@ 2015-06-22  8:20   ` Manfred Schlaegl
  2015-06-22  9:47       ` Alexander Stein
  -1 siblings, 1 reply; 9+ messages in thread
From: Manfred Schlaegl @ 2015-06-22  8:20 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel,
	Manfred Schlaegl

[-- Attachment #1: Type: text/plain, Size: 1783 bytes --]

On 2015-06-22 08:48, Alexander Stein wrote:
> Am Samstag, 20. Juni 2015, 19:25:52 schrieb Manfred Schlaegl:
>> To prevent problems with interrupt latency, and due to the fact, that
>> the error will be counted anyway (icount.overrun), the dev_err is simply
>> removed.
>>
>> Background:
>> If an rx-fifo overflow occurs a dev_err message was called in interrupt
>> context. Since dev_err messages are written to console in a synchronous way
>> (unbuffered), and console may be a serial terminal, this leads to a
>> highly increased interrupt-latency (several milliseconds).
>> As a result of the high latency more rx-fifo overflows will happen, and
>> therefore a feedback loop of errors is created.
> 
> I understand your rationale but removing this error message from kernel log removes the possibility to detect serial overruns by simply check the kernel log or output on kernel console. AFAICS you have to use TIOCGICOUNT to get the error counters.
> How about introducing a rate limit for this kernel message?
> 

Hello!

I understand your argument, but:
 1. In my personal opinion kernel error messages should only be used on internal errors (missing resources, asserts, ...) and in cases where no other way is (yet) available to report errors (by counters, return values, ...). Lost RX bytes on uarts seem more like a communication error and should be silently handled by higher layers using error counters, or protocol internal mechanisms.
 2. I have found no other serial driver (except serial-tegra and imx) that reports this kind of errors using kernel messages.
 3. Error counters for serial interfaces can also be retrieved from userspace by using procfs -> implemented in serial_core; e.g. /proc/tty/driver/IMX-uart.

best regards,
manfred


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] serial: imx: reduce irq-latency after rx overflow
  2015-06-22  8:20   ` Manfred Schlaegl
@ 2015-06-22  9:47       ` Alexander Stein
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Stein @ 2015-06-22  9:47 UTC (permalink / raw)
  To: Manfred Schlaegl
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel,
	Manfred Schlaegl

Hello Manfred,

On Monday 22 June 2015 10:20:10, Manfred Schlaegl wrote:
> On 2015-06-22 08:48, Alexander Stein wrote:
> > Am Samstag, 20. Juni 2015, 19:25:52 schrieb Manfred Schlaegl:
> >> To prevent problems with interrupt latency, and due to the fact, that
> >> the error will be counted anyway (icount.overrun), the dev_err is simply
> >> removed.
> >>
> >> Background:
> >> If an rx-fifo overflow occurs a dev_err message was called in interrupt
> >> context. Since dev_err messages are written to console in a synchronous way
> >> (unbuffered), and console may be a serial terminal, this leads to a
> >> highly increased interrupt-latency (several milliseconds).
> >> As a result of the high latency more rx-fifo overflows will happen, and
> >> therefore a feedback loop of errors is created.
> > 
> > I understand your rationale but removing this error message from kernel log removes the possibility to detect serial overruns by simply check the kernel log or output on kernel console. AFAICS you have to use TIOCGICOUNT to get the error counters.
> > How about introducing a rate limit for this kernel message?
> > 
> 
> Hello!
> 
> I understand your argument, but:
>  1. In my personal opinion kernel error messages should only be used on internal errors (missing resources, asserts, ...) and in cases where no other way is (yet) available to report errors (by counters, return values, ...). Lost RX bytes on uarts seem more like a communication error and should be silently handled by higher layers using error counters, or protocol internal mechanisms.
>  2. I have found no other serial driver (except serial-tegra and imx) that reports this kind of errors using kernel messages.
>  3. Error counters for serial interfaces can also be retrieved from userspace by using procfs -> implemented in serial_core; e.g. /proc/tty/driver/IMX-uart.

Ah, I've just noticed those errors will only be written when > 0. I think this is fine. A bit cumbersome for automatic parsing, but reading manually will be ok.

Acked-By: Alexander Stein <alexander.stein@systec-electronic.com>

Best regards,
Alexander Stein
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
 
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] serial: imx: reduce irq-latency after rx overflow
@ 2015-06-22  9:47       ` Alexander Stein
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Stein @ 2015-06-22  9:47 UTC (permalink / raw)
  To: Manfred Schlaegl
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel,
	Manfred Schlaegl

Hello Manfred,

On Monday 22 June 2015 10:20:10, Manfred Schlaegl wrote:
> On 2015-06-22 08:48, Alexander Stein wrote:
> > Am Samstag, 20. Juni 2015, 19:25:52 schrieb Manfred Schlaegl:
> >> To prevent problems with interrupt latency, and due to the fact, that
> >> the error will be counted anyway (icount.overrun), the dev_err is simply
> >> removed.
> >>
> >> Background:
> >> If an rx-fifo overflow occurs a dev_err message was called in interrupt
> >> context. Since dev_err messages are written to console in a synchronous way
> >> (unbuffered), and console may be a serial terminal, this leads to a
> >> highly increased interrupt-latency (several milliseconds).
> >> As a result of the high latency more rx-fifo overflows will happen, and
> >> therefore a feedback loop of errors is created.
> > 
> > I understand your rationale but removing this error message from kernel log removes the possibility to detect serial overruns by simply check the kernel log or output on kernel console. AFAICS you have to use TIOCGICOUNT to get the error counters.
> > How about introducing a rate limit for this kernel message?
> > 
> 
> Hello!
> 
> I understand your argument, but:
>  1. In my personal opinion kernel error messages should only be used on internal errors (missing resources, asserts, ...) and in cases where no other way is (yet) available to report errors (by counters, return values, ...). Lost RX bytes on uarts seem more like a communication error and should be silently handled by higher layers using error counters, or protocol internal mechanisms.
>  2. I have found no other serial driver (except serial-tegra and imx) that reports this kind of errors using kernel messages.
>  3. Error counters for serial interfaces can also be retrieved from userspace by using procfs -> implemented in serial_core; e.g. /proc/tty/driver/IMX-uart.

Ah, I've just noticed those errors will only be written when > 0. I think this is fine. A bit cumbersome for automatic parsing, but reading manually will be ok.

Acked-By: Alexander Stein <alexander.stein@systec-electronic.com>

Best regards,
Alexander Stein
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
 
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] serial: imx: reduce irq-latency after rx overflow
@ 2015-06-20 16:47 ` manfred.schlaegl
  0 siblings, 0 replies; 9+ messages in thread
From: manfred.schlaegl @ 2015-06-20 16:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Manfred Schlaegl

To prevent problems with interrupt latency, and due to the fact, that
the error will be counted anyway (icount.overrun), the dev_err is simply
removed.

Background:
If an rx-fifo overflow occurs a dev_err message was called in interrupt
context. Since dev_err messages are written to console in a synchronous way
(unbuffered), and console may be a serial terminal, this leads to a
highly increased interrupt-latency (several milliseconds).
As a result of the high latency more rx-fifo overflows will happen, and
therefore a feedback loop of errors is created.

Signed-off-by: Manfred Schlaegl <manfred.schlaegl@gmx.at>
---
 drivers/tty/serial/imx.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 384cf1d..40fd32c 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -767,7 +767,6 @@ static irqreturn_t imx_int(int irq, void *dev_id)
 		writel(USR1_AWAKE, sport->port.membase + USR1);
  	if (sts2 & USR2_ORE) {
-		dev_err(sport->port.dev, "Rx FIFO overrun\n");
 		sport->port.icount.overrun++;
 		writel(USR2_ORE, sport->port.membase + USR2);
 	}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] serial: imx: reduce irq-latency after rx overflow
@ 2015-06-20 16:47 ` manfred.schlaegl
  0 siblings, 0 replies; 9+ messages in thread
From: manfred.schlaegl @ 2015-06-20 16:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Manfred Schlaegl

To prevent problems with interrupt latency, and due to the fact, that
the error will be counted anyway (icount.overrun), the dev_err is simply
removed.

Background:
If an rx-fifo overflow occurs a dev_err message was called in interrupt
context. Since dev_err messages are written to console in a synchronous way
(unbuffered), and console may be a serial terminal, this leads to a
highly increased interrupt-latency (several milliseconds).
As a result of the high latency more rx-fifo overflows will happen, and
therefore a feedback loop of errors is created.

Signed-off-by: Manfred Schlaegl <manfred.schlaegl@gmx.at>
---
 drivers/tty/serial/imx.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 384cf1d..40fd32c 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -767,7 +767,6 @@ static irqreturn_t imx_int(int irq, void *dev_id)
 		writel(USR1_AWAKE, sport->port.membase + USR1);
  	if (sts2 & USR2_ORE) {
-		dev_err(sport->port.dev, "Rx FIFO overrun\n");
 		sport->port.icount.overrun++;
 		writel(USR2_ORE, sport->port.membase + USR2);
 	}
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-06-22  9:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-20 17:25 [PATCH] serial: imx: reduce irq-latency after rx overflow Manfred Schlaegl
2015-06-20 17:25 ` Manfred Schlaegl
2015-06-22  6:48 ` Alexander Stein
2015-06-22  6:48   ` Alexander Stein
2015-06-22  8:20   ` Manfred Schlaegl
2015-06-22  9:47     ` Alexander Stein
2015-06-22  9:47       ` Alexander Stein
  -- strict thread matches above, loose matches on Subject: below --
2015-06-20 16:47 manfred.schlaegl
2015-06-20 16:47 ` manfred.schlaegl

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.